Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{{with}} deprecation from ember-basic-dropdown v3 #272

Open
gorner opened this issue Jan 4, 2023 · 2 comments · May be fixed by #273
Open

{{with}} deprecation from ember-basic-dropdown v3 #272

gorner opened this issue Jan 4, 2023 · 2 comments · May be fixed by #273

Comments

@gorner
Copy link

gorner commented Jan 4, 2023

This add-on currently depends on ember-basic-dropdown (EBD) v3, which uses the {{with}} helper which is deprecated (and raises a build-time warning) in Ember v3.26+ and removed in Ember v4.0.

Currently working in an app (which we are slowly working towards upgrading to Ember v4) that directly depends on EBD v6 for other reasons and this package doesn't seem to conflict with it (apart from still raising the warning). Would be willing to submit a PR to update to ember-basic-dropdown v6 (which supports Ember v3.28+), or alternatively allow this package to accept a range of acceptable versions of EBD.

@gorner
Copy link
Author

gorner commented Jan 9, 2023

I looked into this update this weekend and discovered a bunch of other updates that seemed to be required to ensure compatibility with newer versions of Ember. With that caveat, I got most things working, except for the Embroider runs of ember-try, which gave me a lot of errors along the lines of TypeError: _externals_moment__WEBPACK_IMPORTED_MODULE_1__.isMoment is not a function which didn't work even if I tried things like import { isMoment } from 'moment'. Apart from that attempt, however, I didn't need to touch any of the add-on code itself.

If anyone's curious, this is my working branch: https://github.com/gorner/ember-date-components/tree/update-ember-basic-dropdown-v6

For now, for the app I'm working on, I've realized it'll probably be sufficient to just specify ember-basic-dropdown v6 in npm overrides (or equivalently yarn resolutions).

Edit: I've tried a couple of other things since then (including moving Moment to dependencies) to no avail. But on review, it looks like the current release may not work with Embroider either? Perhaps I will just go ahead and create the PR.

@gorner
Copy link
Author

gorner commented Mar 25, 2024

For now, for the app I'm working on, I've realized it'll probably be sufficient to just specify ember-basic-dropdown v6 in npm overrides (or equivalently yarn resolutions).

Just a heads-up for anyone else using this workaround, it also worked with EBD v7 but does not work with EBD v8+ due to its conversion to the v2 addon format:

Error: ember-date-components needs to depend on ember-auto-import in order to use ember-basic-dropdown
    at Class.registerV2Addon (<app_path>/node_modules/@embroider/addon-shim/src/index.js:122:27)
    at Class.included (<app_path>/node_modules/@embroider/addon-shim/src/index.js:42:18)
    at Class.superWrapper [as included] (<app_path>/node_modules/core-object/lib/assign-properties.js:34:20)
    at <app_path>/node_modules/ember-cli/lib/models/addon.js:497:26
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (<app_path>/node_modules/ember-cli/lib/models/addon.js:494:24)
    at Class.included (<app_path>/node_modules/ember-cli/lib/models/addon.js:769:10)
    at Class.superWrapper [as included] (<app_path>/node_modules/core-object/lib/assign-properties.js:34:20)
    at Class.included (<app_path>/node_modules/ember-date-components/index.js:9:26)
    at Class.superWrapper [as included] (<app_path>/node_modules/core-object/lib/assign-properties.js:34:20)
    at <app_path>/node_modules/ember-cli/lib/broccoli/ember-app.js:653:15
    at Array.forEach (<anonymous>)
    at EmberApp._notifyAddonIncluded (<app_path>/node_modules/ember-cli/lib/broccoli/ember-app.js:651:25)
    at new EmberApp (<app_path>/node_modules/ember-cli/lib/broccoli/ember-app.js:137:10)
    at module.exports (<app_path>/ember-cli-build.js:60:13)
    at Builder.readBuildFile (<app_path>/node_modules/ember-cli/lib/models/builder.js:49:14)
    at Builder.setupBroccoliBuilder (<app_path>/node_modules/ember-cli/lib/models/builder.js:63:22)
    at new Builder (<app_path>/node_modules/ember-cli/lib/models/builder.js:29:10)
    at ServeTask.run (<app_path>/node_modules/ember-cli/lib/tasks/serve.js:49:7)
    at <app_path>/node_modules/ember-cli/lib/models/command.js:238:24
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Class.run (<app_path>/node_modules/ember-cli/lib/commands/serve.js:106:5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant