Skip to content

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Dec 9, 2023

react-jsx makes the most sense as a default.

Preview

@jakebailey
Copy link
Member

TODO: PR changing default in TypeScript actual.

The default in TS is undefined, so I'm not sure there's an actual code change needed there besides potentially changing a diagnostic to suggestion one choice over another.

(Additionally, other runtimes than React I believe still use that setting so I doubt it's going to be deprecated in TS)

@jakebailey
Copy link
Member

Are the discussions for this somewhere that can be linked?

@eps1lon eps1lon changed the title Document new compilerOptions.jsx default Update compilerOptions.jsx to reflect latest preferences Dec 12, 2023
@eps1lon
Copy link
Contributor Author

eps1lon commented Dec 12, 2023

The default in TS is undefined, so I'm not sure there's an actual code change needed there besides potentially changing a diagnostic to suggestion one choice over another.

Yeah, I tried it on a fresh project and you need to specify a value. You can't just run tsc --jsx. So all we need to do is document that there is no default and then we discuss in the React team whether people should prefer react-jsx or react-jsxdev if they have a single tsconfig.json.

export const HelloWorld = () => <h1>Hello world</h1>;
```

React 17 dev transform: `"react-jsxdev"`<sup>[[1]](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)</sup>

Legacy runtime: `"react"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sure this is language we want to use.

@eps1lon eps1lon marked this pull request as ready for review December 26, 2023 10:04
@jakebailey jakebailey closed this Jun 5, 2024
@jakebailey jakebailey reopened this Jun 5, 2024
@jakebailey jakebailey assigned jakebailey and unassigned jakebailey Jun 5, 2024
@jakebailey jakebailey added the deploy-preview Enables automatic deployments to preview environments on a PR label Jun 5, 2024
@jakebailey
Copy link
Member

I think #3064 composes with this?

@eps1lon
Copy link
Contributor Author

eps1lon commented Jun 6, 2024

This one is more focused and can land separately though, no?

@jakebailey
Copy link
Member

Close-reopening to verify CI after changes in the repo.

@jakebailey jakebailey closed this Jul 8, 2024
@jakebailey jakebailey reopened this Jul 8, 2024
Copy link
Contributor

github-actions bot commented Jul 8, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-2994.centralus.5.azurestaticapps.net

@jakebailey jakebailey merged commit 8417ff5 into microsoft:v2 Jul 8, 2024
@eps1lon eps1lon deleted the jsx-default branch July 8, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-preview Enables automatic deployments to preview environments on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants