Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
public/index.html
-><root>/index.html
script src=/src/index.tsx
to index.htmlpatch-package
to fixreact-virtualize
process.env
toimport.meta.env
querystringify
, replace with usage ofURLSearchParams
(as per TODO)GIT_COMMIT_HASH
andGIT_COMMIT_TIMESTAMP
globals instead of usingreact-git-info
packagereact-git-info
was implemented as a babel macro, so I migrated it to globals created usingvite-plugin-replace
, which are generated before build start by executing the required git commandsvite-plugin-pwa
(thanks to p-man)Did this improve anything?
Memory:
yarn build
yarn dev
Memory usage was measured using the
mem.js
script. Note that it will only run on Windows, because it uses thetasklist
utility.YMMV, V8 tends to use as much memory as it can based on a percentage heuristic of total system available memory, which means if you have less available memory, it will also use less, up to a point. I have 16 GB, and usage at the time was less than 25%. Overall though, this is a giant improvement, especially for development. Note that I tried to click around on the website as much as I could, to force Vite to load lazy chunks, and I barely saw any change to memory usage.
Speed
yarn build
yarn dev
Dev server start is measured by the time it took before the dev server was responsive (time to first byte). Vite reports is own times, but for
react-scripts
I had to modify it to get to report its startup time.First page load is measured as how long it took for the React app to start on a fresh page reload right after starting the dev server (to prevent caching). This was done by inserting the following snippet into the
App
component insrc/App.tsx
: