Request: Allow only a part of the library to be imported
See original GitHub issueDependabot created a pull request to one of our repositories to update from v6 to v7, and the changes in our output were as follows (as reported by bundlesize):
PASS ./bundlesize/app.js: 46.65KB < maxSize 75KB gzip (same as master)
WARN ./bundlesize/vendor.js: 289.01KB < maxSize 350KB gzip (5.59KB larger than master, careful!)
PASS ./bundlesize/app.css: 22.66KB < maxSize 50KB gzip (same as master)
WARN ./bundlesize/vendor.css: 3.97KB < maxSize 10KB gzip (864B larger than master, careful!)
This means updating sweetalert2 resulted in 5.59KB additional JS and 864B additional CSS in our build, while we don’t use the new features. Granted this is not much on its own, but I do see this increasing over time.
Please allow us to only import a part of the codebase, so that we don’t have to include code that we’re not going to use.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
How to import only in parts of the code? [Python]
Yes. You move the import statement from the top of the script to the point in your script where you want it. For...
Read more >Importing Existing Libraries to Your Connected Workspace in ...
Right-click on a library file in the Projects panel and select Import Library from the context menu. Select Tools » Import Library in...
Read more >Python import: Advanced Techniques and Tips
While it's a good idea to separate scripts and libraries, all Python files can be both executed and imported.
Read more >5. The import system — Python 3.11.1 documentation
A direct call to __import__() performs only the module search and, if found, ... While certain side-effects may occur, such as the importing...
Read more >How to import a library in Python – with example - CodeBerry
Pip allows us to install packages from indexes such as the Python Package Index. One of the most commonly installed and used libraries...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The first rule of sys admins 😄 But not for JS developers, we are here to BREAK THINGS! 😈
That’s a good point.
Changing the imports makes the javascript increase go from +5.59KB to +450B, a tenth of the original change!
Now it looks like this:
I’d prefer to take both from
src
, but doing that would lead to an increased javascript size again. Reason for using src would be that we can run it through our own webpack configuration, which also generates sourcemaps for node_modules.