Comments (3)
@alexeyraspopov Thanks for the quick response and detailed information.
I think the best thing to do is wait until we're sure tree-shaking is working as expected, once all class components have been converted to functions. Then, if I'm still seeing large bundle sizes then I can set up a simple test-case project to highlight the issue if that helps.
from semiotic.
@dgwyer, if you look at changes introduced in #561, recent versions of Semiotic actually became smaller and, most importantly, enabled tree-shaking to ensure unnecessary code elimination on the users side. See 2.0.0-rc.18 on Bundlephobia (580kb
minified, tree-shaking enabled for the first time) and compare it to 1.20.6 on Bundlephobia (826kb minified
). The fact that recent changes made it so the package delivered as a single file bundle can be misleading comparing to previous version that is simply a bunch of files.
In the latest versions we ensure no dependencies being bundled or duplicated, and ESM bundle available (along with CJS) to get all the benefits from the modern tooling: tree-shaking, easier way to import stuff from the lib (without remembering explicit paths), unified approach of using the lib via CDN and with build systems, etc.
With that said, there are still some stuff to be done and some code to be refactored before 2.0 is out, so I can confidently say that the bundle will get even smaller.
If you're seeing that your tool of choice is not making use of tree-shaking, consider exploring necessary config changes to enable those. If you use modern bundlers like Parcel or Vite, tree-shaking should be working by default.
If you're still experiencing the issue with the tool bundling the whole library at once, consider setting up some repo with configs/tools that reproduce the issue, so we can address it together and update the docs to make sure others won't need to struggle with this.
from semiotic.
I did some more digging into tree shaking in Semiotic, and it is now quite possible that the bundle of choice might opt-out of tree-shaking even v2.0.0-rc.19
due to some class components being compiled to ES5. Since TS uses IIFE to wrap compiled classes code, it makes some tree-shaking algorithms consider the bundle not ready for eliminating unused code.
We're committed to converting class components to functions so the issue won't take too much time to be fixed. Thanks for bringing my attention to this, I'll also see how can we test/analyze tree-shaking capability.
from semiotic.
Related Issues (20)
- Use Vercel to deploy developer documentation for latest HOT 2
- Decide whether to consolidate semiotic and semiotic-docs repo HOT 8
- Check if auto-external plugin can warn us about import errors
- Add to contributing doc when to upgrade dependencies.
- Run typescript checks in CI
- Add documentation issues from archived repo
- oSort with connectors causes issues in OrdinalFrame
- Create changelog for 2.0 HOT 2
- Add Migration Guide for 1.0 users
- Replace element-resize-event HOT 5
- Sorting in OrdinalFrame Doesn't Work With Dynamic Column Width
- Frames' space allocation behavior can be generalized
- Canvas Rendering Doesn't Initially Render HOT 3
- Remove redundant attribute [Was: class and className entries] HOT 1
- Transition tooltip position HOT 1
- More position options for the legend HOT 3
- How to use with nteract?
- Ability to specify width in terms of percentage
- Some of the website pages are fully blank
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semiotic.