Skip to content

Conversation

@mkszepp
Copy link
Collaborator

@mkszepp mkszepp commented Nov 30, 2025

ember-basic-dropdown internally uses getOwner(this).resolveRegistration('config:environment') to read configuration for its destination setting and the app’s rootElement (useful for tests).

However, using resolveRegistration inside a V2 addon is considered bad practice and doesn't play well with some vite setups today (like storeConfigInMeta: false). This requirement was accidentally left out of the V2 addon RFC.

If an addon needs configuration from the consuming app, the addon must expose an API such as setConfig() instead of calling resolveRegistration.

How to opt out of the deprecation warning

Add the following snippet to your app.js or app.ts:

import config from './config/environment'; // this line should already be present
import { setConfig } from 'ember-basic-dropdown/config';

setConfig({
  rootElement: config.APP.rootElement
});

If you have overridden the dropdown’s global destination

If your config/environment.js contains something like:

const ENV = {
  ...
  'ember-basic-dropdown' : {
    destination: 'globalDestinationOverride'
  }
  ...
};

then you must also pass this value to setConfig:

import config from './config/environment'; // this line should already be present
import { setConfig } from 'ember-basic-dropdown/config';

setConfig({
  destination: 'globalDestinationOverride',
  rootElement: config.APP.rootElement
});

After using setConfig you can safely remove the settings in config/environment.js

@mkszepp mkszepp merged commit 187002d into master Nov 30, 2025
23 checks passed
@mkszepp mkszepp deleted the add-config-and-deprecate-environment-config branch November 30, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants