Open kungufli opened 4 years ago
... or consider using a better bundler, or not sending so much JS to the client to begin with.
Yes please update to use modern bundling in our angular app I'm getting this warning.
qrcode.component.ts depends on 'qrcode'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
@leon that's really a problem on your end, a limitation with your bundler. (And the example used by the author of the linked article).
You can configure your build to allow certain dependencies to be CommonJS, this will remove the warning.
... or you could try an upcoming bundler, which converts everything to ESM: https://github.com/evanw/esbuild (not production ready).
Any updates on this? Last commit was on 6 Nov 2019. Is this repo dead, do we need a new one?
This is by and large a do e project. New development may happen to keep things working and merging prs for features y'all need :)
Commonjs is going to continue to be the default for a while. Bundlers support it or have plugins. Esm is not suitable for serving directly to browsers. At some point it may be worth it but it's an anti goal to manage bundling optimization for every user.
@soldair looks like rollup used, you can just add few options for providing cjs (as you do) and esm format too. Just 2 formats will be presented in lib. ESM currently become default for browsers.
Tree shaking is not working with the way the lib is currently shipped. I believe that esm build should solve the problem.
Common shake is a thing. Wonder if it's still maintained
On Wed, Aug 16, 2023, 10:23 AM Ivan Soroka @.***> wrote:
Tree shaking is not working with the way the lib is currently shipped. I believe that esm build should solve the problem.
— Reply to this email directly, view it on GitHub https://github.com/soldair/node-qrcode/issues/236#issuecomment-1681004197, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5IX6TP2ADE5H6OJWP3PTXVT6Y3ANCNFSM4OIHMONA . You are receiving this because you were mentioned.Message ID: @.***>
I vote this gets converted to ESM.
ESM is the trend, would love to see this library get upgraded.
This is dead
Not really dead. just mostly done.
On Tue, Dec 5, 2023, 3:45 AM Lars Rye Jeppesen @.***> wrote:
This is dead
— Reply to this email directly, view it on GitHub https://github.com/soldair/node-qrcode/issues/236#issuecomment-1840622703, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5IXY2L6B5NV2ZPOD4FX3YH4CMNAVCNFSM4OIHMONKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBUGA3DEMRXGAZQ . You are receiving this because you were mentioned.Message ID: @.***>
bumping this up. saw a #241 . could this PR address this item?
has this been done?
I would really like to have an solution here, as it causes a lot of bundling errors
Not really dead. just mostly done. …
Hi @soldair , thanks for your package we've been using for some time. How's it going with the migration ? If you still struggling with it, maybe we can help. Also now with ChatGpt is easier to convert the code to ESM.
What's the workaround for this on vite? Neither optimizeDeps
nor commonjsOptions
seem to help.
Is there any chance this library to be converted to ECMAScript modules? This will allow for a better bundle size optimization at build time for Angular apps, or apps that uses webpack or similar minifiers (https://web.dev/commonjs-larger-bundles/).