-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
build: clean generated type file #14582
Conversation
packages/vite/rollup.dts.config.ts
Outdated
case 'TransformResult$1': return 'esbuild_TransformResult' | ||
case 'TransformResult$2': return 'rollup.TransformResult' |
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 am a bit concerned that these two might suddenly be swapped in one day. For example, if rollup changes its chunking mechanism or renaming algorithm, or our code changes somehow changes the import order.
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.
Hmm true. I guess it would be safer if they aren't using namespaces at all, so the worst case is the confusing names.
Maybe I'll need to find another way to handle this, checking import-by-import perhaps then swapping it out 🤔
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.
Could this be tested somehow to detect if the order was changed so you can keep the current code?
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.
Running a typecheck after building the types could work, but we'd need a cover all the possible JS APIs. I'm currently working on a more strict approach that maybe helps with this.
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.
The last commit should be stricter now. Unfortunately it's a little more code.
Description
Following up from #14571
The generated types file is improved a little.
Plugin$1
are renamed to something better (previously happen in api-extractor too). The type names can sometimes show up in TypeScript messages which is confusing.Additional context
Also wonder if we should export the esbuild type, but I left it out for now.
What is the purpose of this pull request?