Code Monkey home page Code Monkey logo

Comments (8)

ballPointPenguin avatar ballPointPenguin commented on June 3, 2024

aha πŸ¦†
I needed to use
this.get('router')
instead of
this.router

from ember-decorators.

pzuraq avatar pzuraq commented on June 3, 2024

That should not be the case, which version of Ember are you using?

from ember-decorators.

pgrippi avatar pgrippi commented on June 3, 2024

@pzuraq I've run into this as well, testing the latest Ember Octane.

"ember-source": "https://s3.amazonaws.com/builds.emberjs.com/canary/shas/707a938e536cb921dbe80ee270c431d1b9717e38.tgz",
"ember-decorators": "5.1.4",

All ES6 classes are affected it looks like; doesn't matter what Ember class it extends from (EmberObject, Route, Controller, Service, and Component are the ones I've run into it with)

from ember-decorators.

pzuraq avatar pzuraq commented on June 3, 2024

@pgrippi can you provide the version of @ember-decorators/babel-transforms you are using? And if it’s not too much trouble, the code of the class itself? That would help a bit in figuring this out

from ember-decorators.

pgrippi avatar pgrippi commented on June 3, 2024

Sure, I'm using (figure it can't hurt to throw the babel version in too):

"@ember-decorators/babel-transforms": "5.1.4"
"ember-cli-babel": "7.6.0"

As for the code, the simplest case is in my application route:

import Route from '@ember/routing/route';
import { inject as service } from '@ember-decorators/service';

export default class ApplicationRoute extends Route {
  @service router;

  init() {
    super.init(...arguments);

    this.router.on('routeDidChange', () => {
      console.debug('route did change');
    });
  }
}

from ember-decorators.

pzuraq avatar pzuraq commented on June 3, 2024

alright, I'll see if I can get a reproduction going. For reference, you should be using the stage 1 versions of the transforms:

"@ember-decorators/babel-transforms": "2.1.2"

We're working on baking these into ember-cli at the moment, I realize this is confusing. If you use the stage 1 transforms, do you have the same problem?

from ember-decorators.

pgrippi avatar pgrippi commented on June 3, 2024

Is there anything else I have to do to use stage 1 other than downgrading @ember-decorators/babel-transforms to 2.1.2? After downgrading to 2.1.2 I still see the issue

from ember-decorators.

pzuraq avatar pzuraq commented on June 3, 2024

I believe this should be fixed on the latest ember-decorators, with the polyfill. Let us know if not!

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.