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

use the new JSX transform #2102

Merged
merged 25 commits into from
Jun 14, 2024
Merged

use the new JSX transform #2102

merged 25 commits into from
Jun 14, 2024

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented Jun 12, 2024

Changes

Builds upon #2100.

I've made a simple change to the swc config to use the new "automatic" JSX runtime instead of "classic". This helps supports React 19, which requires the new JSX transform.

I also updated the tsconfig and eslint config to detect the new JSX runtime, and ran the official codemod on the src directory to fix all imports.

Testing

Manually verified that the build output in esm/cjs folders is using the new runtime.

Also made sure all tests are passing and there are no IDE errors.

Docs

Added changeset.

@mayank99 mayank99 self-assigned this Jun 12, 2024
@mayank99 mayank99 marked this pull request as ready for review June 12, 2024 20:12
@mayank99 mayank99 requested review from a team as code owners June 12, 2024 20:12
@mayank99 mayank99 requested review from r100-stack and Ben-Pusey-Bentley and removed request for a team June 12, 2024 20:12
@@ -2,7 +2,7 @@
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import React from 'react';
import { useState } from 'react';
Copy link
Member

@r100-stack r100-stack Jun 13, 2024

Choose a reason for hiding this comment

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

To confirm, do we want to continue using the default/deconstructed import in react-workshop (similar to #2102 (comment))?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we don't want to use the default import. Not sure where you're getting this idea.

Copy link
Member

@r100-stack r100-stack Jun 14, 2024

Choose a reason for hiding this comment

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

In #2102 (comment), the codemod changed the itwinui-react code to use deconstructed named imports but then you changed it to use namespace imports. So, I thought should we use default/namespace imports in react-workshop too?

Base automatically changed from mayank/swc-build to main June 14, 2024 14:29
@mayank99 mayank99 merged commit d09f35f into main Jun 14, 2024
16 checks passed
@mayank99 mayank99 deleted the mayank/jsx-runtime branch June 14, 2024 15:05
@imodeljs-admin imodeljs-admin mentioned this pull request Jun 14, 2024
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.

3 participants