deps: update extractErrors plugin to Babel 7 and more #878
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.
Description
This plugin was out-of-date by a good bit, so have updated a good bit to a more current version.
Commits
license: add FB License header to all extractErrors code
this plugin is largely borrowed from the React monorepo, consistently
add FB's License headers to each file, not just to extractErrors.ts
also add comments pointing to the exact file and commit that each
file was copied from
maintainble (it's also broken per the tests I've added)
separate package...
clean: bad whitespace and Flow types in extractErrors
with TS elsewhere
deps: update extractErrors Babel plugins to Babel 7
this was using Babel 6's Babylon and babel-traverse, which meant two
different versions of Babel were being used and a lot of unnecessary
deps were in the tree
(
@babel/helper-module-imports) while extractErrors was on Babel 6just for extra inconsistency 😬
as far as I can tell though 🤨
@babel/parserships its own typings now, so no need to use thedeclare moduleworkaround for it anymorethe type 😕
this also helps remove an old version of core-js v2, the addition of
which would give a deprecation warning on install:
EDIT: forgot to mention I also checked the Babel 7 migration guide which mentions
babel-traverse,babylon, and AST changes in general, which all seemed compatible to me (and React team must have checked it already too).deps: update extractErrors plugin's evalToString file
up-to-date
little too many changes for me to really prioritize right now
Tags
Follow-up to #138 I suppose
Some React PRs that updated this part of their monorepo:
@babel/parser: Use babel parser rather than Babylon in extract errors facebook/react#17988Literaladdition inevalToString: Use console directly instead of warning() modules facebook/react#17599TODO to be added to
transformErrorMessages... well I'd prefer asking FB/React to split out their code as a separate package than maintaining this though:In tandem with #795 which removed the unused
@babel/polyfilldep (and itscore-jsv2 dep), this should remove the last deprecation warning I know of that TSDXv0.13.3has from #789 (comment) by removing the lastcore-jsv2 usage: