react-ts: make sure react-scripts works, use new jsx runtime #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the
react-ts
template with the following goals in mind:Use the new JSX runtime introduced in 2020, that doesn't require importing the
React
namespace. This coding style is used by the new React docs, bycreate-react-app@latest
, and more.Make sure that the project can be downloaded an ran locally with
npm install && npm start
. In my testing,react-scripts
:tsconfig.json
to be present to accept importing TypeScript files.package.json
to have abrowserslist
config. By default it will add a verbose one, so to keep things compact I went with"browserslist": ["defaults"]
.I also considered replacing
react-scripts
withvite
. That would be my preference, by Vite uses conventions like anindex.html
at the root (not in apublic
folder), copying thepublic
folder as-is, having theindex.html
request resources like styles and scripts, etc. All conventions which work well in WebContainer projects, but not in EngineBlock projects.