GithubHelp home page GithubHelp logo

Comments (6)

XuluWarrior avatar XuluWarrior commented on June 11, 2024 1

@simonihmig That was very helpful
I found that our code also has quoted properties.

A quick hack to transformer-legacy.js "fixes" this. But I don't know enough Babel to know what a real fix would be.

    path.replaceWith(_core().types.callExpression(state.addHelper("initializerDefineProperty"), [_core().types.cloneNode(path.get("left.object").node), _core().types.stringLiteral(path.get("left.property").node.name), _core().types.cloneNode(path.get("right.arguments")[0].node), _core().types.cloneNode(path.get("right.arguments")[1].node)]));

->

    path.replaceWith(_core().types.callExpression(state.addHelper("initializerDefineProperty"), [_core().types.cloneNode(path.get("left.object").node), _core().types.stringLiteral(path.get("left.property").node.name || path.get("left.property").node.value), _core().types.cloneNode(path.get("right.arguments")[0].node), _core().types.cloneNode(path.get("right.arguments")[1].node)]));

Unfortunately, I'm now getting runtime issues which I'm looking into now.

from ember-decorators.

XuluWarrior avatar XuluWarrior commented on June 11, 2024

One thing I have noticed is that a number of our ember add-on dependencies using ember-cli-babel@^6. So while the top level installed version of ember-cli-babel is 7.7.3, some add-ons have a private dependency on 6.18.0.

Could this be a factor in my issue?

from ember-decorators.

simonihmig avatar simonihmig commented on June 11, 2024

Seeing the same, after upgrading e-d from 5.x to 6.0 (and going back to stage 1 decorators). Seems to be related to having a quoted property, at least for me...

This fails the build with that TypeError: Property value expected type of string but got null error:

  @attribute
  'data-test-foo' = true;

While this works:

  @attribute
  dataTestFoo = true;

from ember-decorators.

buschtoens avatar buschtoens commented on June 11, 2024

I would bet that usage of ember-cli-typescript is not relevant here, but that this is a bug in the legacy decorators implementation of babel.

from ember-decorators.

dfreeman avatar dfreeman commented on June 11, 2024

It looks like there's an issue for this in the Babel repo, but it hasn't gotten any love yet babel/babel#10059

from ember-decorators.

fpauser avatar fpauser commented on June 11, 2024

Note: babel/babel#10059 was fixed with babel/babel#10578 (support string literal properties)

from ember-decorators.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.