web-infra-dev / web-infra-dev/rslib

[Feature]: jsx runtime should be synced between tsconfig and swc

Open
#304 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

💡 feature
Dominant language
TypeScript
Stars
1k
Forks
67
Avg merge
6h 9m
Merged PRs (30d)
57

Description

What problem does this feature solve?

See https://github.com/web-infra-dev/rslib/blob/f9f1751a304051947ea27d47146d072b9c448da1/examples/react-component-bundle/rslib.config.ts#L39

When tsconfigjson.jsx is set to react. We need to set swc react runtime to classic explicitly. It's pretty error-prone and trivial.

What does the proposed API look like?
  1. Automatically read from tsconfig: @rsbuild/pluigin-react's config automatically follows tsconfig.
  2. Or, only check're the configuration are matched and emit a warning when conflict.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked examples/react-component-bundle/rslib.config.ts reference and trace how tsconfig.json's jsx setting reaches the SWC React runtime configuration. Determine whether the project should automatically synchronize the settings or only warn on conflicts; the issue is done when the chosen behavior is implemented and covered by relevant configuration tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.