Comments (9)
We used to do this. It made the bundle size HUGE for not much gain. It can probably be done efficiently with selective, dynamic imports.
A solution should use https://nextjs.org/docs/app/building-your-application/optimizing/bundle-analyzer to make sure it doesn't bloat the bundle.
from stacker.news.
How about just importing the files for a few popular languages to tackle this one? If so, which languages would you want to support?
from stacker.news.
If they’re dynamically imported, it shouldn’t matter how many we support. But maybe we can find the top 5 somewhere
from stacker.news.
I'm not sure how you'd decide when to "dynamically import" a language file. Selectively importing languages on build would keep the size down but you'd be limited those that you choose. If you mean importing them on the fly then that's a whole different ball game.
from stacker.news.
If you mean importing them on the fly then that's a whole different ball game.
That's the ball game I mean.
Unless we use dynamic imports, this isn't worth the bundle size bloat. Maybe we can dynamically import all languages. It's been a long time since I've looked at the code, but I think each language can be imported only when they're used.
from stacker.news.
Well there is such a thing as dynamic imports but that isn't what you refer to as dynamic imports. You can choose which languages you want ahead of time but not during runtime.
from stacker.news.
https://mieszkogulinski.github.io/next-js-conditional-dynamic-import/
from stacker.news.
That's cool but once you've imported how do you decide when to drop it or does it just "exist" for the duration of the page view?
from stacker.news.
You don't decide to drop it. The browser caches it or doesn't. The main thing is that it's only downloaded if it's used.
from stacker.news.
Related Issues (20)
- Set a reasonable boost max HOT 1
- Can't withdraw sats to Alby Extension HOT 2
- Addition of Naira(NGN) to fiat currencies
- "Unable to get image fees" HOT 1
- Sats forwarded to anon don't go to rewards HOT 1
- Feature Request: Arrows to flip through photos HOT 2
- Prevent new account creation from /login
- Add 'This day on SN' to empty /search page
- Limited rights for "anon" account HOT 2
- Territories have statistics for dates they didn't exist yet HOT 2
- Make dependence on web assembly optional HOT 3
- Top Cowboys page has territory selector which doesn't actually do anything
- Text Overflowing Out Of Bounds For "invoice canceled" Notification HOT 5
- Pull down to refresh on iOS
- No territories on mobile HOT 6
- Undefined comment root in profile items HOT 1
- Territory payment does not fallback to QR code HOT 1
- When subscribing to a Post item, OP comments do not have notifications
- Search using URL: not finding Twitter link
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 stacker.news.