Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Investigate how to stop building @bufferapp/ui with commonjs #237

Open
6 tasks
msanroman opened this issue Sep 17, 2020 · 1 comment
Open
6 tasks

Investigate how to stop building @bufferapp/ui with commonjs #237

msanroman opened this issue Sep 17, 2020 · 1 comment
Assignees
Labels
scoping Tasks involving investigation

Comments

@msanroman
Copy link
Member

msanroman commented Sep 17, 2020

What

  • Remove commonjs-related build steps.
  • Make sure we are able to export independently any component (without bringing in the whole library).
  • Test:
    • Run https://www.npmjs.com/package/webpack-bundle-analyzer on a product repo (best to try with bufferapp/buffer-engage-client).
    • Install beta version with these changes on that repo.
    • Run the bundle analyzer again: we should see a decrease in size regarding what's brought by bufferapp/ui

Why
We have a Babel plugin called @babel/plugin-transform-modules-commonjs (https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs) transforming ECMAScript modules to CommonJS. Our bundle is much bigger, and we can't use tree shaking (we could have a third-party webpack plugin on top of that to get tree shaking but doesn't seem efficient)

@hamstu
Copy link
Contributor

hamstu commented Sep 21, 2020

Yes! 👏 👏 👏

@anafilipadealmeida anafilipadealmeida changed the title Stop building @bufferapp/ui with commonjs and allow consumers to tree shake it Investigate how to stop building @bufferapp/ui with commonjs Sep 29, 2020
@anafilipadealmeida anafilipadealmeida added the scoping Tasks involving investigation label Sep 29, 2020
@msanroman msanroman linked a pull request Oct 27, 2020 that will close this issue
19 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scoping Tasks involving investigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants