Code Monkey home page Code Monkey logo

Comments (11)

pzuraq avatar pzuraq commented on June 11, 2024

You should not be calling super.constructor(), you should be calling super(). Unsure if that's what's causing the issue.

from ember-classic-decorator.

Techn1x avatar Techn1x commented on June 11, 2024

You should not be calling super.constructor(), you should be calling super(). Unsure if that's what's causing the issue.

Sorry - that was just a mistake in the example, I've edited the post to fix that.

from ember-classic-decorator.

Techn1x avatar Techn1x commented on June 11, 2024

@pzuraq This is now a more annoying problem, and I'm not totally sure what to do about it. It's not a "debug only" problem anymore

I have some native class adapters, that don't use or need the classic decorator. They also don't have any constructor hooks or anything. They extend JSONAPIAdapter. It looks like ember-data's base adapter now extends from EmberObject, so I end up with error messages like this;

Screenshot from 2022-01-18 15-33-20

https://github.com/emberjs/data/blob/0a8e0a4d1c2f99b707dc565eb555c446f099d4fa/packages/adapter/addon/index.ts#L205

from ember-classic-decorator.

Techn1x avatar Techn1x commented on June 11, 2024

It seems that removing the name from a class works for some reason that I don't understand, which is a little concerning..

errors

// some-adapter.js
import JSONAPIAdapter from '@ember-data/adapter/json-api'

export default class SomeAdapter extends JSONAPIAdapter {}

works

// some-adapter.js
import JSONAPIAdapter from '@ember-data/adapter/json-api'

export default class extends JSONAPIAdapter {}

from ember-classic-decorator.

pzuraq avatar pzuraq commented on June 11, 2024

This library is meant to be transitional, you should work to remove it from your codebase and convert asap. I'm not longer maintaining it as I don't have the time and most people have already worked through the transition.

from ember-classic-decorator.

Techn1x avatar Techn1x commented on June 11, 2024

No worries. I realise I'm a little behind in some transitional work in my codebases (though, we are on Ember 3.28 LTS, and I was under the impression that this addon would attempt to facilitate classic classes up until 4.0)

I'm not sure what the implications are of using native classes for adapters and serializers that extend from from ember-data's that are now based on EmberObject. Hopefully nothing major and I can safely ignore these errors.... (though It's unfortunate that I cannot actually turn them off)

I'll apply my above workaround of removing the class name, which I am guessing is a bug that allows a class to skip ember-classic-decorator's checks, and sit tight to see if anyone else hits this issue.

I appreciate your time in reading my comments!

from ember-classic-decorator.

Techn1x avatar Techn1x commented on June 11, 2024

Another workaround we have found is to pin ember-classic-decorator to 2.0.0 as a yarn resolution. 2.0.1 seems to bring the problems back. This is a suitable workable solution for now 👍

from ember-classic-decorator.

Techn1x avatar Techn1x commented on June 11, 2024

Still an issue on ember-classic-decorator v3.0.1 - was hoping the updates would fix it.

Remaining locked to v2 for now

from ember-classic-decorator.

sreeram-cv avatar sreeram-cv commented on June 11, 2024

@Techn1x We are facing the same issue, but locking the ember-classic-decorator to 2.0.0 also did not help. we are using 3.28.11 version of ember-data. can you let me know the version of ember-data for which locking ember-classic-decorator to 2.0.0 fixed the issue?

from ember-classic-decorator.

Techn1x avatar Techn1x commented on June 11, 2024

Sorry! This was a while ago, so I am not sure. It is likely we were using ember-data 3.28 at the time as well.

from ember-classic-decorator.

sreeram-cv avatar sreeram-cv commented on June 11, 2024

Sorry! This was a while ago, so I am not sure. It is likely we were using ember-data 3.28 at the time as well.

ohh.. okay thanks

from ember-classic-decorator.

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.