Repository navigation
Modernize tooling, require React 18 and fix cache boundary bugs - #6
Merged
Merged
Conversation
Replace microbundle-crl, CRA, yarn and Travis with tsdown (ESM + CJS with types through exports), a Vite example in a pnpm workspace, Vitest, Playwright, ESLint flat config and GitHub Actions. React 18 is now the minimum peer version. Fix bugs found in the audit: - generate-build-meta crashed because mkdirp was never a dependency, had no shebang, and exited 0 when it could not write the file - focus and every state update started a new polling interval without clearing the old one, and polling kept running while the window was blurred - clearCacheAndReload stored the old version, and a meta file without a version reloaded forever with auto - without auto, the new version was stored before the user reloaded, so a plain reload hid the update - an error thrown while loading was swallowed; errors are now rethrown to the parent boundary through getDerivedStateFromError - the meta file was always fetched from the site root; relative paths and URLs are now honoured, and an SPA fallback answering with HTML is detected - lazyRetry(fn, 0) retried forever and made one attempt fewer than asked - error checkers built from a /g regexp answered differently on each call - chunk errors from Vite, native import() in Chrome, Firefox and Safari, and webpack CSS chunks were not recognised BREAKING CHANGE: React >= 18 and Node.js >= 18.3 for the CLI are required, and lazyRetry's retries now counts extra attempts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Audit of the package: tooling brought up to date, React 18 made the minimum, the bugs below fixed, and an end-to-end suite added.
Tooling
exports, checked by publint.html-validatechecks the source and the builtindex.html.Bug fixes
generate-build-metacrashed (mkdirpwas never a dependency), had no shebang, and exited 0 on failure. It now uses only Node built-ins (no runtime dependencies left) and supersedes the mkdirp fix from Fix: fix mkdirp error #5.duration/autochanges.clearCacheAndReloadstored the old version, and a meta file withoutversionreloaded forever withauto.auto, the new version was stored before the user reloaded, so a plain reload hid the update.getDerivedStateFromError../,../, absolute paths and URLs are honoured, and an SPA fallback answeringmeta.jsonwith HTML is detected instead of parsed.lazyRetry(fn, 0)retried forever and made one attempt fewer than asked./gregexp answered differently on each call.import()in Chrome/Firefox/Safari (including Safari's'text/html' is not a valid JavaScript MIME typewhen the chunk URL returns HTML — found by the WebKit e2e run), webpack CSS chunks.debugcallback could leave the fallback up forever.Breaking changes
react >= 18peer; the CLI needs Node.js >= 18.3.lazyRetry(fn, retries)now makesretriesextra attempts (default: 3 attempts in total instead of 2).Test plan
pnpm test— lint + html-validate, build + publint, typecheck, 43 unit tests, 21 e2e tests (7 scenarios × 3 browsers)--destination, failure path exits 1