Rename 6to5 to Babel #5579

Merged
merged 1 commit into from Feb 20, 2015

Conversation

Projects
None yet
4 participants
@kittens
Contributor

kittens commented Feb 17, 2015

6to5 has been renamed to Babel, more information here.

@kittens kittens referenced this pull request in babel/babel Feb 17, 2015

Closed

Name change #780

45 of 45 tasks complete
@thedaniel

This comment has been minimized.

Show comment
Hide comment
@thedaniel

thedaniel Feb 17, 2015

Contributor

Quickly skimming this code, it looks like it's mostly find-and-replace, and removes refs to 6to5 entirely. Even if we change the directive to 'use babel'; we've publicly written about 'use 6to5;` so we need to support using that directive to invoke babel as well.

Contributor

thedaniel commented Feb 17, 2015

Quickly skimming this code, it looks like it's mostly find-and-replace, and removes refs to 6to5 entirely. Even if we change the directive to 'use babel'; we've publicly written about 'use 6to5;` so we need to support using that directive to invoke babel as well.

spec/fixtures/babel/single-quotes.js
@@ -1,3 +1,3 @@
-'use 6to5';
+'use babel';

This comment has been minimized.

@kevinsawicki

kevinsawicki Feb 17, 2015

Member

Instead of changing the specs, I'd prefer to just add new ones for babel, so we make sure the legacy support is still tested.

@kevinsawicki

kevinsawicki Feb 17, 2015

Member

Instead of changing the specs, I'd prefer to just add new ones for babel, so we make sure the legacy support is still tested.

This comment has been minimized.

@kittens

kittens Feb 17, 2015

Contributor

Sure.

@kittens

kittens Feb 17, 2015

Contributor

Sure.

@kittens

This comment has been minimized.

Show comment
Hide comment
@kittens

kittens Feb 17, 2015

Contributor

@thedaniel Is that not what this does?

unless /^("use 6to5"|'use 6to5'|"use babel"|'use babel')/.test(sourceCode)
Contributor

kittens commented Feb 17, 2015

@thedaniel Is that not what this does?

unless /^("use 6to5"|'use 6to5'|"use babel"|'use babel')/.test(sourceCode)
@kittens

This comment has been minimized.

Show comment
Hide comment
@kittens

kittens Feb 18, 2015

Contributor

Updated to include backwards compatibility tests for the old use 6to5 directive.

Contributor

kittens commented Feb 18, 2015

Updated to include backwards compatibility tests for the old use 6to5 directive.

spec/fixtures/6to5/double-quotes.js
@@ -1,3 +1,3 @@
-"use 6to5";
+"use babel";

This comment has been minimized.

@kevinsawicki

kevinsawicki Feb 18, 2015

Member

This file can go now right? Since all the fixtures are in the new babel folder?

@kevinsawicki

kevinsawicki Feb 18, 2015

Member

This file can go now right? Since all the fixtures are in the new babel folder?

This comment has been minimized.

@kittens

kittens Feb 18, 2015

Contributor

Whoops, accidentally committed that, sorry!

@kittens

kittens Feb 18, 2015

Contributor

Whoops, accidentally committed that, sorry!

spec/fixtures/6to5/single-quotes.js
@@ -1,3 +1,3 @@
-'use 6to5';
+'use babel';

This comment has been minimized.

@kevinsawicki

kevinsawicki Feb 18, 2015

Member

This file too is no longer used right?

@kevinsawicki

kevinsawicki Feb 18, 2015

Member

This file too is no longer used right?

@@ -132,7 +132,7 @@ transpile = (sourceCode, filePath, cachePath) ->
# either generated on the fly or pulled from cache.
loadFile = (module, filePath) ->
sourceCode = fs.readFileSync(filePath, 'utf8')
- unless sourceCode.startsWith('"use 6to5"') or sourceCode.startsWith("'use 6to5'")
+ unless /^("use 6to5"|'use 6to5'|"use babel"|'use babel')/.test(sourceCode)

This comment has been minimized.

@bolinfest

bolinfest Feb 18, 2015

Contributor

I don't know if V8 caches regexes, but in the event that it doesn't, I would extract this regex to a constant so it is not recreated each time.

Also, I don't know how well this performs compared to startsWith().

@bolinfest

bolinfest Feb 18, 2015

Contributor

I don't know if V8 caches regexes, but in the event that it doesn't, I would extract this regex to a constant so it is not recreated each time.

Also, I don't know how well this performs compared to startsWith().

This comment has been minimized.

@bolinfest

bolinfest Feb 18, 2015

Contributor

Also, if it matches 6to5 instead of babel, I think it should print out a deprecation warning. It's early enough that we can probably get everyone to convert their pragmas now if there's a warning that tells them to.

@bolinfest

bolinfest Feb 18, 2015

Contributor

Also, if it matches 6to5 instead of babel, I think it should print out a deprecation warning. It's early enough that we can probably get everyone to convert their pragmas now if there's a warning that tells them to.

This comment has been minimized.

@kittens

kittens Feb 18, 2015

Contributor

I copy and pasted that line from atom-shell-starter so I have no idea how well it fairs.

@kittens

kittens Feb 18, 2015

Contributor

I copy and pasted that line from atom-shell-starter so I have no idea how well it fairs.

kevinsawicki added a commit that referenced this pull request Feb 20, 2015

Merge pull request #5579 from sebmck/babel
Rename 6to5 to Babel

@kevinsawicki kevinsawicki merged commit caff9e0 into atom:master Feb 20, 2015

@kevinsawicki

This comment has been minimized.

Show comment
Hide comment
@kevinsawicki

kevinsawicki Feb 20, 2015

Member

Thanks for fixing this up, this will be included in the next Atom release, 0.183

Member

kevinsawicki commented Feb 20, 2015

Thanks for fixing this up, this will be included in the next Atom release, 0.183

@kittens kittens deleted the kittens:babel branch Feb 24, 2015

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