Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Posts analytics React app #21878

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Adding Posts analytics React app #21878

wants to merge 20 commits into from

Conversation

peterzimon
Copy link
Contributor

ref https://linear.app/ghost/issue/DES-1021/create-posts-app

Part of establishing React patterns in Ghost is to build a well-defined and fairly self-encapsulated app through which we can test assumptions and define best practices. Our guinea pig is Post analytics for this purpose. This PR creates a new React app (posts) using Shade (the new design system).

Copy link
Contributor

@allouis allouis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments - overall looks good but there are a lot of files with missing newlines at the end, which I think they should have - EditorConfig should be enforcing that for us.

Also the change to vite config in the admin-x-framework package, I'm not sure I fully understand that

@@ -111,7 +111,8 @@
"dependsOn": [
"test:unit",
"^build",
"@tryghost/admin-x-design-system:test:unit"
"@tryghost/admin-x-design-system:test:unit",
"@tryghost/shade:test:unit"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that if the shade tests fail the admin-x-framework tests will fail too, is that what you want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... Maybe not yet. We just added the current design system to it to catch DS bugs, but maybe we can leave Shade out until its first release. Good point.

/>
</React.StrictMode>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline here - do you have the EditorConfig plugin installed in your editor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thx, fixed

@@ -10,6 +11,11 @@ export default (function viteConfig() {
plugins: [
react()
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this alias used anywhere, can we revert the changes in this file?

@@ -0,0 +1,60 @@
import {cn} from '@/lib/utils';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see the prefix is used here - this is a new pattern, am interested in discussing it further!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is coming from ShadCN/UI. We could set it up differently but I quite like how clean this makes imports. We agreed to discuss this wider and maybe implement all across the codebase.

@@ -67,13 +67,14 @@
"@ebay/nice-modal-react": "1.2.13",
"@radix-ui/react-avatar": "1.1.0",
"@radix-ui/react-checkbox": "1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@radix-ui/react-dropdown-menu": "^2.1.3",
"@radix-ui/react-dropdown-menu": "2.1.3",

"@radix-ui/react-form": "0.0.3",
"@radix-ui/react-popover": "1.1.1",
"@radix-ui/react-radio-group": "1.2.0",
"@radix-ui/react-separator": "1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "1.1.0",
"@radix-ui/react-tabs": "1.1.0",
"@radix-ui/react-tabs": "^1.1.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@radix-ui/react-tabs": "^1.1.2",
"@radix-ui/react-tabs": "1.1.2",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants