UNPKG

jetpack

Version:

Jetpack wraps webpack and nodemon to give you the best development workflow.

266 lines (171 loc) 12 kB
# 3.1.0 - Removed `commander` in favor of native Node.js `parseArgs` util, this might have slight affect on cli flags - Upgrade all dependencies, including `rspack@1.1.2` - Switch `core-js` to usage mode for smaller bundles as less and less `core-js` is needed for smaller browsers - Improve portability of `jetpack` - running it without installing it locally should work better now # 3.0.0 **Replacing webpack with rspack! 🎉** - Breaking change: Replaces `webpack` with `rspack` - this adds a significant performance boost to jetpack. This is largely backwards compatible. However, if you customise your webpack in jetpack.config.js you might need to read the rspack [migration guides](https://rspack.dev/guide/migration/webpack). - Breaking change: Replaces `postcss` with the faster `lightningcss` via rspack's builtin loaders. It serves the same purpose of lowering css syntax for older browsers. - Upgrade `sass-loader` to use the modern `sass-embedded` which is significantly faster, this should be backwards compatible, but expect sass warnings if you're using older sass syntax. # 2.1.0 - Adds `chunkLoadRetry` option for reloading chunks - Upgrade all dependencies # 2.0.0 - Breaking change: styles are exported as named exports, so you must now write `import * as style from "./style.css"`, see https://github.com/webpack-contrib/css-loader/releases/tag/v7.0.0 for further details - Upgrade all dependencies # 1.4.0 - Upgrade all dependencies - Add support for `jetpack.config.cjs` in addition to `jetpack.config.js` - helps in ESM native Node.js projects # 1.3.0 - Upgrade all dependencies - Fix the `-x, -exec` command # 1.2.1 - Fix: Correctly parse the `--config` command line arg. - Patch dependencies via npm audit # 1.2.0 - Upgrade all dependencies - Remove preact example, since the example was out of date # 1.1.0 - Upgrade all dependencies # 1.0.0 - Jetpack has been used in prod for years now and deserves a 1.0.0 🥳 # 0.30.0 - Upgrade to webpack 5! - Switch to swc-loader from babel for super fast build times! - Log build progress (disable with `--no-progress` or `progress: false` in the config - Improve error handling, log unexpected errors when serving bundles in development instead of hanging - Remove the graceful termination fix introduced in 0.21.1 as it does not appear to work in node@16 - Replace url-loader and file-loader with webpack 5 native asset support - Upgrade all dependencies - **Breaking:** switch to the latest browserslist defaults - this makes both `modern` and `legacy` builds the same by default, but you can still configure each one independently - **Breaking:** the runtime content is now referenced via `runtime` instead of `assets.runtime` in the template - **Breaking:** simplified logging behind `--log` flag, choose between `info`, `progress` or `none`, with default being `info,progress` - **Breaking:** removed support for react-hot-loader, you can still tweak your config to pull it in, but it is no longer automatically configured, use `react-refresh` instead! - **Breaking:** remove --jsx command line flag, use config instead # 0.22.0 - Add support for optional chaining and nullish coalescing operator. This is supported by babel out of the box, but since jetpack is still on webpack 4 (it's faster?), we need to include the right plugins explicitly for this to work. - Upgrade all of the non breaking dependencies # 0.21.1 - Fix graceful termination in `jetpack/serve`. In case the req is destroyed, make sure to also destroy the upstream proxyReq to the dev server, so that the request does not hold up the server from closing. # 0.21.0 - Upgrade all dependencies. Except do not upgrade to webpack 5 just yet and do not upgrade plugins that dropped webpack 4 support. # 0.20.1 - Fix proxy feature - proxy the query params correctly (issue #89) # 0.20.0 - Upgrade all dependencies, this includes updating to `PostCSS 8` and includes a breaking change to the webpack config generated by jetpack around the `postcss-loader` # 0.19.0 - Default to `fast-refresh` for React hot reloading if `react-hot-loader` is not installed in the project # 0.18.1 - Install caniuse-lite as a project dependency, to force install the latest version globally in the dependency tree. Previously, a message "Browserslist: caniuse-lite is outdated. Please run next command `npm update`" would show up to jetpack's users. # 0.18.0 - Upgrade all dependencies # 0.17.2 - Allow removing `core-js` alias to allow for any version of `core-js`. See https://github.com/KidkArolis/jetpack/pull/69. # 0.17.1 - Add `options.publicPath` - allows to specify where assets will be served from, e.g. a CDN url. # 0.17 **Big improvements! 🎉** - Add support for differential bundling - jetpack can output modern and legacy bundles - Modern bundles are smaller and less transpiled compared to the previous version - Ship a complementary package for differential serving - [jetpack-serve](https://github.com/KidkArolis/jetpack-serve) - Transpile node_modules ensuring modern packages from npm work as expected - Add content hashes to output file names to improve long term caching - Add `-i, --print-config` option to dev and build commands - Upgrade all dependencies **Differential bundling** - By default, jetpack only compiles for modern browsers. - To see what browsers those are, jetpack provides a new command `jetpack browsers` that prints the browserslist query, list of browsers and coverage. - To opt into legacy browser bundling you should configure a new option `options.target = { modern: true, legacy: true }`. - Or pass `--legacy`, `--modern` or both to `serve`, `build`, `inspect` and `browsers`, e.g.: ``` $ jetpack --legacy $ jetpack inspect --legacy $ jetpack browsers --legacy $ jetpack browsers --modern $ jetpack browsers --legacy --modern ``` - Previously, jetpack would not always correctly transpile async/await. Now, jetpack ships with it's own copy of regenerator, but only uses it in legacy browsers by default. Modern browsers will get no async/await transpilation! - You can customize what browsers are considered modern and legacy using any of the methods supported by browserslist. Use `modern` and `legacy` environments to configure the browsers for each. Here's an example of `.browserslistrc` file: ``` [modern] > 10% [legacy] > 0.1% ``` - You can check that the configuration is taken into account by running `jetpack browsers` whenever you tweak your browserslist. **Differential serving** - For production serving, jetpack opted to not use module/no module approach by default due to it's 2 limitations: - First, at the moment, module/no module option in @babel/preset-env transpiles async/await into regenerator and that's not desired for modern browsers. - Second, over time, the browsers that support modules will get old, and by using browser detection to serve the right bundle we can keep transpiling less and less in the future. - By default, if you only produce a modern bundle, the output is backward compatible and can be served the same way as in previous versions of jetpack, e.g. using `express.static` middleware or by uploading `dist` to a CDN. If you produce both modern and legacy bundles, however, you will have to use the built in `jetpack/serve` module or the new [jetpack-serve(https://github.com/KidkArolis/jetpack-serve) package. Jetpack's serve middleware now detects if the browser is modern or not using the same browserslist queries used in bundling and serves the appropriate html file the `index.html` or `index.legacy.html` as appropriate. See https://github.com/KidkArolis/jetpack-serve for more details on usage. **Print config** - You can now see the config that has been generated for your dev or production builds by running some of the following: ``` jetpack -i jetpack --print-config jetpack --print-config --legacy jetpack build --print-config jetpack build --print-config --modern jetpack build --print-config --legacy ``` This prints the config using Node's `util.inspect`, and since webpack config is a JavaScript data structure that might contain functions, classes, instances and other non easily serializable things, not everyhting might be easily inspectable in this output. This is not meant to be used as copy paste into `webpack.config.js` (althought it could be a good starting point), it's mostly meant for debugging any issues and understanding exactly what jetpack is doing in your project. # 0.16.1 - Run postcss over sass loader output, this fixes autoprefixing sass - Upgrade all dependencies # 0.16 - Fix compiler error handling - catch build errors thoroughly and always exit with status 1 if compilation fails for any reason. - Fix all security warnings - Upgrade all dependencies, brings in file-loader@4.0.0, url-loader@2.0.0, css-loader@3.0.0 that have some breaking changes # 0.15 - Add support for Sass! Simply install `node-sass` or `sass` and import '.scss' files. Works with css modules, allows specifying `resources: []` that become available to each scss file. - Fix an issue where jetpack/serve was running command line arg parsing, preventing ability to require apps that import jetpack/serve. This is useful when you try and require your app for debugging and tests. - Upgrade to core-js@3 - Upgrade all dependencies # 0.14.2 - Fix compiler error handling # 0.14.1 - Fix compiler error handling # 0.14.0 - Upgrade all deps - Fix how `babel` and `@babel/preset-env` detects module types when deciding how to inject polyfills, by using `sourceType: 'unambiguous'`, we ensure that no matter if you use CJS or ESM in your modules, jetpack will bundle them correctly and inject core-js polyfills correctly (most of the time anyway..). # 0.13.0 - Upgrade all deps - Fix `react-hot-loader` webpack plugin config # 0.12.2 - Fix reading `title` from config file # 0.12.1 - Fix where `react-hot-loader` is loaded from, it should be loaded from the target dir # 0.12.0 - Rename the `--no-hot` shorthand from `-h` to `-r`, to reclaim `-h` for help info - Fix `jetpack.config.js#hot` option, it wasn't being read from options since cli arg was always defaulting to `false` - No longer refresh the page if webpack hot patch is not accepted, for nicer user experience. It's still possible to configure page reloading with manual config override using `jetpack.config.js#webpack`. - Improve hot reloading support. `react-hot-loader` has been removed from jetpack. User's of jetpack now need to install `react-hot-loader` to opt into using it. Webpack config has been updated to work with `react-hot-loader@4.6.0` which supports React Hooks out of the box and improves the overall experience. To use this you first need to install `react-hot-loader` with `npm i -D react-hot-loader` and then update the code from: ``` import { hot } from 'jetpack/react-hot-loader' const App = () => <div>Hello World!</div> export default hot(module)(App) ``` to ``` import { hot } from 'react-hot-loader/root' const App = () => <div>Hello World!</div> export default hot(App) ``` # 0.11.0 - Upgrade css-loader to 2.0.0. This upgrades it's dependency on PostCSS to v7, which means there's only one version of PostCSS being used by jetpack, which means faster install times and better performance. # 0.10.4 - Fix `jetpack/serve` production mode, serve index.html if requested pathname does not exist in dist # 0.10.3 - Remove console.log from the jetpack/serve module # 0.10.2 - Fix `jetpack inspect` command - Fix `proxy` to properly handle node's req and res - Fix compatibility # 0.10.1 - Fix `react-hot-loader` to work even when jetpack not installed locally - Fix `proxy` to work with non express servers - Only configure `react-hot-loader` if hot reloading is enabled and react is installed # 0.10.0 Everything changed. Apologies if it broke your project. See the README and docs to learn about all the new features, command line args and configuration options.