Issue 1:
Feature Request

In contexts where Babel is running alongside a filesystem watcher, there are cases where a plugin may load an arbitrary file. Take a plugin like https://www.npmjs.com/package/babel-plugin-inline-import for example. Or some usecases of babel-plugin-macros.

It would be ideal if Babel had a way for plugins to indicate that these dependencies exist, so that if callers of Babel wanted to take that into account, they could. For example, Webpack has .addDependency, so that changes to that file will cause the loader to re-execute when the dependency is changed. We could easily use this API in babel-loader to handle this. Implementing a similar API in @babel/cli's watcher wouldn't be too bad either.

I don't know how other Babel wrappers would fair, but if someone wanted to help investigate that, it would certainly help. Off the top off my head we'd want to check, at the very least, if the following have ways to register additional files to watch:

Meteor

Jest

Browserify

Gulp

Edit

We may also want to include in this work logic to help us take dependency file content into account for the purposes of cache invalidation. For example, babel-loader's cacheDirectory option will not invalidate caches, if say a .browserlistrc file changes preset-env's plugin list: babel/babel-loader#690

Issue 2:
This is a bug report

Input Code

The following code produces an error:

export class Test {
static staticProp = {};
constructor(props) {
console.log(props);
}
log = (props) => {
console.log(props.msg);
};
}

Babel/Babylon Configuration (.babelrc, package.json, cli command)

{
"presets": [
["@babel/stage-1", { "decoratorsLegacy": true }]
]
}

Expected Behavior

Babel should successfully compile the code. Works with babel 6 in the REPL: https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=usage&code_lz=KYDwDg9gTgLgBAYwDYEMDOa4BVhvgbwCg448UYBLBUmcqgBSgjDgF458BfAbmMQgB2eKAFcEMaAAowTMGgCUHPiQSC0EJMAB0SCAHNpshbxKc-uvWziHmCtgD4lJFWo3aLNuVoC2aPfJM4HkJOIA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&lineWrap=false&presets=stage-1&prettier=false&targets=&version=6.26.0&envVersion=1.6.2

Current Behavior

Babel fails to compile with the following error:

Error: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?
at NodePath.insertAfter (/path/to/project/node_modules/@babel/traverse/lib/path/modification.js:154:11)
at PluginPass.Class (/path/to/project/node_modules/@babel/plugin-proposal-class-properties/lib/index.js:267:14)
at newFn (/path/to/project/node_modules/@babel/traverse/lib/visitors.js:243:21)
at NodePath._call (/path/to/project/node_modules/@babel/traverse/lib/path/context.js:65:18)
at NodePath.call (/path/to/project/node_modules/@babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/path/to/project/node_modules/@babel/traverse/lib/path/context.js:100:12)
at TraversalContext.visitQueue (/path/to/project/node_modules/@babel/traverse/lib/context.js:144:16)
at TraversalContext.visitSingle (/path/to/project/node_modules/@babel/traverse/lib/context.js:104:19)
at TraversalContext.visit (/path/to/project/node_modules/@babel/traverse/lib/context.js:185:19)
at Function.traverse.node (/path/to/project/node_modules/@babel/traverse/lib/index.js:106:17)

Possible Solution

Not sure, but it's interesting that either of the following adjustments can be used to work around the issue:

// Use different identifiers for constructor arg and `log` arg
export class Test {
static staticProp = {};
constructor(props) {
console.log(props);
}
- log = (props) => {
+ log = (p) => {
- console.log(props.msg);
+ console.log(p.msg);
};
}

// Export the class separate from its declaration
-export class Test {
+class Test {
static staticProp = {};
constructor(props) {
console.log(props);
}
log = (props) => {
console.log(props.msg);
};
}
+
+export { Test };

Context

Trying to use what I think is compliant with the current proposals, but have to follow one of the provided workarounds instead.

Your Environment

software
version(s)

Babel
7.0.0-beta.46

Babylon

node
8.6.0

npm
yarn 1.5.1

Operating System
mac OS