Skip to content

[WIP] Reduce bundle size #271

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

Conversation

brendanmoore
Copy link
Contributor

Work in progress not considered final but sharing for feedback. Ref #260

  • Added: Rollup build. (dist/main-rollup-es.js)
    • Output es-modules bundle
    • Output commonjs compatible bundle?
    • Output umd compatible bundle?
  • Added: Minification build to webpack config to compare with Rollup.
  • Removed: Some build pre-process cleanup for file comparisons.
  • Investigate sideEffects: false

Switching the bundler to Rollup can yield real file size improvements of 36KB (see screenshot). Some more investigation/testing is required to ensure the new bundle is backwards compatible, and whether or not we should continue to support umd and/or commonjs?

screen shot 2018-03-14 at 15 43 42

Added: Rollup build
Remove: Some build pre-process cleanup for file comparisons
@coveralls
Copy link

Pull Request Test Coverage Report for Build 185

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 76.227%

Totals Coverage Status
Change from base Build 175: 0.0%
Covered Lines: 587
Relevant Lines: 757

💛 - Coveralls

@@ -1,61 +1,57 @@
{
"name": "react-sortable-tree",
"version": "2.1.0",
"description": "Drag-and-drop sortable component for nested data and hierarchies",
"description":
Copy link
Member

Choose a reason for hiding this comment

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

I should probably ignore package.json in prettierrc. Can you discard unrelated changes? and/or put it in another PR Thanks :)

@wuweiweiwu
Copy link
Member

wuweiweiwu commented Mar 28, 2018

Other than nits. LGTM 👍

I would have to do some research on umd/commonjs since I'm not very knowledgable on that topic. My first impression is to ensure backwards compatibility.

#273 would be a pretty decently sized rewrite where we can cleanup the dnd manager. And sideEffects effects

@wuweiweiwu
Copy link
Member

After some investigation. I think I will follow the example here to serve both commonjs, umd, and es2015 builds. via babel and rollup.

However, I will also be doing a major revamp / rewrite of the codebase soon. So I will wait till after that to update the builds

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

Successfully merging this pull request may close these issues.

3 participants