-
Notifications
You must be signed in to change notification settings - Fork 15.7k
feat(build): auto-rebuild/check TypeScript types for packages/plugins in webpack #35240
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Excessive memory allocation for TypeScript checking ▹ view | 🧠 Not in scope | |
Duplicate Type Definitions ▹ view | 🧠 Not in scope | |
Inefficient polling-based file watching ▹ view | 🧠 Incorrect |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/explore/components/controls/MetricControl/savedMetricType.ts | ✅ |
superset-frontend/webpack.config.js | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
export type { savedMetricType } from './types'; | ||
|
||
// PropTypes definition for JavaScript files | ||
const savedMetricTypePropTypes = PropTypes.shape({ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
// Watch all plugin and package source directories | ||
ignored: ['**/node_modules', '**/.git', '**/lib', '**/esm', '**/dist'], | ||
// Poll less frequently to reduce file handles | ||
poll: 2000, |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
superset-frontend/webpack.config.js
Outdated
plugins.push( | ||
new ForkTsCheckerWebpackPlugin({ | ||
typescript: { | ||
memoryLimit: 8192, |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
…bpack After PR #35159 changes, developers had to manually run `npm run plugins:build` whenever types changed in packages or plugins. This adds automatic type checking and .d.ts generation to the webpack dev process using ForkTsCheckerWebpackPlugin. Key improvements: - Automatic type rebuilding when packages/plugins change - Inline type error reporting in webpack console - Incremental compilation for better performance - skipLibCheck optimization for faster type checking - Can be disabled with DISABLE_TYPE_CHECK=true npm run dev - Fixes PropTypes compatibility for JavaScript files This eliminates the need for manual type rebuilding and makes the development experience smoother while maintaining type safety. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
modules: [ | ||
'node_modules', | ||
APP_DIR, | ||
path.resolve(APP_DIR, 'packages'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these two lines here are the key, meaning now it watches plugins/packages and rebuilds.
744b36b
to
45a8e8e
Compare
superset-frontend/webpack.config.js
Outdated
plugins.push( | ||
new ForkTsCheckerWebpackPlugin({ | ||
typescript: { | ||
memoryLimit: 8192, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need this much memory? The default seems to be 2048. This a pretty big jump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, other places in the file we use 4096, maybe i'll stick to that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factored out a constant and using/reusing it places.
Set consistent memory limit for ForkTsCheckerWebpackPlugin across development and production builds using a TYPESCRIPT_MEMORY_LIMIT constant. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Everyone cool with the default of running type-checked in |
After PR #35159 changes, developers had to manually run
npm run plugins:build
whenever types changed in packages or plugins. This adds automatic type checking and .d.ts generation to the webpack dev process using ForkTsCheckerWebpackPlugin.Key improvements:
This eliminates the need for manual type rebuilding and makes the development experience smoother while maintaining type safety.