preact-cli
preact-cli copied to clipboard
experimental: Using preact-iso to lazy load components
What kind of change does this PR introduce?
Experimental refactor
Did you add tests for your changes?
Yes
Summary
Deprecates async-loader and automatic route splitting for instead relying on lazy loading, like with preact-iso's lazy().
Code splitting as it previously worked was quite opaque, relying on magic directory names rather than user code.
This should make bundle splitting much more transparent by moving the control into user code.
// before
import Home from './routes/home';
// after
const Home = lazy(() => import('./routes/home.js'));
Does this PR introduce a breaking change?
Yes
🦋 Changeset detected
Latest commit: 076d599adfba8e6627f0bfe5c46c1ed66f114b2a
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| preact-cli | Major |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR