Skip to content

Conversation

@barelyhuman
Copy link
Owner

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 tsconfig fields 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-typescript and uses esbuild to handle normalisation of the AST and the also the client side builds.

@barelyhuman barelyhuman requested a review from Copilot November 2, 2025 06:19
Copy link

Copilot AI left a 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 transform and build APIs
  • 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 nodeResolve import 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 jsx import 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 babel import 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 resolveTsConfig import is no longer used after removing tsconfig-based compilation. This import should be removed.
const { resolveTsConfig } = require('./lib/typescript')

rollup.js:106

  • The autoLoadTypescriptPlug function 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.

barelyhuman and others added 4 commits November 2, 2025 16:04
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants