feat: upgrade to TypeScript 6.0.3, ES2022 target, and shared ts-config presets#3663
Open
oliverlaz wants to merge 1 commit into
Open
feat: upgrade to TypeScript 6.0.3, ES2022 target, and shared ts-config presets#3663oliverlaz wants to merge 1 commit into
oliverlaz wants to merge 1 commit into
Conversation
…ig presets Upgrade every workspace to TypeScript 6.0.3 with ES2022 as the compilation target, and remove tsconfig duplication via a shared preset package. - Add private @stream-io/typescript-config workspace exposing base.json (ES2022 + strict) and library.json (RN library config). Core, the native and expo wrappers, and all three example apps extend these instead of duplicating compiler options. - target is ES2022 everywhere; lib is kept at ESNext because the SDK uses the ES2023 Array.prototype.toReversed(). @types/jest is referenced explicitly since TS 6.0 no longer auto-includes it from node_modules/@types. - Fix the core package's published types path: react-native-builder-bob emitted declarations under lib/typescript/src while the `types` field pointed at lib/typescript/index.d.ts. Adding rootDir "./src" makes them emit flat, which also restores type resolution for the wrappers and example apps. - Export PickImageOptions from the core entrypoint (consumed by the wrappers). - Add a typecheck to native-package and expo-package and fix latent type errors in their optional-dependency shims (missing returns, video shim props). - Fix pre-existing type errors across the example apps surfaced by enabling their typecheck (theme palette typing, null-safety, SDK API drift). - CI now typechecks the whole workspace (core + wrappers + examples) instead of only the core package.
Contributor
SDK Size
|
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.
What & why
Upgrades every workspace to TypeScript 6.0.3 with
target: ES2022, and removes tsconfig duplication via a new shared preset package. Enabling type-checking across the previously-unchecked packages also surfaced (and this PR fixes) a pre-existing bug in the core package's published type resolution plus a batch of latent type errors.Changes
Shared config
@stream-io/typescript-configworkspace (configs/typescript-config/):base.json— cross-cutting policy (ES2022 target, strict, interop, …)library.json— full React Native library config (extendsbase)["<framework base>", "@stream-io/typescript-config/base.json"].TypeScript 6.0.3 / ES2022
6.0.3in all 7 manifests;target: ES2022everywhere.libkept atESNext— the SDK uses the ES2023Array.prototype.toReversed().@types/jest, so it's referenced explicitly from a test-onlypackage/src/__tests__/jest-globals.d.ts(excluded from the published build).Core publishing fix (consumer-facing)
react-native-builder-bobemitted declarations underlib/typescript/src/whilepackage.json#typespointed atlib/typescript/index.d.ts— so TS consumers couldn't resolve the SDK's types viatypes. AddedrootDir: "./src"so declarations emit flat to matchtypes. This was also the root cause that blocked the wrappers/examples from resolving core's types.PickImageOptionsfrom the core entrypoint (defined+exported innative.tsbut never surfaced fromindex).Wrappers (
stream-chat-react-native,stream-chat-expo)typecheckscript + tsconfig (they had neither). The dynamic optional-requireshims relaxnoImplicitAny/strictNullChecks/unused checks (keptnoImplicitReturns).returns inshareImage, missingresizeMode/rateon the video shim, an inconsistentstartRecordingreturn shape.Example apps
colorspalette, read via a localAppThemecast — behavior-preserving), null-safety guards, and several SDK-API-drift fixes.CI
check-pr.ymlnow runsyarn typecheckacross the whole workspace (core + 2 wrappers + 3 examples) instead of only the core package; the roottypecheckaggregate includes the wrappers.Verification
yarn build✅yarn typecheck(core + 2 wrappers + 3 examples) ✅ 0 errorsyarn lint✅Notes for reviewers
chore:(release-neutral). The core changes (flattypespath +PickImageOptionsexport) are genuinely consumer-facing — if you want them shipped, retype asfix:to cut a patch.strictNullChecks/noImplicitAnyare relaxed only for the two wrapper packages (dynamic optional-dep shims), not for core.colorspalette was already inert for SDK theming (the SDK reads semantics/primitives, nottheme.colors); this PR preserves that behavior. Migrating the palette to the token model to restore custom branding would be a separate enhancement.PickImageOptionsexport); CI runstest:coverage.