preact-cli icon indicating copy to clipboard operation
preact-cli copied to clipboard

experimental: Using preact-iso to lazy load components

Open rschristian opened this issue 3 years ago • 1 comments

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

rschristian avatar Aug 13 '22 01:08 rschristian

🦋 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

changeset-bot[bot] avatar Aug 13 '22 01:08 changeset-bot[bot]