react-boilerplate v4.0.0 Release Notes

Release Date: 2019-04-18 // almost 5 years ago
  • v4.0: "The One With Hooks (And Much More)" Edition

    React Boilerplate v4.0 is out and it's a doozy! Here are the highlights:

    • React has added many new features and it's time for React Boilerplate to embrace them.
      • We now use React.lazy and Suspense for component lazy-loading instead of an external library.
      • We've added useInjectSaga and useInjectReducer hooks to manage saga and reducer injection. They're integrated into the generators and thus become the new defaults. (Should you need them, the HOCs are still there.)
      • The generators don't support classes anymore. The PureComponent vs Component choice was replaced with an option to wrap your component inside React.memo.
    • After much deliberation, Immutable.js is finally gone. We've added Immer instead. With it, we can write very concise and readable reducers while sticking to native JavaScript data structures.
    • ๐Ÿš€ Following the release of React Hooks, it's become even clearer that react-testing-library is now the industry-standard for React DOM testing. Workarounds for the incompatibilities between enzyme and styled-components are gone and we can now write leaner and more meaningful tests.

    ๐Ÿ“š There are many more changes to our documentation, internals and general project setup. You can find a full changelog below.

    Huge thanks to @Mensae, @gretzky, @jwinn and everyone who helped review or submit PRs! If I've forgotten your contribution in the credits below, please let me know.

    ๐Ÿš€ We hope you enjoy this release and welcome any feedback, bug reports or feature suggestions you can send our way!

    Main

    • โœ‚ Remove Immutable.js in favor of Immer (@julienben, @robertaird)
    • โœ… Migrate from enzyme to react-testing-library (@Mensae)
      • New instructions for snapshot and behavior testing
    • Embracing Hooks (@julienben)
      • Add eslint-plugin-react-hooks
      • Migrate all class components to functions
      • Add useInjectSaga and useInjectReducer hooks
      • Remove generator options to extend Component or PureComponent. Replace with a React.memo option.
    • ๐Ÿ‘‰ Use React.lazy and Suspense instead of loadable-components to code-split and asynchronously load components (@julienben)

    ๐Ÿ“š Documentation updates

    โšก๏ธ Internals updates

    • Many dependency updates including: (@julienben)
      • react and react-dom (16.6 to 16.8.6)
      • react-redux (5 to 7) (@bumi001, @jwinn)
      • connected-react-router (4 to 6)
      • react-router-dom (4 to 5)
      • redux-saga (0.16 to 1)
      • sanitize.css (4 to 8)
    • Update default saga injection mode to DAEMON (@howardya)
    • โšก๏ธ Update generators to reflect all the stack changes
    • Migrate default Node version to lts/dubnium (@julienben)
    • Fix support for stylelint (@jwinn)
    • Fix setup script for Windows environments (@Mensae)
    • Generate passing tests for components/containers (@mjhost)
    • Rewrite generators code (@Mensae)
    • Complete rewrite or generate-templates-for-linting.js (@Mensae)
    • webpack.DefinePlugin => webpack.EnvironmentPlugin (@nshimiye)
    • New Webpack code splitting config (@julienben)
    • Remove process.noDeprecation = true (@spawnia)
    • Miscellaneous fixes (@ngtan)

    ๐Ÿšง Project maintenance


Previous changes from v3.7.0

  • ๐Ÿ†• News

    ๐Ÿš€ Welcome to a new React Boilerplate release with improvements aplenty, bug fixes and major dependency upgrades! Big thanks to @gretzky, @justingreenberg, @jwinn and everyone who helped review and submit PRs for this release!

    โฌ†๏ธ For existing projects, the only way to upgrade from 3.6.0 is to manually apply the changes from #2403 to your project. Please be careful when doing so as it isn't officially supported and could break things on your end.

    โšก๏ธ Next steps will include re-thinking immutability in the store (RFC @ #2092), re-organizing docs, saga improvements, smart bundling and plenty more. Please keep the PRs coming. And if you're up for it, remember that you can use the dev branch to test all the latest updates and report bugs!

    Main

    • ๐Ÿ’… Upgrades to Babel 7, React 16.6, ESLint 5, styled-components 4 (@julienben)
      • Config file and Babel plugin cleanup (@gretzky)
      • Fix extract-intl script for Babel 7 (@fanixk)
    • Webpack improvements
      • Removal of dll plugin (@gretzky)
      • Gzipping and better optimization config in prod (@gretzky)
      • react-app-polyfill for targeted IE support (@gretzky)
      • Switch from UglifyJS to Terser plugin (@robertaird)
      • Icons generated by webpack-pwa-manifest plugin (@Mensae)
    • Switch from Yarn back to npm (@julienben)
    • ๐Ÿ†• New documentation section for forks

    โšก๏ธ Other Updates

    • ๐Ÿ—„ Migration from deprecated react-router-redux to connected-react-router (@julienben)
    • Migration from react-loadable to loadable-components (@julienben)
    • ๐Ÿ‘ฏ Quick start - Clone to a named directory (@spawnia)
    • Scoped variables in i18n messages (@hatsuo)
    • ๐Ÿ‘• Use .prettierrc path relative to .eslintrc.js (@abeMedia)
    • ๐Ÿ›  Fixes to generators (@julienben, @hatsuo, @ngtan)
    • ๐Ÿ”Œ babel-plugin-lodash for easier import syntax (@julienben)
    • ๐Ÿ› Bug fix in setup script (@autechr3)

    ๐Ÿ“š Lots of additional documentation updates thanks to @doaboa, @cheickmec, @nicogreenarry, @sduquej, @diwakar-s-maurya.