Code Monkey home page Code Monkey logo

Comments (6)

kategengler avatar kategengler commented on June 11, 2024 1

Yes, I believe you can remove it. As you say, newly generated apps do not have ember-classic-decorator but also have working JSONAPIAdapters.

from ember-classic-decorator.

kategengler avatar kategengler commented on June 11, 2024

I just encountered this on 3.28 with 3.0 of classic decorator for adapters. I followed the trail back into ember-data and JSONAPIAdapter extends RestAdapter which includes a mixin, so it seems to be correct for that case. Have you followed your ApplicationSerializer inheritance back?

from ember-classic-decorator.

donaldsonjulia avatar donaldsonjulia commented on June 11, 2024

@kategengler I have also just experienced this when extending from my ApplicationAdapter which extends from JSONAPIAdapter. Strangely I don't get the error on ApplicationAdapter extending from JSONAPIAdapter, but I do get the error when I extend from ApplicationAdapter.

I also followed the trail back and I see what you are saying about RestAdapter and the mixin....so are you suggesting that this is expected behavior? The only reason it seems odd to me is that we are using "ember-data": "~4.4.0" with "ember-source": "~4.4.0" and in new CLI outputs for 4.4.0, the classic decorator package is not included. It seems odd to have an app-breaking error in this case. If I reduce all other usage of the @classic decorator to this one instance in my app, do I have to keep using it until another version of Ember Data is released?

Thanks so much for your help in clarifying!

from ember-classic-decorator.

kategengler avatar kategengler commented on June 11, 2024

I don't believe ember-classic-decorator was ever default (ever in the blueprints).

I believe that when using this addon, that error is correct and the @classic decorator is warranted, because it is ultimately a classic-style class.

If you don't have this addon in your app, this error should not occur and everything should work, since this addon is dev-only and for guidance upgrading only.

I cannot explain why it doesn't happen in the ApplicationAdapter.

from ember-classic-decorator.

kategengler avatar kategengler commented on June 11, 2024

@emberjs/ember-data-core any ideas?

from ember-classic-decorator.

donaldsonjulia avatar donaldsonjulia commented on June 11, 2024

Thanks so much!! I think my main confusion was that our upgrade path was to reduce the usage of ember-classic-decorator to zero without errors before finally removing it as a dependency.

Just to extra confirm for anyone else stumbling on this issue: Are you saying that if this is the last instance in our app where the error is thrown (because of extending framework-supplied JSONAPIAdapter and JSONAPISerializer), we can safely remove the addon altogether? From a consumer standpoint, we don't need to care about the inheritance back to RestAdapter being classic and we can write code using only Octane/native-class syntax? (Assuming we are using the public APIs and not being hacky with internals)

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.