Upgrade 0.22 to 0.23
Change startupjs and all @startupjs/* dependencies in your package.json to ^0.23.
BREAKING CHANGES
-
Update babel, metro and webpack config files:
-
Change their extensions to
.cjs:babel.config.js->babel.config.cjsmetro.config.js->metro.config.cjswebpack.server.config.js->webpack.server.config.cjswebpack.web.config.js->webpack.web.config.cjs
-
change the
requireof bundler inside all of them to have an explicit.cjsextension:require('startupjs/bundler')->require('startupjs/bundler.cjs')
-
add
.cjsextension to the'startupjs/babel'preset inbabel.config.cjs:'startupjs/babel'->'startupjs/babel.cjs'
-
-
Update startupjs config file:
-
Change its extension to
.cjs:startupjs.config.js->startupjs.config.cjs
-
Update it's
requireof config to a new CJS file:require('@startupjs/ui/config')->require('@startupjs/ui/config-cjs/index.cjs')
-
-
Add
vite.config.cjsfile to your project root with the following content: -
Update server:
-
Change
server.jsto: -
Add the following to the end of
server/index.js:
-
-
Update
package.json.-
Add after
"name": -
Change
postinstallscript to: -
Change
buildscript to:Note that this will start building production bundle splitting all your components into separate chunks. You have to have
http2enabled on your load-balancer and cache all your.jsfiles to have this working correctly. -
Put
/* @asyncImports */comment to the top of yourmain/pages/index.jsand to all other frontend-microservices*/pages/index.jsif you have any (likeadmin/pages/index.js, etc.)This will transform imports in this files to be asynchronous for production. Which will greatly improve the initial loading speed.
-
Remove
postinstall-postinstallandpatch-packagefrom yourdevDependencies -
Fix
react-native-webversion in dependencies to0.12.3:
-
-
Delete
patchesfolder completely. -
Delete the file
clientHelpers/BASE_URL.web.jsif it exists. -
If you have
react-native.config.jsfile, change its extension to.cjs:react-native.config.js->react-native.config.cjs
-
Change hot-reloading library on web to Fast Refresh. This simplifies the hot reloading setup and gets rid of the extra end-user dependency
@hot-loader/react-dom. End-users must update their projects to remove the@hot-loader/react-domfrom theirpackage.jsonand from theRoot/index.web.jsfile.