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

Babel 6 #46

Closed
aruberto opened this Issue Oct 30, 2015 · 33 comments

Comments

Projects
None yet
@aruberto

aruberto commented Oct 30, 2015

Babel 6 was just released and has a new plugin API. Assuming this plugin will need to be updated to support it (otherwise can just close this issue).

@aruberto aruberto changed the title from Babael 6 to Babel 6 Oct 30, 2015

@leecade

This comment has been minimized.

Show comment
Hide comment
@leecade

leecade Oct 31, 2015

👍 want this

leecade commented Oct 31, 2015

👍 want this

@theneva

This comment has been minimized.

Show comment
Hide comment
@theneva

theneva commented Oct 31, 2015

👍

@anselmo

This comment has been minimized.

Show comment
Hide comment
@anselmo

anselmo commented Oct 31, 2015

+1

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Oct 31, 2015

Owner

Please, don't +1 the issue, it doesn't help at all.

I'm aware Babel 6 is out and I'll support it in the next release.
If you feel like making a PR or temporarily maintaining a Babel 6-compatible fork, please do.
I will get back to this (and React 0.14 full support) in a week or two, in the meantime please be patient.

Owner

gaearon commented Oct 31, 2015

Please, don't +1 the issue, it doesn't help at all.

I'm aware Babel 6 is out and I'll support it in the next release.
If you feel like making a PR or temporarily maintaining a Babel 6-compatible fork, please do.
I will get back to this (and React 0.14 full support) in a week or two, in the meantime please be patient.

@theneva

This comment has been minimized.

Show comment
Hide comment
@theneva

theneva Oct 31, 2015

I'm trying to make a PR, but can't for the life of me figure out where babel-plugin has gone.

It's used by the build npm script, but is no longer part of babel. It doesn't seem to be part of babel-core, babel-cli, or even babel-runtime, and there's no package called just babel-plugin. Am I missing something obvious?

As you can probably tell, this is my first attempt at babel plugins, so I'm not familiar with the ecosystem...

theneva commented Oct 31, 2015

I'm trying to make a PR, but can't for the life of me figure out where babel-plugin has gone.

It's used by the build npm script, but is no longer part of babel. It doesn't seem to be part of babel-core, babel-cli, or even babel-runtime, and there's no package called just babel-plugin. Am I missing something obvious?

As you can probably tell, this is my first attempt at babel plugins, so I'm not familiar with the ecosystem...

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Oct 31, 2015

Owner

It's not really important, from what I remember. I just copied it because that's what other plugins were using, but I think it can be replaced by simple babel CLI call. You can take inspiration from any Babel plugin here: https://github.com/babel/babel/tree/development/packages.

Owner

gaearon commented Oct 31, 2015

It's not really important, from what I remember. I just copied it because that's what other plugins were using, but I think it can be replaced by simple babel CLI call. You can take inspiration from any Babel plugin here: https://github.com/babel/babel/tree/development/packages.

@theneva

This comment has been minimized.

Show comment
Hide comment
@theneva

theneva Oct 31, 2015

Thanks, will look into it and report back if/when I have something.

theneva commented Oct 31, 2015

Thanks, will look into it and report back if/when I have something.

@chicoxyzzy

This comment has been minimized.

Show comment
Hide comment
@chicoxyzzy

chicoxyzzy Nov 1, 2015

I've made some progress on this
branch: https://github.com/chicoxyzzy/babel-plugin-react-transform/tree/babel-6
commit: 292e5ad
If you npm link my babel-6 branch you can see that visitor's exit method still returns result of t.program. I can't find any docs on how to fix this method to work proper. I think the rest should work fine.
Also tests are still on Babel 5 so they won't work either.
@theneva do you have any progress on this?

chicoxyzzy commented Nov 1, 2015

I've made some progress on this
branch: https://github.com/chicoxyzzy/babel-plugin-react-transform/tree/babel-6
commit: 292e5ad
If you npm link my babel-6 branch you can see that visitor's exit method still returns result of t.program. I can't find any docs on how to fix this method to work proper. I think the rest should work fine.
Also tests are still on Babel 5 so they won't work either.
@theneva do you have any progress on this?

@chicoxyzzy

This comment has been minimized.

Show comment
Hide comment
@chicoxyzzy

chicoxyzzy Nov 1, 2015

options should be passed like so

          presets: ['es2015', 'react'],
          plugins: [
            ['transform-object-rest-spread'],
            ['transform-class-properties'],
            ['react-transform', {
              transforms: [
                {
                  transform: 'react-transform-hmr',
                  imports: ['react'],
                  locals: ['module'],
                }, {
                  transform: 'react-transform-catch-errors',
                  imports: ['react', 'redbox-react'],
                },
              ],
            }],
          ],

chicoxyzzy commented Nov 1, 2015

options should be passed like so

          presets: ['es2015', 'react'],
          plugins: [
            ['transform-object-rest-spread'],
            ['transform-class-properties'],
            ['react-transform', {
              transforms: [
                {
                  transform: 'react-transform-hmr',
                  imports: ['react'],
                  locals: ['module'],
                }, {
                  transform: 'react-transform-catch-errors',
                  imports: ['react', 'redbox-react'],
                },
              ],
            }],
          ],
@leecade

This comment has been minimized.

Show comment
Hide comment
@leecade

leecade Nov 1, 2015

@chicoxyzzy thanks , I didn't know how to add extra before

leecade commented Nov 1, 2015

@chicoxyzzy thanks , I didn't know how to add extra before

@theneva

This comment has been minimized.

Show comment
Hide comment
@theneva

theneva Nov 1, 2015

Nice, @chicoxyzzy. I haven't been able to get very far, no – and I unfortunately can't get around to look any more into it before tomorrow. Please keep up your good work 😃 :

theneva commented Nov 1, 2015

Nice, @chicoxyzzy. I haven't been able to get very far, no – and I unfortunately can't get around to look any more into it before tomorrow. Please keep up your good work 😃 :

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Nov 1, 2015

Owner

We should make a Babel 6 preset for HMR + error catching.

Owner

gaearon commented Nov 1, 2015

We should make a Babel 6 preset for HMR + error catching.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 1, 2015

Just threw it together and haven't tested yet but: https://github.com/danmartinez101/babel-preset-react-hmre

Is this on the right track, @gaearon ?

ghost commented Nov 1, 2015

Just threw it together and haven't tested yet but: https://github.com/danmartinez101/babel-preset-react-hmre

Is this on the right track, @gaearon ?

@chicoxyzzy

This comment has been minimized.

Show comment
Hide comment
@chicoxyzzy

chicoxyzzy Nov 1, 2015

Yep @danmartinez101 it looks ok.

But first of all we need to:

  • migrate build step to Babel 6
  • update tests
  • fix Program.exit

I'll try my best to fix it but I'll be very busy next two weeks. Anyway feel free to ping me if you think I can help.

chicoxyzzy commented Nov 1, 2015

Yep @danmartinez101 it looks ok.

But first of all we need to:

  • migrate build step to Babel 6
  • update tests
  • fix Program.exit

I'll try my best to fix it but I'll be very busy next two weeks. Anyway feel free to ping me if you think I can help.

bebraw added a commit to survivejs/react-book that referenced this issue Nov 2, 2015

webpack and react - Use Babel 5
Need to wait until babel-plugin-react-transform is ready for Babel 6.
Related to gaearon/babel-plugin-react-transform#46.

@iam4x iam4x referenced this issue Nov 3, 2015

Merged

update to babel6 #136

@buildmaster

This comment has been minimized.

Show comment
Hide comment
@buildmaster

buildmaster Nov 3, 2015

I've created a pull request on chicoxyzzy#1 which updates the tests to use babel 6. All but the Vanilla test on that branch now throw an error

Unexpected return value from visitor method function (path) {
        return fn.call(state, path, state);
      }

buildmaster commented Nov 3, 2015

I've created a pull request on chicoxyzzy#1 which updates the tests to use babel 6. All but the Vanilla test on that branch now throw an error

Unexpected return value from visitor method function (path) {
        return fn.call(state, path, state);
      }
@chicoxyzzy

This comment has been minimized.

Show comment
Hide comment
@chicoxyzzy

chicoxyzzy Nov 3, 2015

@buildmaster I just checked your PR. If you will rm -rf node_modules and then npm install you'll see error

> babel-plugin build

sh: babel-plugin: command not found

that's because there is no babel-plugin in node_modules/.bin directory anymore. So we should fix build script in package.json somehow

chicoxyzzy commented Nov 3, 2015

@buildmaster I just checked your PR. If you will rm -rf node_modules and then npm install you'll see error

> babel-plugin build

sh: babel-plugin: command not found

that's because there is no babel-plugin in node_modules/.bin directory anymore. So we should fix build script in package.json somehow

@buildmaster

This comment has been minimized.

Show comment
Hide comment
@buildmaster

buildmaster Nov 3, 2015

ok I've copied the command from the old babel-plugin bin, but means a dev requirement on babel-cli as well.

buildmaster commented Nov 3, 2015

ok I've copied the command from the old babel-plugin bin, but means a dev requirement on babel-cli as well.

@buildmaster

This comment has been minimized.

Show comment
Hide comment
@buildmaster

buildmaster Nov 3, 2015

ok made a couple of updates, but I think I'm at the limit of my knowledge, so might have to wait for someone who knows how the plugin actually works to pick up the fix

buildmaster commented Nov 3, 2015

ok made a couple of updates, but I think I'm at the limit of my knowledge, so might have to wait for someone who knows how the plugin actually works to pick up the fix

@theneva

This comment has been minimized.

Show comment
Hide comment
@theneva

theneva Nov 4, 2015

@buildmaster @chicoxyzzy I think this is the easiest way to do it, yeah – that's how I did it in my (still unpushed) branch too. Not sure you need the --copy-files option, though?

At any rate, this will be quite a bit bigger than simply changing the plugin export… especially due to fixing the tests, which I don't have any experience with.

Is anyone close to having a complete PR on this?

theneva commented Nov 4, 2015

@buildmaster @chicoxyzzy I think this is the easiest way to do it, yeah – that's how I did it in my (still unpushed) branch too. Not sure you need the --copy-files option, though?

At any rate, this will be quite a bit bigger than simply changing the plugin export… especially due to fixing the tests, which I don't have any experience with.

Is anyone close to having a complete PR on this?

@luandro luandro referenced this issue Nov 5, 2015

Closed

Update to Babel 6 #77

@chicoxyzzy

This comment has been minimized.

Show comment
Hide comment
@chicoxyzzy

chicoxyzzy Nov 12, 2015

Good work @TaopaiC and @buildmaster! I've merged your commits! Now we should fix Program.exit and failing test for modern classes

chicoxyzzy commented Nov 12, 2015

Good work @TaopaiC and @buildmaster! I've merged your commits! Now we should fix Program.exit and failing test for modern classes

@chicoxyzzy

This comment has been minimized.

Show comment
Hide comment
@chicoxyzzy

chicoxyzzy Nov 12, 2015

@gaearon should I create WIP PR so everyone will be able to help and track progress more comfortably?

chicoxyzzy commented Nov 12, 2015

@gaearon should I create WIP PR so everyone will be able to help and track progress more comfortably?

@geminiyellow

This comment has been minimized.

Show comment
Hide comment
@geminiyellow

geminiyellow Nov 13, 2015

is any news in here?

geminiyellow commented Nov 13, 2015

is any news in here?

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Nov 13, 2015

Owner

Please feel free to create a PR.
I will be able to review in a couple of weeks and no sooner due to my current workload.

Owner

gaearon commented Nov 13, 2015

Please feel free to create a PR.
I will be able to review in a couple of weeks and no sooner due to my current workload.

@chicoxyzzy chicoxyzzy referenced this issue Nov 13, 2015

Closed

Move to Babel 6 (WIP) #48

2 of 3 tasks complete
@chicoxyzzy

This comment has been minimized.

Show comment
Hide comment
@chicoxyzzy

chicoxyzzy Nov 13, 2015

Please feel free to create a PR.

here it is #48

chicoxyzzy commented Nov 13, 2015

Please feel free to create a PR.

here it is #48

geowarin added a commit to geowarin/boot-react that referenced this issue Nov 13, 2015

Upgrade frontend dependencies
React router is 1.0.0 now
React is 0.14.2

I'm waiting on gaearon/babel-plugin-react-transform#46
to upgrade to babel 6.0.
Migration should be similar to this:
zackify/react-router@b3fb1f8
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 17, 2015

I have no idea how babel or this plugin work so I'm going to start hacking away in a different fork for now.
You can find it here: https://github.com/danmartinez101/babel-plugin-react-transform/tree/unit-tests

This is the approach I'm planning on taking:

  1. Write granular unit tests for the existing plugin (with Babel 5)
  2. Upgrade to Babel 6
  3. Fix the granular unit tests
  4. Update the fixtures
  5. Hope that the fixture-based tests pass because the unit tests covered all the logic (but probably will need to tweak them due to Babel potentially outputting things differently)

Once I get through all or most of this, I can either apply what I've learned to the branch created above, or we can just go with this one ( assuming that it actually works, of course... and that is a big assumption :P )

Edit: I'm also using jasmine so I can focus on writing tests instead of figuring out how to configure mocha but these can be converted to mocha easily later

ghost commented Nov 17, 2015

I have no idea how babel or this plugin work so I'm going to start hacking away in a different fork for now.
You can find it here: https://github.com/danmartinez101/babel-plugin-react-transform/tree/unit-tests

This is the approach I'm planning on taking:

  1. Write granular unit tests for the existing plugin (with Babel 5)
  2. Upgrade to Babel 6
  3. Fix the granular unit tests
  4. Update the fixtures
  5. Hope that the fixture-based tests pass because the unit tests covered all the logic (but probably will need to tweak them due to Babel potentially outputting things differently)

Once I get through all or most of this, I can either apply what I've learned to the branch created above, or we can just go with this one ( assuming that it actually works, of course... and that is a big assumption :P )

Edit: I'm also using jasmine so I can focus on writing tests instead of figuring out how to configure mocha but these can be converted to mocha easily later

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Nov 17, 2015

Owner

Just throwing in this amazing new reference: https://github.com/thejameskyle/babel-plugin-handbook
We did some things in a wrong way because I didn't know any better.
While we're at it, we can learn to use scope correctly, etc.

Owner

gaearon commented Nov 17, 2015

Just throwing in this amazing new reference: https://github.com/thejameskyle/babel-plugin-handbook
We did some things in a wrong way because I didn't know any better.
While we're at it, we can learn to use scope correctly, etc.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 17, 2015

I started reading that last night; it has helped a lot already :D :D I was planning on seeing if parts of the plugin could be improved, but want to get through tests and upgrade first to make sure I really understand it. I'm hoping to get it wrapped up tonight.

ghost commented Nov 17, 2015

I started reading that last night; it has helped a lot already :D :D I was planning on seeing if parts of the plugin could be improved, but want to get through tests and upgrade first to make sure I really understand it. I'm hoping to get it wrapped up tonight.

@ratson ratson referenced this issue Nov 17, 2015

Closed

Babel 6 issues #1

4 of 7 tasks complete
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost commented Nov 17, 2015

I'm also thinking that https://github.com/babel/babel/tree/master/packages/babel-template is going to be useful here.

@justingreenberg

This comment has been minimized.

Show comment
Hide comment
@justingreenberg

justingreenberg Nov 18, 2015

Contributor

@danmartinez101 for sure—babel-template is being used to create the core HOCs (as a workaround for decorators) in #48 and there are definitely some other areas i think templating could simplify things

@gaearon what do you think is incorrect with respect to scope?

Contributor

justingreenberg commented Nov 18, 2015

@danmartinez101 for sure—babel-template is being used to create the core HOCs (as a workaround for decorators) in #48 and there are definitely some other areas i think templating could simplify things

@gaearon what do you think is incorrect with respect to scope?

@chentsulin chentsulin referenced this issue Nov 23, 2015

Closed

Roadmap #37

20 of 24 tasks complete
@vagusX

This comment has been minimized.

Show comment
Hide comment
@vagusX

vagusX Nov 23, 2015

how's it going?

vagusX commented Nov 23, 2015

how's it going?

@mmahalwy

This comment has been minimized.

Show comment
Hide comment
@mmahalwy

mmahalwy Nov 25, 2015

any luck with this?

mmahalwy commented Nov 25, 2015

any luck with this?

@gaearon

This comment has been minimized.

Show comment
Hide comment
@gaearon

gaearon Nov 25, 2015

Owner

Please track #50 instead. I will soon have time to release it & related packages.

Owner

gaearon commented Nov 25, 2015

Please track #50 instead. I will soon have time to release it & related packages.

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