You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/10/22 03:02:32 UTC

[PR] chore(frontend): upgrade to TypeScript 7 [superset]

rusackas opened a new pull request, #45603:
URL: https://github.com/apache/superset/pull/45603

   ### SUMMARY
   TypeScript 7 (the native compiler) for `superset-frontend`. The embedded SDK and websocket packages already moved in #43702 and #43703; this does the main app. Measured locally on a clean install, same commands the lint-frontend "tsc" step and the pre-commit type check run:
   
   | phase | TypeScript 6.0.3 | TypeScript 7.0.2 |
   |---|---|---|
   | `npm run plugins:build` | 38 s | 27 s |
   | `npm run type` (full `tsc --noEmit`) | 31 s | 7 s |
   
   The CI step is dominated by those two plus the `npm i` inside the container, so I'd expect the 163-second "tsc" step on lint-frontend to roughly halve; the run on this PR is the real number and I'll note it here.
   
   TypeScript 7's package no longer ships the JavaScript compiler API (`require('typescript').createProgram` is undefined), which is what dependabot's #45297 ran into indirectly. Two things in the repo used that API:
   
   - The webpack dev server's `fork-ts-checker-webpack-plugin`, which is dropped along with the `DISABLE_TS_CHECKER` knob. docker-compose already defaulted that knob to `true`, so the compose dev flow doesn't change; for a bare `npm run dev`, type errors now come from `npm run type` (or `npm run type -- --watch`, fast on TS7) and package `.d.ts` output from `npm run plugins:build`. The webpack config comment and UPDATING.md say so.
   - Storybook's `reactDocgen: 'react-docgen-typescript'`, switched to `react-docgen`, Storybook's Babel-based default. Prop tables still come from the TypeScript source; Chromatic and the story tests on this PR are the check that nothing regressed.
   
   `typescript-json-schema` and `postcss-styled-syntax` also use the API but pin their own nested TypeScript, so they're unaffected. An npm `overrides` block to give the two consumers a nested TypeScript 6 didn't work for peer dependencies, and an aliased `typescript-6` package hijacks the `tsc` bin link, so removing the two consumers was the clean route.
   
   Two source fixes were needed. TypeScript 7 infers a union of promise types for a `.then` callback that returns different promises per branch, so `ComparisonRangeLabel`'s callback is now `async`. And declaration emit of `Object.assign(CustomModal, {...})` leaked the non-exported `CustomModal` into every story that references `Modal` (TS4082), so `Modal` gets an explicit type.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A
   
   ### TESTING INSTRUCTIONS
   `cd superset-frontend && npm ci && npm run plugins:build && npm run type` passes with 0 errors. `npm run build-storybook` and `npm run test-storybook` exercise the docgen change; CI's chromatic and test-storybook jobs run both.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [x] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(frontend): upgrade to TypeScript 7 [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45603:
URL: https://github.com/apache/superset/pull/45603#issuecomment-6332052707

   ## CodeAnt PR Risk: Low Risk
   
   - The PR appears safe to merge; no actionable issues were identified in the review.
   
   **Assessed commit:** `519825cdb31a`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(frontend): upgrade to TypeScript 7 [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #45603:
URL: https://github.com/apache/superset/pull/45603#issuecomment-6331927701

   CI numbers, from the `lint-frontend` job's "tsc" step on this PR against #45600's run of the same step a few minutes earlier (same slow-runner window, TypeScript 6):
   
   | phase inside the step | TypeScript 6 (#45600) | TypeScript 7 (this PR) |
   |---|---|---|
   | `npm i` inside the container | 5m04s | 5m04s |
   | babel (lib + esm) | 28 s | 28 s |
   | `tsc --build` across packages | 68 s | 30 s |
   | `tsc --noEmit` | 58 s | 18 s |
   | whole step | 459 s | 380 s |
   
   So the compiler itself is 2 to 3x faster, same as locally, but the step is dominated by something else: the `npm i` the step runs inside the CI image adds 104 packages and takes five minutes, and the `lint` step just above it does the same thing again. Looks like the image's `npm ci` runs with only the root `package.json` and lockfile mounted, so the workspace packages' dependencies never make it into the image and every `docker run` reinstalls them. That's a separate PR, and a much bigger win than this one for that job; noting it here so the 380 isn't read as the ceiling.
   
   Chromatic and `test-storybook` are green with the `react-docgen` switch, and the Storybook build step time is unchanged (125 s vs 108 to 130 s on master).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(frontend): upgrade to TypeScript 7 [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #45603:
URL: https://github.com/apache/superset/pull/45603#issuecomment-6331660733

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 519825cdb31a80d9163c6d097af389c0838b9ae0 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6ad97cc8a1e212446f9bb69f |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-45603--superset-docs-preview.netlify.app](https://deploy-preview-45603--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQ1NjAzLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.0mPXf3XcEPEsuLluyUSR1B4WuokC5De26wq30NC-wlk)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#q1YqKMrPLShRslJS0lFKKkrMS84AspMz8otS9UsqC1KLk4syC0p0zYGyKakFOfmVnilAebPEFEvz5GSLRMNUI0MjExOzNMukJDPLNKVaAA) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-45603--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(frontend): upgrade to TypeScript 7 [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #45603:
URL: https://github.com/apache/superset/pull/45603#issuecomment-6331879567

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45603?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 84.10%. Comparing base ([`4e5d0ef`](https://app.codecov.io/gh/apache/superset/commit/4e5d0ef8f13d1b878801851e1801f9672ef155e4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`519825c`](https://app.codecov.io/gh/apache/superset/commit/519825cdb31a80d9163c6d097af389c0838b9ae0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #45603      +/-   ##
   ==========================================
   - Coverage   84.10%   84.10%   -0.01%     
   ==========================================
     Files        3056     3056              
     Lines      201285   201287       +2     
     Branches    47066    47066              
   ==========================================
   - Hits       169299   169295       -4     
   - Misses      28747    28753       +6     
     Partials     3239     3239              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/45603/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/45603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.15% <100.00%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/45603?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(frontend): upgrade to TypeScript 7 [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber merged PR #45603:
URL: https://github.com/apache/superset/pull/45603


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org