-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Avoid modifier manager capabilities deprecation #13
Conversation
e594721
to
e5c4c40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this! I left a small suggestion / tweak (so we can use the official public APIs), but otherwise this is great!
addon/modifiers/did-insert.js
Outdated
@@ -1,4 +1,4 @@ | |||
import Ember from 'ember'; | |||
import { setModifierManager, capabilities } from '../modifier'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind updating to [email protected]
so we can remove this (and the underscored _setModifierManager
usage over in addon/modifier.js
) in favor of:
import { setModifierManager, capabilities } from '@ember/modifier';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue I may be way off here, but it looks like that doesn't work prior to canary because of a typo introduced in 3.7 that was fixed in:
emberjs/ember.js@b8a5633#diff-c424149274ab88ce43f2847da12c5ce0L531
It was exported under the global as Ember._modifierManagerCapabilties
(missing "i" before "ties") so I'm thinking the mapping doesn't work until that commit...? I'm not sure how to address this other than the intermediary file solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😩 - Ya, good point
Addresses deprecation `implicit-modifier-manager-capabilities`: Custom modifier managers must define their capabilities using the capabilities() helper function
e5c4c40
to
9f7d80d
Compare
I attempted to copy this PR to my addon ember-oo-modifiers and I keep getting an error:
I checked and my yarn resolves ember-modifier-manager-polyfill at |
@sukima I believe you need to make sure you have |
addon/modifiers/did-insert.js
Outdated
@@ -1,4 +1,4 @@ | |||
import Ember from 'ember'; | |||
import { setModifierManager, capabilities } from '../modifier'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😩 - Ya, good point
confirm |
@sukima is right, https://github.com/emberjs/ember.js/blob/master/packages/%40ember/modifier/index.ts is still exported with a typo @pzuraq sorry to tag you here – not sure if you missed out the above typo correction in emberjs/ember.js@b8a5633 or if it was intentionally left as such. Also if you have any alternative ideas how best to support 3.7 (with typo) until your commit (see: #13 (comment)) that would help! |
@wongpeiyi you are correct, that was missed, but it shouldn't affect public consumers. That file is not what ultimately gets exported and used currently, there is a babel transform that will convert usages of |
I'm aware of that, it was a side observation that just came up in the earlier comments 😃
This is the bigger issue... The import does work in canary, but not from 3.7 until before your commit unless we also have a babel transform that maps |
FYI - The build failed due to a package bumping to Node 8 only deps without a major version bump, that was just fixed (SBoudrias/Inquirer.js#837) and our CI should be 👍 again. I've restarted the floating dependencies job here to confirm. |
RE: the typo, we should probably backport the typo fix to 3.8 and 3.12 so it's less of an issue over time (@wongpeiyi would you mind making an issue in Ember for that?) |
Working on making the extra |
[email protected] includes support for ensuring `import { capabilities } from '@ember/modifier'` works back to 2.12 (hiding the typo issue).
OK, @wongpeiyi I've pushed a commit that updates to [email protected] which ensures that |
Released in v1.0.1. |
Thanks @rwjblue that was quick
Am I right in assuming that issue is not needed anymore? |
Yes, I just hadn't thought of fixing in the polyfill at the time (but once I did, it seemed obviously better). Thank you again! |
Not sure if this is desirable but I encountered deprecation
implicit-modifier-manager-capabilities
: https://github.com/emberjs/ember.js/blob/master/packages/%40ember/-internals/glimmer/lib/modifiers/custom.ts#L141-L148 recently added to master, so sought to address itCreated an intermediary exports file to support older versions of Ember where
_modifierManagerCapabilities
is not exported