Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP upgrade to babel 7 scoped packages #1036

Closed
wants to merge 1 commit into from

Conversation

maciej-ka
Copy link
Contributor

@maciej-ka maciej-ka commented Mar 4, 2018

#1029, #996

Keeping this MR open as WIP until problems are gone. And the problems are:

  • Babelify package is not official repo but ylemkimon/babelify, because it would otherwise expect babel 6 and not work in this setup. (suggested by @vihanb)
  • Some tests are failing. This MR has already a few adjustments to address breaking changes. I think Babelify produces a bit different AST which is a source of few snapshot reds. And some complaints about forEach on undefined are a total mystery for me at this point.

return (
<>
<div>Hello {this.props.name}</div>
</>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fragment here is added to test #1029

"are-we-flow-yet": "^1.0.0",
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.1",
"babel-core": "^7.0.0-0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

jest@test which uses Babel 7 seems to still require unscoped babel-core import. I couldn't start the tests without it. Read more here

@maciej-ka maciej-ka changed the title chore: upgrade to babel 7 scoped packages WIP upgrade to babel 7 scoped packages Mar 4, 2018
@tmcw
Copy link
Member

tmcw commented Mar 8, 2018

Cool! Sorry, been busy with the day job but taking a look now...

Not sure if you've used https://astexplorer.net but it's a godsend for this kind of development. Toggling between babylon6 and babylon7 helps a bit showing the AST changes. Also there's a post about some renamings - tried out one of them, and it already cuts down on failed tests to replace all references to NumericLiteralTypeAnnotation with NumberLiteralTypeAnnotation.

@maciej-ka
Copy link
Contributor Author

Thanks for links, I was looking for exactly something like them.

I have a bit unexpected situation, for around two weeks I don't have a quiet place to work and I have to halt my open source activity (trying to do it next to crying babies frustrated me a lot). See you soon after I'm over these problems.

@cyrilchapon
Copy link

Any update on this ?
Any temporary workaround to make this work with babel7 ?

@jaydenseric
Copy link
Contributor

I suspect updating Babel might fix #1092.

@jaydenseric
Copy link
Contributor

@cyrilchapon I haven't noticed any issues with Babel v7 until now, but then again I use babel.config.js (a Babel v7 convention) and it seems documentation.js only notices and freaks out with .babelrc: #996.

@cyrilchapon
Copy link

@jaydenseric, thanks for this.

I haven't noticed any issues with Babel v7 until now

Are you using @latest from documentation.js npm ?

I'll give a try to babel.config.js, I'm indeed using .babelrc

"babel-types": "^6.26.0",
"babelify": "^8.0.0",
"babylon": "^6.18.0",
"babelify": "git+https://github.com/ylemkimon/babelify.git#master",
Copy link
Contributor

Choose a reason for hiding this comment

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

The official babelify project supports Babel v7 now: https://github.com/babel/babelify/blob/v9.0.0/package.json#L16

@iztsv
Copy link

iztsv commented Jun 21, 2018

@maciej-ka thanks for the working on the feature!

Can you explain when that will be available?

@tmcw
Copy link
Member

tmcw commented Jun 21, 2018

My preference is to wait until Babel 7 is released - it's currently still a beta release, and there are still stable releases of Babel 6. The 7 release has been pushed back several times - it was 'soon' in Sept 2017. If we were to jump the gun on this, then documentation.js would stop working with, most likely, the majority of projects that use it with Babel 6, and we'd have to backport changes until Babel 7 is the stable and recommended version.

@smokku
Copy link

smokku commented Aug 28, 2018

Babel 7 was just released.

@puttpotsawee
Copy link

Any update on this? Babel 7 was officially released!

@tmcw
Copy link
Member

tmcw commented Sep 3, 2018

I think #1114 is a roughly more-complete branch that also approaches the Babel 7 upgrade.

@puttpotsawee
Copy link

@tmcw It's working now!
In package.json, I change

"documentation": "^8.1.2"

to

"documentation": "git+ssh://github.com/vicapow/documentation#update-babel-dist"

and it works like charm

@tmcw
Copy link
Member

tmcw commented Sep 21, 2018

Thanks for the hard work, and sorry for the communication failure - the update-babel PR is now merged, and the first Babel 7 prelease, 9.0.0-alpha.0 is pushed.

@tmcw tmcw closed this Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants