-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up Typescript in hybrid mode #800
Conversation
Bundle ReportChanges will decrease total bundle size by 8.08kB (-0.08%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: @open-formulieren/sdk-OpenForms-umdAssets Changed:
Files in
view changes for bundle: @open-formulieren/sdk-esmAssets Changed:
Files in
Files in
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #800 +/- ##
==========================================
+ Coverage 83.50% 84.15% +0.64%
==========================================
Files 233 233
Lines 4607 4631 +24
Branches 1187 1191 +4
==========================================
+ Hits 3847 3897 +50
+ Misses 730 704 -26
Partials 30 30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c1c7ec1
to
10e03a8
Compare
Bumped from TS 4.9 to 5.7. TS 5.8 released a couple of days ago and is not yet properly supported (via peerDependencies) in our other tooling, so we hold off on that for a while. @formatjs/cli is updated to match the peerDependency of typescript so that only a single version is installed in our dependencies.
The babel presets are no longer requires, since vite/esbuild takes care of that. The module resolution and formatjs plugins are still necessary since the tsconfig.json doesn't cover that. When imports are converted to use the @/ prefix, we can drop the module resolution plugin.
Now that we're switching to TS, we can fully rely on the Vite toolchain which no longer requires most of the babel plugins to deal with JSX and React.
Added some missing type definitions, but not everything is there yet.
We get some conflicts from leaflet libraries and some @storybook/test shenanigans, additionally there are some errors from react-use. It's not feasible to address these right now since we're aiming to get a foot in the door and get started with typing our own code. The offending files: Found 12 errors in 8 files. Errors Files 1 node_modules/@open-formulieren/leaflet-tools/lib/rd.d.ts:8 1 node_modules/@vitest/expect/dist/chai.d.cts:16 3 node_modules/react-leaflet-draw/src/index.d.ts:4 3 node_modules/react-leaflet/lib/LayersControl.d.ts:9 1 node_modules/react-leaflet/lib/SVGOverlay.d.ts:11 1 node_modules/react-use/lib/useEnsuredForwardedRef.d.ts:1 1 node_modules/react-use/lib/usePermission.d.ts:10 1 node_modules/vitest/node_modules/@vitest/expect/dist/chai.d.cts:16 Hopefully in the future we can re-enable this again.
Turns out we need the babel presets after all for the storybook processing :( I'm not sure why things work without in the renderer repo, but we'll figure it out at some point. This strongly types the Body component with its 'component' prop, allowing strings of intrinsic elements to be passed. Support for custom react components is dropped, as it doesn't appear to be used anywhere so this simplifies things a bit.
* Added a test id for testing-library to the map container so that the interaction tests only start running when the container is visible * Added robustness for interaction elements that may exist in the DOM but not be visible yet because map tiles are still loading waitFor has longer default timeouts than canvas.findBy* queries, and while the latter can be specified, the element is find before it's visible and there are still race conditions. For this reason, the visibility check is decoupled from the lookup expectation.
773d4d5
to
2cf3ec0
Compare
Partially closes #445
skipLibCheck
requires to be enabled :(