Giter VIP home page Giter VIP logo

Comments (6)

snewcomer avatar snewcomer commented on June 25, 2024 1

with custom macros, that raise a deprecation, when accessed. This allows users to discover and migrate all the callsites accidentally relying on these implicit injections bit by bit

I think we already did this for users in ember-source >= 3.26

emberjs/ember.js#19358

from ember-useragent.

snewcomer avatar snewcomer commented on June 25, 2024

hi! Ping on this.

specifically, ember v4.0 will not work with this pattern.

emberjs/ember.js#19680

from ember-useragent.

buschtoens avatar buschtoens commented on June 25, 2024

It is unquestionable, that these implicit injections will have to be removed eventually due to emberjs/ember.js#19680. Thus I recommend that anyone wanting to or currently using this addon, overrides https://github.com/willviles/ember-useragent/blob/master/app/initializers/user-agent.js in their own app with a no-op, like:

// app/initializers/user-agent.js
export function initialize() {}

This way the implicit injections are already disabled and you can't accidentally make use of them. Please note, that if you're making this change in an app that already uses ember-useragent, you should regression test it to ensure, you haven't already used these implicit injections accidentally.

from ember-useragent.

buschtoens avatar buschtoens commented on June 25, 2024

As a way forward for ember-useragent itself, I would recommend to replace the application.inject(...) usages with custom macros, that raise a deprecation, when accessed. This allows users to discover and migrate all the callsites accidentally relying on these implicit injections bit by bit.

Optionally configuration could be included, to completely disable the injection, which should be recommended to be enabled by all new users. This way the breaking release can be delayed indefinitely, all the while being ready for Ember 4.0.

from ember-useragent.

buschtoens avatar buschtoens commented on June 25, 2024

@snewcomer perfect, thanks! I wasn't sure any more and didn't re-read.

from ember-useragent.

willviles avatar willviles commented on June 25, 2024

Released in 0.11.0. Thanks for all contributions!

from ember-useragent.

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.