Update to Typescript 6 / Jest 29#202
Conversation
cb10210 to
ad66113
Compare
ad66113 to
7a463ca
Compare
|
What do you mean by "adding stratakit components"? |
| @@ -52,7 +52,8 @@ | |||
| "eslint-plugin-react": "^7.20.3", | |||
| "eslint-plugin-simple-import-sort": "^5.0.3", | |||
| "eslint": "^8.3.0", | |||
There was a problem hiding this comment.
Going point, updated eslint peer deps.
Many of the peerDep warnings were from storybook - they were pre-existing but I added TS to the storybook package to remove most of the warnings.
require-from-string peerDep warning is an issue in Storybook
All the other peerDep warnings are Storybook-related and (I think) should be resolved by updating Storybook per #108
| const extent = { | ||
| northEast: { ...prevState.extent?.northEast } ?? {}, | ||
| southWest: { ...prevState.extent?.southWest } ?? {}, | ||
| northEast: { ...prevState.extent?.northEast }, |
There was a problem hiding this comment.
any reason this was removed?
This changes interface from extent: { northEast: {}, southWest: {}}to extent: {northEast: undefined, southWest: undefined}. Have you checked if API accepts it correclty?
There was a problem hiding this comment.
Spreading null/undefined results in an object.
❯ node
Welcome to Node.js v22.15.1.
Type ".help" for more information.
> { ...undefined }
{}
> { ...null }
{}
TSC 6 has better typechecking and says Right operand of ?? is unreachable because the left operand is never nullish.
The actual code will be semantically identical.
| { | ||
| "packageName": "@itwin/create-imodel-react", | ||
| "comment": "Update to Typescript 6 / Jest 29", | ||
| "type": "minor" |
There was a problem hiding this comment.
What are the changes after ts update for consumers of these packages? Technically, its devDep change, shouldnt impact at all (then none), but with ts could be nuances..
There was a problem hiding this comment.
I've been running diffs and the generated types output is unchanged other than removing /// <reference types="react" />
❯ diff --ignore-all-space -u create-imodel-main-cjs-index.d.ts create-imodel-ts6-cjs-index.d.ts
❯ diff --ignore-all-space -u create-imodel-main-cjs-types.d.ts create-imodel-ts6-cjs-types.d.ts
❯ diff --ignore-all-space -u create-imodel-main-esm-index.d.ts create-imodel-ts6-esm-index.d.ts
❯ diff --ignore-all-space -u create-imodel-main-esm-types.d.ts create-imodel-ts6-esm-types.d.ts
❯ diff --ignore-all-space -u imodel-browser-main-cjs-index.d.ts imodel-browser-ts6-cjs-index.d.ts
❯ diff --ignore-all-space -u imodel-browser-main-cjs-types.d.ts imodel-browser-ts6-cjs-types.d.ts
--- imodel-browser-main-cjs-types.d.ts 2026-05-19 07:28:05
+++ imodel-browser-ts6-cjs-types.d.ts 2026-05-19 07:30:01
@@ -1,4 +1,3 @@
-/// <reference types="react" />
import { CellProps } from "react-table";
/** Full representation of the iModel. */
export interface IModelFull {
❯ diff --ignore-all-space -u imodel-browser-main-esm-index.d.ts imodel-browser-ts6-esm-index.d.ts
❯ diff --ignore-all-space -u imodel-browser-main-esm-types.d.ts imodel-browser-ts6-esm-types.d.ts
--- imodel-browser-main-esm-types.d.ts 2026-05-19 07:28:05
+++ imodel-browser-ts6-esm-types.d.ts 2026-05-19 07:30:01
@@ -1,4 +1,3 @@
-/// <reference types="react" />
import { CellProps } from "react-table";
/** Full representation of the iModel. */
export interface IModelFull {
There was a problem hiding this comment.
I've set to empty comments and none - let me know if this aligns with how change files work in this repo.
The plan is to add MUI components in parallel to existing iTwinUI components. So consumers will be able to import something like |
2699924 to
ead8657
Compare

Prep for adding Stratakit components and general modernization.
Stratakit's optional
renderprop was being seen asrequiredin TS 4, which is what prompted me to start this update.tsconfig.base.jsonto simplify configjest.config.js- this lets us removetypes: [node, jest]from the browser-targeting tsconfig filesmoduleResolution: "bundler"since the previousnodeoption is deprecatedmoduleResolution: "bundler"reactDogenfor now (this shows TS types on Storybook) - it is not compatible with TS 6 but can be re-enabled when we update Storybook in Upgrade to Storybook 7 #108 - Storybook still shows props, just not with the full TS typingsThis PR is based on #203 so CI isn't running automatically. Here are the manual runs... https://github.com/iTwin/admin-components-react/actions?query=branch%3Aalex%2Ftypescript6