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

Ember 4.x incompatibility [due to deprecated manager-capabilities.modifiers-3-13] #378

Open
jacobq opened this issue Feb 25, 2022 · 5 comments

Comments

@jacobq
Copy link

jacobq commented Feb 25, 2022

DEPRECATION: Versions of modifier manager capabilities prior to 3.22 have been deprecated. You must update to the 3.22 capabilities. [deprecation id: manager-capabilities.modifiers-3-13] See https://deprecations.emberjs.com/v3.x#toc_manager-capabilities-modifiers-3-13 for more details.

becomes and error in Ember 4.x:
Invalid modifier manager compatibility specified

Repro here: https://github.com/jacobq/repro-ember-did-resize-incompat-with-4x

  1. ember new proj
  2. cd proj
  3. ember install ember-did-resize-modifier
  4. Edit app/templates/application.hbs:
<main {{did-resize this.appAction}}></main>
  1. ember g controller application
  2. Edit app/controllers/application.js:
import Controller from '@ember/controller';
import { action } from '@ember/object';

export default class ApplicationController extends Controller {
  @action
  appAction() {
    console.log(`${Date.now()}: appAction called`);
  }
}
  1. ember s
  2. Open in web browser
  3. Observe error in DevTools/console:
vendor.js:37701 Uncaught Error: Invalid modifier manager compatibility specified
    at modifierCapabilities (vendor.js:37701)
    at _default.setupListener (vendor.js:63292)
    at CustomModifierManager.getDelegateFor (vendor.js:37750)
    at CustomModifierManager.create (vendor.js:37766)
    at Object.evaluate (vendor.js:45056)
    at AppendOpcodes.evaluate (vendor.js:43636)
    at LowLevelVM.evaluateSyscall (vendor.js:47416)
    at LowLevelVM.evaluateInner (vendor.js:47372)
    at LowLevelVM.evaluateOuter (vendor.js:47364)
    at VM.next (vendor.js:48333)
@emoncuso
Copy link

Heads up. I have a feeling this package isn't maintained or monitored anymore. There are a number of unanswered issues/PRs/questions in here.

I'm not an official anything here! Just been watching an issue for awhile!

jacobq added a commit to jacobq/ember-did-resize-modifier that referenced this issue Feb 25, 2022
Ran ember-cli-update (--to 4.1.0)

BREAKING CHANGE: probably broke compat with older node/ember/ember-cli :-/
@jacobq
Copy link
Author

jacobq commented Feb 25, 2022

Heads up. I have a feeling this package isn't maintained or monitored anymore. There are a number of unanswered issues/PRs/questions in here.

I'm not an official anything here! Just been watching an issue for awhile!

Ah, you're probably right...last human commit in the default branch appears about 2 years old:
81fd00d
(no judgment either...that's me on a lot of repos...I get it :/)

I'll see if I can breath a little life into it with a PR/fork, but I just noticed that yarn && ember test fails right now (thanks @dependabot-bot :P):

Build Error (broccoli-persistent-filter:Babel > [Babel: @ember/test-helpers]) in @ember/test-helpers/application.js

[BABEL] /home/user/tmp/ember-did-resize-modifier/@ember/test-helpers/application.js: Cannot find module '@babel/helper-environment-visitor'
Require stack:
- /home/user/tmp/ember-did-resize-modifier/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/conversion.js
- /home/user/tmp/ember-did-resize-modifier/node_modules/@babel/core/node_modules/@babel/traverse/lib/path/index.js
- /home/user/tmp/ember-did-resize-modifier/node_modules/@babel/core/node_modules/@babel/traverse/lib/context.js
- /home/user/tmp/ember-did-resize-modifier/node_modules/@babel/core/node_modules/@babel/traverse/lib/traverse-node.js
- /home/user/tmp/ember-did-resize-modifier/node_modules/@babel/core/node_modules/@babel/traverse/lib/index.js
- /home/user/tmp/ember-did-resize-modifier/node_modules/@babel/core/lib/index.js
- /home/user/tmp/ember-did-resize-modifier/node_modules/broccoli-babel-transpiler/lib/worker.js

I was hoping maybe I could just tweak the version here:

capabilities: capabilities('3.13'),

@jacobq
Copy link
Author

jacobq commented Feb 25, 2022

2 hours later here's what I have 🤣

 export default setModifierManager(
   (owner) => ({
-    capabilities: capabilities('3.13'),
+    capabilities: capabilities('3.22'),
 
     createModifier(factory) {
-      return new factory.class();
+      return new factory();
     },

@jacobq
Copy link
Author

jacobq commented Feb 25, 2022

Fork available in case anyone cares https://github.com/jacobq/ember-did-resize-modifier/tree/jacobq/ember-4x

-    "ember-did-resize-modifier": "^1.0.0",
+    "ember-did-resize-modifier": "jacobq/ember-did-resize-modifier#566bf6ef1f85d727987e06547aab13d323dff254",

jacobq added a commit to jacobq/ember-did-resize-modifier that referenced this issue Feb 25, 2022
@jrjohnson
Copy link

I'd recommend ember-on-resize-modifier as what looks to be a drop in replacement which is compatible with Ember v4.

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

No branches or pull requests

3 participants