This repository has been archived by the owner on Mar 20, 2022. It is now read-only.
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.
Summary
Transpilation of typescript code fails due to two issues stemming from
react-scripts
version3.4.1
.react-scripts=3.4.1
's babel config does not support nullish coalescing operator (??
).react-scripts=3.4.1
's babel config does not support export namespace from semantics (i.e.export * as embed from "./embed";
)Issue Description
react-scripts's nullish coalescing operator issue is well described and recounted in create-react-app #9468. The gist is, the currently configured
browserslist
key inpackage.json
fails because some browsers (<10%
) do not support the nullish coalescing operator. Seecaniuse
for the current breakdown. In short, the nullish coalescing operator (??
) is supported by > 90% of browsers. ~2.5% of ~10% unsupported browsers are old versions of Chrome and Safari on IOS. I don't see this being a huge issue, but it might be worth mentioning in documentation (if the changes are accepted). However, others may disagree. If that is the case, usingreact-scripts eject
is likely the only viable solution.create-react-app #9468's proposed solution is to change
package.json
'sbrowserlist
key from this,to this,
I've verified that this change removes the
transpilation error.
However, after changing the
browserlist
key, an error related to export namespace semantics is raised. See below:I tried bumping the
react-scripts
version to3.4.4
, but the error persisted. However, bumpingreact-scripts
to4.0.3
resolved the issue. Here are thecreate-react-app
v4.X
change logs. At a glance, I did not see anything referencing adding support for export namespace's, so I assume it is a product of a downstream babel plugin update.Recreate
git checkout a67ca746960ab13e40cc660a8b53d6fa792c0582
cd streamlit_bokeh_events/frontend/
rm package-lock.json
yarn
yarn start
Changes
longer supported. see
caniuse
to see if you are affected.
react-scripts
version bumped to4.0.3
.package-lock.json
removed and no longer tracked.