Skip to content

Conversation

@jonkoops
Copy link
Contributor

@jonkoops jonkoops commented Jun 3, 2024

Replaces WebPack with Vite to build the demo app, this reduces the amount of dependencies and is also a faster and more consistent development experience. Works towards closing #7287

{
"files": ["packages/react-integration/demo-app-ts/**/*"],
"rules": {
"patternfly-react/no-anonymous-functions": "off",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This linting rule gives false positives for class components that already have a displayName, so I've turned this off. For example:

class MyComponent extends React.Component {
  static displayName = "MyComponent"; // It doesn't like this.
}

"files": ["packages/react-integration/demo-app-ts/**/*"],
"rules": {
"patternfly-react/no-anonymous-functions": "off",
"react/react-in-jsx-scope": "off",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no need for this, as Vite uses the JSX transform.

"rules": {
"patternfly-react/no-anonymous-functions": "off",
"react/react-in-jsx-scope": "off",
"spaced-comment": "off"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This gives a false positive, so I've disabled it for now.

"start": "yarn build && concurrently --kill-others \"yarn watch\" \"yarn workspace @patternfly/react-docs develop\"",
"start:cypress": "lerna run cypress:open",
"start:demo-app": "lerna run start:demo-app --stream",
"start:demo-app:hot": "lerna run start:demo-app:hot --stream",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hot reloading is default in Vite during development, so it is no longer needed to keep this separate script around.

@patternfly-build
Copy link
Contributor

patternfly-build commented Jun 3, 2024

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test never ran, so I removed it.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@tlabaj tlabaj merged commit f4228be into patternfly:main Jun 5, 2024
@jonkoops jonkoops deleted the demo-app-vite branch June 6, 2024 15:29
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.

5 participants