This is a major update that upgrades every piece of the toolchain, including the latest versions of underlying tools - Webpack 4 and Babel 7. It also brings a new documentation site: preactjs.com/cli.
Here are the features:
Modern JavaScript output
Modern versions of your JavaScript bundles are automatically generated and delivered to the 90% of browsers that support modern JS. Legacy browsers are still fully supported through selectively added polyfills.
Critical CSS inlining
In order to avoid render-blocking network requests, Preact CLI V3 uses Critters to inline critical CSS automatically in production builds.
Workbox
This version moves from v2's sw-precache to using Workbox for service worker generation. Along with this, we've also introduced a new API for customizing your service workers without giving up Preact CLI's default configuration. See the Preact CLI Service Worker documentation for more info.
Partial hydration
Applications built with Preact CLI are automatically hydrated in stages, allowing your app's "shell" to render while the code and resources necessary for routes are still loading. This ensures parts of the page become interactive as the code that powers them is downloaded.
Better template and service worker editing
Every new project now includes template.html and sw.js source files, which you can edit or replace to make changes. Older projects can be upgraded from Preact CLI version 2 by copying these files to the src directory.
CMS support for prerendering
The --prerenderUrls command-line argument now accepts a .js file path. Pointing this at a module that exports an async function makes it possible to dynamically fetch data from a CMS or other content source, which is then used to generate and prerender pages:
Built-in prerender data serialization and hydration
Preact CLI now serializes the data used during --prerenderUrls prerendering, inlining it into the HTML pages. Data is automatically picked up during hydration and passed to your root component, and can also be accessed anywhere in an app using @preact/prerender-data-provider.
Prefresh-ready!
Version 3 of Preact CLI also comes with the option of using Prefresh, a new and improved form of Hot Module Replacement built and maintained by the Preact team.
Most importantly
Thanks to all the people who contributed to Preact CLI v3: it wouldn't have happened without you! 😄
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
⚠️ Dependabot is rebasing this PR ⚠️
Rebasing might not happen immediately, so don't worry if this takes some time.
Note: if you make any changes to this PR yourself, they will take precedence over the rebase.
Bumps preact-cli from 3.0.0-rc.14 to 3.0.5.
Release notes
Sourced from preact-cli's releases.
... (truncated)
Commits
a6bac80
Version Packages (#1491)57cb566
Fix/prerender arg validation (#1490)1d145f7
Version Packages (#1439)41fedbd
Reversing options and command order (#1481)30fb1fc
Refactor: Remove 'sw-debug.js' from prod output (#1478)67fafc8
Allow only valid options for commands (#1467)4cc93ba
Adding blank page for fallback (#1441)2c53b0a
Allow an async component to return null rendering (#1438)6670ba0
fix: await copying of files in create command (#1461)c72600a
Bump ejs-loader from 0.3.7 to 0.5.0 (#1403)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)