The best tools are already shipping solutions: https://sapper.svelte.technology/guide#routing https://polymer.github.io/pwa-starter-kit/configuring-and-personalizing/ … https://nextjs.org/docs/#automatic-code-splitting … https://ionicframework.com/pwa/toolkit https://github.com/developit/preact-cli … etc. etc.
-
-
Replying to @slightlylate @wycats and
Ooo, Vue is a prime example of this. Allow component to component registrations to accept `() => import()`, allow routes to accept `() => import()`, anywhere you import modules for your framework, should also have the capability to wire up those same dependencies w/ `import()`.
3 replies 1 retweet 10 likes -
-
Replying to @dan_abramov @TheLarkInn and
It’s important though that you can do it for heavy leaves without showing spinners or holes for these leaves. That’s how React implementation is different and I hope more libraries take note of this.
2 replies 1 retweet 14 likes -
Replying to @dan_abramov @TheLarkInn and
Is there a succinct description of what you hope I take note of? I'm paying attention! :D
1 reply 0 retweets 5 likes -
Replying to @wycats @TheLarkInn and
Sure. Basically any leaf can suspend rendering. Including due to code splitting. But we don’t show the spinner necessarily where it suspended. Instead we let you specify <Placeholder> *somewhere* above. Making your loading states intentional, not an artifact of bundle split.
1 reply 4 retweets 62 likes -
Replying to @dan_abramov @wycats and
So you can have <Placeholder fallback={<Spinner />}> <Modal /> </Placeholder> And then somewhere deep in the Modal there is Autocomplete. If it’s code split, React can show spinner in Modal backdrop — or even next to Button that caused Modal to show.
2 replies 1 retweet 20 likes -
Replying to @dan_abramov @wycats and
This means that you can code split more at any point in time — for example to load ModalHeader — without worrying about changing design. You already have a Placeholder. It will wait for both ModalHeader and Autocomplete as it tries to render Modal.
1 reply 0 retweets 18 likes -
Replying to @dan_abramov @wycats and
As a bonus, in concurrent mode we can skip showing the spinner altogether if it loads fast enough. We don’t show holes either. We just show the complete Modal if it’s ready fast enough. That’s what Fiber architecture allows.
2 replies 0 retweets 18 likes -
Replying to @dan_abramov @wycats and
The modal example is fun because it means you’re not constrained by DOM hierarchy. If modal is a portal from some form, loading state for thay modal can be handled that form. Even though technically it’s top level body child in the DOM.
2 replies 0 retweets 24 likes
Yeah this all makes sense. Thanks for the explanation
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.