3.0.0
🎉 Yeah, version 3 is finally here 🎉
Let’s recap the most important changes since the last 2.x.x release:
- prompting: First class support for React SPAs (2f00fb4)
- React will be used and set up like described here when choosing to build a single page application.
- So Baumeister is able to set up:
- a static site generator (using Handlebars and Frontmatters), if you choose to build a static website.
- a React app with all the bells and whistles, if you choose to build a single page app.
- build: Replace Gulp with webpack (and npm scripts) (c6116ad)
- bootstrap: Upgrade to Bootstrap 4 (c7b4264)
-
- See Bootstrap v4 migration guide to read about the most notable as well as breaking changes.
-
- polyfills: Dynamically import and lazy load polyfills (ef5f6b5), closes micromata/baumeister#235
- This keeps the vendor bundle in modern browser smaller because
polyfills are only loaded when the used browser actually needs them.
- This keeps the vendor bundle in modern browser smaller because
Notable Changes since the last beta
Code Refactoring
- scripts: serve build via
npm run build:serve(496a15b)
Features
- add PRODUCTION constant to ESLint config (fbc804b)
- first class support for React SPAs (2f00fb4)
- improve the cacheability of the vendor bundle (d9b60e4)
- reduce noise in terminal (especially in watch mode) (46aea0b)
- setup Babel plugin transform-imports (b779eef)
- setup tree shaking (b490094)
BREAKING CHANGES
-
scripts: Changed the npm script name for serving the dist directory from
npm run build:checktonpm run build:serve -
The webpack runtime has moved into a separate file. Therefore you need to add a reference to that file into your HTML / Handlebars file(s) before the vendor bundle:
<!-- webpack runtime JS --> @@runtime.js <!-- Vendor JS --> @@vendor.js <!-- Own JS --> @@app.js
See https://developers.google.com/web/fundamentals/performance/webpack/use-long-term-caching#webpack_runtime_code for details about the why.
See all changes since the last prerelease.
Migration Guide
Below you’ll find the list of all breaking changes since the last 2.x.x release and what you have to adapt.
-
build: Gulp and all the tasks are gone. But most of the npm scripts still do what they did before. Here are the main scripts needed for developing and building your project.
Command Description npm startBuilds for development, starts a webserver, watches files for changes, rebuilds incremental and reloads your browser. npm testLints your JavaScript files and runs unit test via the Jest CLI. npm run test:watchRuns unit test with Jests watch option. npm run buildBuilds for production to distdirectory.npm run build:serveStarts a static fileserver serving the distdirectory.npm run build:analyzeStarts »Webpack Bundle Analyzer« to visualize size of Webpack output files See
scriptssection inpackage.jsonfor all available scripts. -
build: The bundled polyfills moved to the vendor bundle, the webpack runtime has moved into a separate file. Plus the references to the bundles have changed. You have to update the references in your HTML / Handlebars file(s):
<!-- Bundled vendor CSS files --> @@vendor.css <!-- Our compiled and merged Sass files --> @@app.css […] <!-- webpack runtime JS --> @@runtime.js <!-- Bundled vendor CSS files --> @@vendor.css <!-- Our compiled and merged Sass files --> @@app.css
-
polyfills: Polyfills are now dynamically imported and lazy loaded to decrease the size of the vendor bundle for modern browsers. See README for details.
-
eslint: We ’ve added eslint-plugin-unicorn and eslint-plugin-import which might introduce new linting errors. You might want to turn off rules in
/.eslintrc.jsonin case you find them too opinionated. -
baumeister.json: The properties
bundleCSSandincludeStaticFilesin baumeister.json have moved tovendor.bundleCSSandvendor.includeStaticFiles. You have to adapt these changes in case you have added dependencies via these properties. -
bootstrap: We’ve updated to Bootstrap 4. See Bootstrap v4 migration guide to read about the most notable as well as breaking changes.
See all changes since the last release.