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

Document the use of babel transform-class-properties to export classes with static properties using stealjs #5468

Open
piraz opened this issue Feb 8, 2020 · 2 comments

Comments

@piraz
Copy link

piraz commented Feb 8, 2020

It would be great to have documented the babel configuration to use the transform-class-properties plugin on Can 6 documentation to export classes with static properties using steal.

If we don't use the configuration an error like this will be displayed when I execute steal-tools export:

{ SyntaxError: unknown: Missing class properties transform.
   5 | 
   6 | export default class FazAlert extends StacheElement {
>  7 |     static view = alertTemplate;
     |     ^
   8 | 
   9 |     static get props() {
  10 |         return {

Using this configuration on my package.json fixes the issue:

"steal": {
    "plugins": [
      "steal-stache"
    ],
    "babelOptions": {
      "plugins": [
        "transform-class-properties" // <==== This one, right here
      ]
    }
  }
@cherifGsoul
Copy link
Member

@piraz thank you for reporting this, using transform-class-properties is already documented in StealJS section https://canjs.com/doc/guides/setup.html#StealJS.

Feel free to open the issue if you find that the section needs to be improved.

Screen Shot 2020-02-10 at 11 56 30 PM

@cherifGsoul
Copy link
Member

After seeing slack discussion, @piraz suggested to add it to add it to migrating to CanJS 6 docs.

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

No branches or pull requests

2 participants