Skip to content
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

fix: when code has declare @jsx createElement comment, swc config runtime: 'classic' #5976

Merged
merged 5 commits into from
Feb 27, 2023

Conversation

MrpandaLiu
Copy link
Collaborator

fix: when code has declare @jsx createElement comment, swc config runtime: 'classic'

@ClarkXia ClarkXia changed the base branch from master to release/next February 27, 2023 04:03
@answershuto answershuto added the need review Need Review label Feb 27, 2023
@@ -69,7 +69,18 @@ const plugin: Plugin<CompatRaxOptions> = (options = {}) => ({
config.swcOptions = merge(config.swcOptions || {}, {
compilationConfig: (source: string) => {
const isRaxComponent = /from\s['"]rax['"]/.test(source);
Copy link
Collaborator

Choose a reason for hiding this comment

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

package 里面 version 加一下,changelog 补充

Copy link
Collaborator

Choose a reason for hiding this comment

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

用 changeset 流程:

  1. 不需要修改版本号
  2. 项目根路径下执行 pnpm run changeset, 根据 cli 提示操作
  3. 提交所有文件

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

push了

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

用 changeset 流程:

  1. 不需要修改版本号
  2. 项目根路径下执行 pnpm run changeset, 根据 cli 提示操作
  3. 提交所有文件

这个好像还没有补充到 CONTRIBUTING.md 中

@ClarkXia ClarkXia removed their request for review February 27, 2023 04:55
},
},
};
} else if (isRaxComponent) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

hasJSXComment 的逻辑放在 isRaxComponent 吧,这个逻辑只在 rax 下生效。

@@ -1,5 +1,9 @@
# Changelog

## 0.1.4
Copy link
Collaborator

Choose a reason for hiding this comment

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

按照卓凌提的来就好了,这个不需要手动提交了

answershuto
answershuto previously approved these changes Feb 27, 2023
@@ -69,7 +69,19 @@ const plugin: Plugin<CompatRaxOptions> = (options = {}) => ({
config.swcOptions = merge(config.swcOptions || {}, {
compilationConfig: (source: string) => {
const isRaxComponent = /from\s['"]rax['"]/.test(source);
const hasJSXComment = source.indexOf('@jsx createElement') !== -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个检测可以卸载判断条件内部,提升效率

@answershuto answershuto merged commit efba0cc into alibaba:release/next Feb 27, 2023
@ClarkXia ClarkXia mentioned this pull request Feb 28, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need review Need Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants