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

Use @wordpress/scripts for building and linting, and stop bundling React #65

Merged
merged 5 commits into from
Feb 24, 2020

Conversation

johnwatkins0
Copy link
Member

Description of the Change

This resolves #50 by installing @wordpress/scripts and using that package's scripts for building and linting. React is no longer included in the bundled JS. I was also able to remove some of the devDependencies that come with @wordpress/scripts, and I switched the ESLint and WebPack configs to use the configs provided.

I also ran the lint scripts from @wordpress/scripts and made all the suggested changes.

Alternate Designs

The CSS is bundled with the JS. It could be pulled out with MiniCssExtractPlugin, but I wasn't aware of a compelling reason to do so.

Benefits

The built script is smaller. Including @wordpress/scripts allows us to make use of the many tools that package provides.

Possible Drawbacks

Verification Process

Pull this branch to your local environment. Run npm run install && npm run build. React should not be included in the build. This can be hard to verify. I sometimes temporarily install the Webpack Bundle Analyzer plugin to double-check what's included.

After rebuilding, the component should still work in the editor.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Integrate @wordpress/scripts for building and linting

@jeffpaul jeffpaul added the type:bug Something isn't working. label Feb 19, 2020
@jeffpaul jeffpaul added this to the 1.1.0 milestone Feb 19, 2020
@jeffpaul jeffpaul requested a review from dinhtungdu February 19, 2020 05:52
Copy link
Contributor

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

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

Awesome 🎉

@jeffpaul jeffpaul merged commit 688e49a into develop Feb 24, 2020
@jeffpaul jeffpaul deleted the feature/wp-scripts branch February 24, 2020 20:26
@jeffpaul jeffpaul modified the milestones: 1.1.0, 1.0.3 Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distribution file bundles React
3 participants