-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: reduce handling of typescript in this plugin #24
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
base: main
Are you sure you want to change the base?
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.
Pull Request Overview
This PR refactors the rollup plugin to use esbuild for TypeScript/JSX transformations instead of the previous rollup + @rollup/plugin-typescript + babel approach. The changes streamline the build process by leveraging esbuild's faster performance and built-in JSX/TypeScript support.
Key changes:
- Replaced rollup-based TypeScript compilation with esbuild's
transformandbuildAPIs - Removed deprecated tsconfig options from the default configuration
- Simplified the playground's rollup configuration to remove babel and node-resolve plugins
- Marked tsconfig options as deprecated in type definitions
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| rollup.js | Replaced rollup + TypeScript + babel pipeline with esbuild transform/build calls for both source transformation and client bundle generation |
| playground/rollup.config.js | Removed babel and node-resolve plugins, simplified TypeScript configuration to preserve JSX |
| lib/types.d.ts | Marked tsconfig options as deprecated with JSDoc comments |
| .github/workflows/test.yml | Renamed workflow job from "format" to "test" |
Comments suppressed due to low confidence (5)
rollup.js:7
- The
nodeResolveimport is no longer used after switching to esbuild for bundling. This import should be removed.
const { nodeResolve } = require('@rollup/plugin-node-resolve')
rollup.js:8
- The
jsximport is no longer used after removing the rollup-based TypeScript compilation. This import should be removed.
const jsx = require('acorn-jsx')
rollup.js:9
- The
babelimport is no longer used after replacing babel with esbuild for JSX transformation. This import should be removed.
const { babel } = require('@rollup/plugin-babel')
rollup.js:10
- The
resolveTsConfigimport is no longer used after removing tsconfig-based compilation. This import should be removed.
const { resolveTsConfig } = require('./lib/typescript')
rollup.js:106
- The
autoLoadTypescriptPlugfunction is no longer used after removing the TypeScript plugin. This entire function should be removed.
function autoLoadTypescriptPlug() {
try {
const plug = require('@rollup/plugin-typescript')
if (plug) {
return plug.default
}
} catch (err) {
return () => ({
name: 'typescript',
})
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
in cases like `bun` the `.transform` doesn't exist on the `builder` sub method
The initial reason for adding a typescript plugin internally was to allow users to provide a tsconfig for the server and one for the client since the client build is handled by the plugin.
Over different typescript configurations I realised that a lot of configurations end up causing the client build to be invalid because of the config being server focused and the expectation that the plugin would just handle it for the client which wasn't the intention of the
tsconfigfields and also wasn't documented (so mostly my fault)The other part is that the client build in most cases would end up needing the same kind of configuration so it's easier to just have it use the same config for each client build and so this PR removes the dependency on
rollup/plugin-typescriptand usesesbuildto handle normalisation of the AST and the also the client side builds.