Comments (11)
Thanks @okikio, works much better now! I'm seeing some other suspicious behavior, let me open another issue
from bundlejs.
Ok
from bundlejs.
@thoughtspile Sorry, for the delay, but after a through analysis of the bundl, a deconstruction and re-write of the virtual filesystem of bundlejs, it seems it keeps trying to bundle in the parser, and I can't quite figure out why.
It doesn't really make any sense as to why it keeps trying to bundle the parser, this might be an esbuild-wasm bug of some sort, it's super inconsistent, and due to the lack of an AST it's really difficult to debug where it's messing up
from bundlejs.
After a couple more experiments it seems for treeshaking to work in an ideal way it needs to have all the files it needs to traverse up front, the problem is that is double the build time versus just bundling it once.
I've setup a seperate branch with the treeshaking exeriments https://bundle-git-treeshaking-fix-okikio-dev.vercel.app/?q=date-fns&treeshake=%5B%7B+isAfter+%7D%5D&config=%7B%22esbuild%22%3A%7B%22minify%22%3Afalse%7D%7D
from bundlejs.
Good news, I seem to have a permanent solution to the problem of poor treeshaking.
It seems this issue is caused by esbuild being unable to determine if it should include sideEffects or not.
On a local file system esbuild can easily just look up the package.json
files but it can't quite do that when using a virtual fs, so the solution is to just let esbuild know to use sideEffects
if it's stated in the package.json
file
from bundlejs.
Hi again my friend @okikio! Got a chance to roll out the fix? Still seeing odd sizes in badges:
![Снимок экрана 2023-07-02 в 20 38 25](https://private-user-images.githubusercontent.com/5262915/250384864-c4e91053-33cb-4b86-938f-485dc1f07411.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc0OTY1OTMsIm5iZiI6MTcxNzQ5NjI5MywicGF0aCI6Ii81MjYyOTE1LzI1MDM4NDg2NC1jNGU5MTA1My0zM2NiLTRiODYtOTM4Zi00ODVkYzFmMDc0MTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYwNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MDRUMTAxODEzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDJiNjA5ZGFhMGFhYTk4ZDkzMjMxZWQ0NjRkMWQ3YzM2MDNmM2MxNjkwYmNmMjk3ZjFjMTJiZDBkYzM4MGIzYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.5ynsJTyQmWfPEqW4Fn1Elnq8L2f1YHlWEWFjPaaPh7U)
from bundlejs.
I was able to fix it, I just hadn't found a chance to publish it. This weekend is a little hectic, I should be able to get the fix out by Tuesday or Wednesday this week
from bundlejs.
The API hasn't been fixed yet, but here is the newly improved treeshaking
from bundlejs.
The API is now fixed as well. Treeshaking should now work properly across the website and API. I'll keep this issue open, please let me know if you notice any issues
https://bundlejs.com/?q=date-fns&treeshake=%5B%7B+isAfter+%7D%5D&bundle
from bundlejs.
@thoughtspile Does the fix work for you?
from bundlejs.
Since the fix seems to work ill close this issue
from bundlejs.
Related Issues (20)
- Size reported of bundle is off HOT 3
- getRequest [Failed at request] HOT 4
- Incorrent treeshake size in badge/API HOT 3
- API error HOT 22
- Strange behavior when using multiplug badges HOT 7
- Possible badge caching issue HOT 6
- Fetch the versions mentioned in package.json. HOT 4
- Fail to bundle `npm/lib/cli-entry.js` and `@npmcli/arborist` HOT 6
- Generates an incorrect URL for a Redux Toolkit nested entry point HOT 6
- Failed to build node-libcurl ("Couldn't load") HOT 1
- no longer works by default (with unpkg) HOT 4
- Build failed for `[email protected]` HOT 3
- [FIXED] Cross-Origin Read Blocking made the badges unavailable on Github Readmes HOT 3
- Build fails for `[email protected]` HOT 2
- Config externals shortcut HOT 3
- Exclude `await import('[...'])` in bundle size? HOT 2
- ✘ [ERROR] Do not know how to load path: http-url:{JS_FILE_PATH} HOT 5
- Failed for tippy.js HOT 5
- Can't load [email protected] HOT 1
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 bundlejs.