Skip to content

Don’t override babel version if it’s explicit. - #1488

Closed
yavorsky wants to merge 2 commits into
babel:masterfrom
yavorsky:fix-version-downgrading
Closed

yavorsky wants to merge 2 commits into
babel:masterfrom
yavorsky:fix-version-downgrading

Conversation

@yavorsky

@yavorsky yavorsky commented Dec 17, 2017 •

Copy link
Copy Markdown
Member

This is a workaround for babel/babel#7016 and babel/babel#6174
Each babel-standalone bundle includes the previous version, so if, for example, we are loading @babel/[email protected], then Babel.version will return 7.0.0-beta.33

So, we are overriding version each time we reload the page and change some query params.
It's easy to reproduce it, just by reloading the page several times and compare version in the query or right left corner.

Try.

After publishing process will be fixed, we still will have old bundles with the previous version, so proposed solution is to don't override version if it's explicit semver value, and override for versions from the bundle for builds from CI.

@yavorsky
yavorsky requested review from Daniel15 and xtuc December 17, 2017 15:15
@babel-bot

babel-bot commented Dec 17, 2017 •

Copy link
Copy Markdown
Collaborator

@Daniel15

Copy link
Copy Markdown
Member

Interesting idea. It also means that we won't override the version when a range is passed (eg. 6 will stay as 6 rather than changing to 6.26.0)... Is that expected? That actually seems better, as currently going to https://babeljs.io/repl/version/6/ will end up with two version numbers in the URL (6 in the path and 6.26.0 in the querystring).

Let's still fix the version number in the standalone package, of course,. 😄

@yavorsky

yavorsky commented Dec 20, 2017 •

Copy link
Copy Markdown
Member Author

That actually seems better, as currently going to https://babeljs.io/repl/version/6/ will end up with two version numbers in the URL (6 in the path and 6.26.0 in the querystring).

On the other hand, we couldn't exactly know what version we are using for range values like 6. The only way is by opening network tab in the inspector.

Currently, it will override version for range values and won't affect just valid semver values, but we can also add range values support if displaying just 6 as a version is ok.

# Conflicts:
#	js/repl/loadBabel.js
@xtuc

xtuc commented Jun 4, 2018

Copy link
Copy Markdown
Member

What's the status @yavorsky?

@yavorsky

yavorsky commented Jun 8, 2018 •

Copy link
Copy Markdown
Member Author

@xtuc I think it's ok to merge. And according to the babeljs.io it wasn't fixed with other updates.

@xtuc xtuc left a comment

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.

We can merge it I think. Currently it's targeting the new website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants