build: explicit React 19 support#43
Merged
Merged
Conversation
Bump dev/build toolchain to React-19-aware versions and widen peer ranges to cover React 19. The package builds with plain tsc (no @wordpress/scripts), so the toolchain bump is @types/react@19, @types/react-dom@19, react/react-dom@19 devDeps, and typescript@5.9.3. Fix the one React-19 type fallout: useRef() with a type param and zero args is no longer permitted under @types/react@19; pass an explicit undefined initial value. Closes #42
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.
Closes #42.
Makes
@extrachill/chatexplicitly support React 19. The package builds with plaintsc(it does not use@wordpress/scripts, so there was no@wordpress/scriptsline to bump and no React-coupled@wordpress/*devDeps to align — the issue's assumption about that toolchain doesn't apply to this repo). Support is now declared in peer ranges and verified by building + typechecking against the real React 19 toolchain.Version bumps (before → after)
@types/react(devDep)^18.0.0^19.0.019.2.15@types/react-dom(devDep)^18.0.0^19.0.019.2.3react(devDep)^18.0.0^19.0.019.2.6react-dom(devDep)^18.0.0^19.0.019.2.6typescript(devDep)^5.7.0^5.9.35.9.3The dev
react/react-domwere bumped to^19(not just the@types) so the build actually verifies against React 19 runtime types, not just the type packages.Peer-range change
react>=18.0.0^18.0.0 || ^19.0.0react-dom>=18.0.0^18.0.0 || ^19.0.0The old
>=18.0.0loosely satisfied 19 but was unverified; the explicit^18 || ^19range states support intentionally while still allowing React 18 consumers.Type fallout fixed
Audited the whole
srctree (all hooks + the REST client insrc/api.ts) for the known React-19 type breakers —JSX.Elementannotations (none),React.FCimplicit children (none), legacyReactDOM.render(none), and zero-arguseRef(). One real break:src/components/TypingIndicator.tsx:31—useRef<ReturnType<typeof setTimeout>>()called with a type param and zero args. Under@types/react@19the no-argumentuseRefoverload was removed, producingerror TS2554: Expected 1 arguments, but got 0. Fixed by passing an explicit initial value:useRef<ReturnType<typeof setTimeout> | undefined>(undefined).No
@wordpress/*packages are imported by this library, so no ambientdeclare moduleshims were needed.Verification
npm installresolves the lockfile to@types/react@19.2.15(confirmed inpackage-lock.json).npm run build(tsc) → exit 0 ✅npx tsc --noEmit→ exit 0 ✅ (no dedicatedtypecheckscript exists; used thetsc --noEmitfallback)Out of scope (per repo rules)
CHANGELOG.mduntouched andversionstring not bumped — homeboy owns both.