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

1.3-modules-beta.5 - Missing class properties transform. #6096

Closed
haiodo opened this Issue Jan 27, 2016 · 8 comments

Comments

Projects
None yet
8 participants
@haiodo

haiodo commented Jan 27, 2016

Hi,

After update from 1.3-modules-beta.4 to beta.5 following errors become occur on classes with types defined.

example.js

/* @flow */
class MyClass {
   myField: string;
}

Any plans to return support of flowtype.org back in beta.6?

Best regards,
Andrey.

@rdickert rdickert added this to the Release 1.3 milestone Feb 2, 2016

@benjamn

This comment has been minimized.

Show comment
Hide comment
@benjamn

benjamn Feb 3, 2016

Member

Class properties are only at stage 1 of standardization, which means the syntax and semantics could still change drastically: https://github.com/tc39/ecma262#current-proposals, https://github.com/jeffmo/es-class-fields-and-static-properties

If you really want to use this feature now, you should fork the ecmascript and babel-compiler packages.

Member

benjamn commented Feb 3, 2016

Class properties are only at stage 1 of standardization, which means the syntax and semantics could still change drastically: https://github.com/tc39/ecma262#current-proposals, https://github.com/jeffmo/es-class-fields-and-static-properties

If you really want to use this feature now, you should fork the ecmascript and babel-compiler packages.

@benjamn benjamn closed this Feb 3, 2016

@ChrisCinelli

This comment has been minimized.

Show comment
Hide comment
@ChrisCinelli

ChrisCinelli Mar 12, 2016

How difficult is to add options to enable or add babel modules? For example I would definitely add stage-0 to my environment. I would also like to add: "transform-decorators-legacy" and "jsx-control-statements".

ChrisCinelli commented Mar 12, 2016

How difficult is to add options to enable or add babel modules? For example I would definitely add stage-0 to my environment. I would also like to add: "transform-decorators-legacy" and "jsx-control-statements".

@joncursi

This comment has been minimized.

Show comment
Hide comment
@joncursi

joncursi Jul 26, 2016

Agreed. All of my other projects are using early versions of ES7 but due to lack of control over babel we have to write code differently than we would prefer within Meteor.

joncursi commented Jul 26, 2016

Agreed. All of my other projects are using early versions of ES7 but due to lack of control over babel we have to write code differently than we would prefer within Meteor.

@joncursi

This comment has been minimized.

Show comment
Hide comment
@joncursi

joncursi Jul 26, 2016

Hmm, looks like this was actually addressed in 1.3.x? It looks like .babelrc support is now a thing!

joncursi commented Jul 26, 2016

Hmm, looks like this was actually addressed in 1.3.x? It looks like .babelrc support is now a thing!

@abernix

This comment has been minimized.

Show comment
Hide comment
@abernix

abernix Jul 26, 2016

Member

@joncursi .babelrc support did come in 1.3.3! See more in the Meteor forums and Meteor blog!

Member

abernix commented Jul 26, 2016

@joncursi .babelrc support did come in 1.3.3! See more in the Meteor forums and Meteor blog!

@stubailo

This comment has been minimized.

Show comment
Hide comment
@stubailo

stubailo Dec 23, 2016

Contributor

Coming back on this issue - the syntax did change dramatically! Boy, I'm glad I didn't write a lot of code with the old syntax.

It's in stage 2 now, and I got here by talking to someone who was trying to follow learnapollo.com in Meteor: https://forums.meteor.com/t/learnapollo-meteor-or-how-to-deal-with-the-es7-and-es6-issues/32558

It seems like a lot of React tutorials are now assuming this transform is on, so perhaps it's a good time to switch it on by default? It does depend on how likely it is for the syntax to change.

Contributor

stubailo commented Dec 23, 2016

Coming back on this issue - the syntax did change dramatically! Boy, I'm glad I didn't write a lot of code with the old syntax.

It's in stage 2 now, and I got here by talking to someone who was trying to follow learnapollo.com in Meteor: https://forums.meteor.com/t/learnapollo-meteor-or-how-to-deal-with-the-es7-and-es6-issues/32558

It seems like a lot of React tutorials are now assuming this transform is on, so perhaps it's a good time to switch it on by default? It does depend on how likely it is for the syntax to change.

@abernix

This comment has been minimized.

Show comment
Hide comment
@abernix

abernix Dec 30, 2016

Member

If it were Stage 3, I'd be more in favor of turning it on right now; it's hard to say how much it will change from Stage 2.

Timing-wise, I might suggest that we review all transforms at closer to 2017-02-01 as this might give ES2017 time to surface (TC39 meeting is sometime in January). Also, UglifyJS is rumored to get harmony support around then. I link these two things together only because there might be some similar considerations.

Member

abernix commented Dec 30, 2016

If it were Stage 3, I'd be more in favor of turning it on right now; it's hard to say how much it will change from Stage 2.

Timing-wise, I might suggest that we review all transforms at closer to 2017-02-01 as this might give ES2017 time to surface (TC39 meeting is sometime in January). Also, UglifyJS is rumored to get harmony support around then. I link these two things together only because there might be some similar considerations.

@mattblackdev

This comment has been minimized.

Show comment
Hide comment
@mattblackdev

mattblackdev Apr 14, 2017

Im having this issue with mobx & Meteor 1.4.4.x
example-store.js:

import { observable } from 'mobx'

class ExampleStore {
  @observable foo = 'bar'
}

const exampleStore = new ExampleStore()
export default exampleStore

component.js:

import React from 'react'
import { observer } from 'mobx-react'
import exampleStore from './exampleStore'

export default observer(() => <div>{exampleStore.foo}</div>)

exampleStore.js: Missing class properties transform.

exampleStore.js works fine when written like this:

class ExampleStore {
  constructor() {
    this.foo = observable('bar')
  }
}

I do have .babelrc:

{
  "plugins": ["transform-decorators-legacy"]
}

Other decorators work fine like action and computed.

mattblackdev commented Apr 14, 2017

Im having this issue with mobx & Meteor 1.4.4.x
example-store.js:

import { observable } from 'mobx'

class ExampleStore {
  @observable foo = 'bar'
}

const exampleStore = new ExampleStore()
export default exampleStore

component.js:

import React from 'react'
import { observer } from 'mobx-react'
import exampleStore from './exampleStore'

export default observer(() => <div>{exampleStore.foo}</div>)

exampleStore.js: Missing class properties transform.

exampleStore.js works fine when written like this:

class ExampleStore {
  constructor() {
    this.foo = observable('bar')
  }
}

I do have .babelrc:

{
  "plugins": ["transform-decorators-legacy"]
}

Other decorators work fine like action and computed.

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