- `require()` calls no longer get wrapped in `_interopRequireDefault()`
- `Object.defineProperty()` (and thereforo core-js) is no longer used to
define a non-enumerable `__esModule` property (or even an enumerable
one, which is what `loose: true` would do).
Internal consumption of one module requiring another will still work,
and I don't expect any external consumers but myself, so I can make sure
all call sites work.
Although this blog post is briefer and covers a few things:
https://babeljs.io/blog/2019/03/19/7.4.0
In the end the build works if I get rid of
`@babel/plugin-transform-runtime`, which doesn't seem to play too well
in conjunction with `@babel/preset-env`, at least in this set-up.
Greg Hurrell [Sun, 31 Mar 2019 11:00:46 +0000 (13:00 +0200)]
Upgrade packages
`yarn upgrade-interactive` all the things.
Note that because the non-dev dependencies in the individual packages
are all locked to a specific version, I also ran `yarn outdated` to
identify those, and then:
(cd packages/workspace-scripts && yarn add @babel/parser@7.4.2 @babel/runtime-corejs2@7.4.2 @babel/traverse@7.4.0)
for X in babel-plugin-invariant-transform dedent delay delay event-emitter stable-stringify; do
(cd packages/$X && yarn add @babel/runtime-corejs2@7.4.2)
done
will evidently want to make a less manual way to do that via a script.
Includes tweaks in workspace-scripts/src/publish.ts to keep the new
version of TypeScript happy.
Greg Hurrell [Sun, 24 Feb 2019 09:30:13 +0000 (10:30 +0100)]
Migrate check-dependencies.js into workspace-scripts
Three things of note:
- Seems async generators don't work in Babel, so change the `walk`
implementation to not use them.
- Change to `bail` instead of using returning a boolean to `main()`.
- Got rid of "importKind" check because TypeScript doesn't have distinct
syntax for importing types and values; the only imports we'll find are
"value" imports.
Still some minor things to migrate from "scripts/".
Greg Hurrell [Sat, 23 Feb 2019 22:36:59 +0000 (23:36 +0100)]
Stop ESLint from complaining about "unused" TypeScript type imports
Fixes these spurious warnings:
```
js/packages/babel-plugin-invariant-transform/src/__tests__/index-test.ts
8:31 error 'Options' is defined but never used. Allowed unused vars must match /^_/ no-unused-vars
js/packages/babel-plugin-invariant-transform/src/index.ts
7:9 error 'Node' is defined but never used. Allowed unused vars must match /^_/ no-unused-vars
7:15 error 'NodePath' is defined but never used. Allowed unused vars must match /^_/ no-unused-vars
9:9 error 'types' is defined but never used. Allowed unused vars must match /^_/ no-unused-vars
9:16 error 'PluginObj' is defined but never used. Allowed unused vars must match /^_/ no-unused-vars
9:27 error 'Visitor' is defined but never used. Allowed unused vars must match /^_/ no-unused-vars
```
Greg Hurrell [Wed, 20 Feb 2019 22:31:16 +0000 (23:31 +0100)]
Make it possible to have override babel config files at package level
Although I am not sure I am going to use it, because I am wary of having
config copied into multiple locations. I may be able to get pretty far
with the "overrides" section in the top-level file alone.
Greg Hurrell [Tue, 19 Feb 2019 23:27:49 +0000 (00:27 +0100)]
Use @wincent/babel-plugin-invariant-transform internal
There may be a bit of a chicken-and-egg thing going on here internally,
but it basically seems to work. I may need to exclude that plugin for
the config for the invariant transform package itself though.
Greg Hurrell [Sun, 17 Feb 2019 23:55:01 +0000 (00:55 +0100)]
Add invariant transform
Not using it yet though because we have a bit of a chicken and egg
problem. I can't add it to the default list of plug-ins because it might
not be built yet. Originally it was in vanilla JS but I ported it to
TypeScript. But I think if I can't come up with a way to bootstrap it in
the Makefile before the other transforms run then I'll just change it
back and do it the real dumb way.
Greg Hurrell [Sun, 17 Feb 2019 10:50:48 +0000 (11:50 +0100)]
Make all packages delegate to workspace-scripts
Except workspace-scripts itself, of course, which just runs its own
"bin/index.js".
Note there is a chicken-and-egg thing here, which is that until you
"build" none of this will probably work, and that's why I may end up
keeping the build as a Makefile step at the top level rather than
pulling it in to workspace-scripts (although I might end up using nested
Makefiles so that you can build an individual package if you want).