这是indexloc提供的服务,不要输入任何密码
Skip to content

feat(ecmascript): support configurable emotion options #4458

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

Merged
merged 2 commits into from
Apr 5, 2023

Conversation

kwonoj
Copy link
Contributor

@kwonoj kwonoj commented Apr 4, 2023

Description

Related with WEB-669.

PR implements initial path to configuring emotion transforms. It doesn't fully implement all of the options values though -auto-label have different values between next.config.js to the swc's actual transform options, as well as importMap. These will be gradually follow up since it is not an immediate blocker for the feature itself.

@kwonoj kwonoj requested a review from a team as a code owner April 4, 2023 18:35
@vercel
Copy link

vercel bot commented Apr 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-svelte-web 🔄 Building (Inspect) Apr 5, 2023 4:34pm
10 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-cra-web ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-gatsby-web ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-native-web ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-nonmonorepo ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-tailwind-web ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
examples-vite-web ⬜️ Ignored (Inspect) Apr 5, 2023 4:34pm
turbo-site ⬜️ Ignored (Inspect) Visit Preview Apr 5, 2023 4:34pm

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

🟢 CI successful 🟢

Thanks

@kwonoj kwonoj force-pushed the feat-emotion-options branch 3 times, most recently from 66190bc to 814cfea Compare April 4, 2023 19:56
@kwonoj kwonoj marked this pull request as draft April 4, 2023 22:27
@kwonoj kwonoj force-pushed the feat-emotion-options branch 4 times, most recently from f9e1571 to fd14bd5 Compare April 4, 2023 23:15
@kwonoj kwonoj marked this pull request as ready for review April 4, 2023 23:16
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

✅ This changes can build next-swc

@kwonoj kwonoj force-pushed the feat-emotion-options branch from fd14bd5 to 1f88f0e Compare April 5, 2023 00:25
Emotion,
Emotion {
#[serde(default)]
sourcemap: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just always enable the sourcemap?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now, this inherits what next.config.js allow to configure. I hope to simplify / consolidate but thinking about feature parity to existing next.js configs we may need to expose.

#[turbo_tasks::value(shared)]
#[derive(Default, Clone, Debug)]
pub struct EmotionTransformOptions {
pub enabled: bool,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need an enabled if the enable_emotion if this is only used inside an Option wrapper? Shouldn't the Some(EmotionTransformOptions) imply that it is enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how I started, and then ends up this was somewhat more ergonomics when try to read next.config.js, we have couple of conditions

  1. if compiler option non-exists - None
  2. if exists, somehow user configures emotion: false or emotion: {enabled :false}

and having Option was easier to gracefully read & create config value among those conditions. It is possible to argue who would do 2 (if you specifiy compiler option, explicitly disabling it is non common) but that's certainly possible case if someone relies on some dynamic evaluation based on env / fn.

@kwonoj kwonoj force-pushed the feat-emotion-options branch from 1f88f0e to 3ce7565 Compare April 5, 2023 15:56
@kwonoj kwonoj added the pr: automerge Kodiak will merge these automatically after checks pass label Apr 5, 2023
@kodiakhq kodiakhq bot merged commit a3bc78c into main Apr 5, 2023
@kodiakhq kodiakhq bot deleted the feat-emotion-options branch April 5, 2023 17:03
NicholasLYang pushed a commit to NicholasLYang/turbo that referenced this pull request Apr 5, 2023
### Description

Related with WEB-669.

PR implements initial path to configuring emotion transforms. It doesn't
fully implement all of the options values though -`auto-label` have
different values between next.config.js to the swc's actual transform
options, as well as `importMap`. These will be gradually follow up since
it is not an immediate blocker for the feature itself.
sokra added a commit that referenced this pull request Apr 5, 2023
kwonoj added a commit that referenced this pull request Apr 5, 2023
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…epo#4458)

### Description

Related with WEB-669.

PR implements initial path to configuring emotion transforms. It doesn't
fully implement all of the options values though -`auto-label` have
different values between next.config.js to the swc's actual transform
options, as well as `importMap`. These will be gradually follow up since
it is not an immediate blocker for the feature itself.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…epo#4458)

### Description

Related with WEB-669.

PR implements initial path to configuring emotion transforms. It doesn't
fully implement all of the options values though -`auto-label` have
different values between next.config.js to the swc's actual transform
options, as well as `importMap`. These will be gradually follow up since
it is not an immediate blocker for the feature itself.
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…epo#4458)

### Description

Related with WEB-669.

PR implements initial path to configuring emotion transforms. It doesn't
fully implement all of the options values though -`auto-label` have
different values between next.config.js to the swc's actual transform
options, as well as `importMap`. These will be gradually follow up since
it is not an immediate blocker for the feature itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants