chore: remove api side polyfilling #7712
Draft
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.
Note: I need to figure out the dependency situation (
@babel/runtime
vs@babel/runtime-corejs3
, and where they should go), but I think this is the minimal set of config changes to remove polyfills for the api side. I'm happy to make more Babel changes because there's still a bit we can do to clean up our config, but one thing at a time.What this doesn't do:
It only affects
yarn rw build api
. So how a redwood app's api side is built. The change here is: we no longer polyfill anything.The reasoning: the api side targets a fairly predictable runtime, Node.js (and right now only two versions of it). We don't need to polyfill en-masse (and we were—we were polyfilling things that didn't need to be, like
Array.includes
,forEach
, etc.). Moreover, what we do polyfill that's not in the versions of Node we target is esoteric and 99% proposals (see the test here). Many of those proposals are in Stage 1, Stage 0, or worse, were rejected.