Skip to content

Fix babel-standalone builds#6132

Closed
jridgewell wants to merge 3 commits intobabel:7.0from
jridgewell:fix-babel-standalone-build
Closed

Fix babel-standalone builds#6132
jridgewell wants to merge 3 commits intobabel:7.0from
jridgewell:fix-babel-standalone-build

Conversation

@jridgewell
Copy link
Copy Markdown
Member

Because we were building it from the main gulp file, it was including
the packages that the monorepo depends on (version alpha.18 currently).
But, alpha.18 doesn’t have PrivateName (cause it’s going into
alpha.19). So when I tried to build alpha.19, it failed.

Now, we have babel-standalone’s own gulp do the build. And it correctly
depends on the alpha.19 packages (and they include PrivateName now),
so it builds.

Because we were building it from the main gulp file, it was including
the packages that the monorepo depends on (version alpha.18 currently).
But, alpha.18 doesn’t have `PrivateName` (cause it’s going into
alpha.19). So when I tried to build alpha.19, it failed.

Now, we have babel-standalone’s own gulp do the build. And it correctly
depends on the alpha.19 packages (and they include `PrivateName` now),
so it builds.
@jridgewell jridgewell added the PR: Internal 🏠 A type of pull request used for our changelog categories label Aug 18, 2017
@jridgewell jridgewell requested a review from Daniel15 August 18, 2017 05:39
@mention-bot
Copy link
Copy Markdown

@jridgewell, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hzoo, @ChauTNguyen and @danez to be potential reviewers.

Copy link
Copy Markdown
Member

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me, but I don't quite understand why it fixes things. Why would the monorepo reference be different to the babel-standalone reference?

BABEL_VERSION:
JSON.stringify(require("babel-core/package.json").version),
BABEL_VERSION: JSON.stringify(
require("babel-core/package.json").version,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still defining the BABEL_VERSION by loading the babel-core from node_modules instead of the babel-core being compiled 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why wouldn't it be the babel-core version being compiled? If we're in babel-standalone, wouldn't require('babel-core') give us the babel-core that's been symlinked via Lerna?

@jridgewell
Copy link
Copy Markdown
Member Author

Damn it, this still doesn't fix it. make boostrap works, but I still can't compile this individually, or run make test.

The issue is that this is loading babel-core from the monorepo's node_modules, not this babel-standalone's.

@jridgewell
Copy link
Copy Markdown
Member Author

/cc @hzoo: I think the yarn workspaces are screwing up.

@jridgewell
Copy link
Copy Markdown
Member Author

You can checkout #6120 to see what's going on. I've defined the new PrivateName type, but because everything is included from the monorepo's node_modules, nothing picks it up. Whatever the cause is, I can't work on Private Props until the tests run again.

jridgewell added a commit to babel/babel-loader that referenced this pull request Aug 18, 2017
I think this is the root cause for babel/babel#6132.
node scripts/generate-babel-types-docs.js

build-babel-standalone:
cd packages/babel-standalone; \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will mess up the cwd, since you don't cd ../.. at the end. It should likely use pushd and popd instead. Having said that, Gulp has a --cwd option that might be able to be used instead: https://github.com/gulpjs/gulp/blob/master/docs/recipes/specifying-a-cwd.md

eg.

./node_modules/.bin/gulp build --cwd=packages/babel-standalone

}

module.exports = registerGulpTasks;
gulp.task("build", cb => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to still export this as a reusable function, as babili-standalone / babel-minify-standalone will reuse it. Maybe keep it in a separate file, and have a Gulpfile.js in this directory that imports it?

@jridgewell jridgewell closed this Aug 19, 2017
This was referenced Aug 19, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants