-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[WIP] deprecate view registry #17804
base: main
Are you sure you want to change the base?
Conversation
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.
Generally 👍, only had one small question
488078a
to
f79c3f3
Compare
f79c3f3
to
0118483
Compare
9316218
to
e00465f
Compare
e00465f
to
3474c44
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.
LGTM
3474c44
to
85a34c0
Compare
The framework does not need it anymore. In most cases, `Ember.ViewUtils.getElementView` can be used as a replacement to get the classic component (`Ember.Component`) that corresponds to a DOM element (if any).
Since the `id` attribute can be passed through splattributes, we cannot assume the generated `elementId` will be used. Instead of eagerly generating an `elementId` (if not set in `init`), we make it as lazy as possible and read from DOM after flushing the attributes. This ensures the value reflects what was eventually set. If, however, an `elementId` is explicitly set during `init`, we want to ensure they match up when `elementId` is accessed again. Note that with this commit, the framework no longer rely on `elementId` for any purpose. We may want to deprecate _reading_ from `elementId`, making it a "write-only" API that only serve to customize the wrapper element.
85a34c0
to
172849e
Compare
Should |
I did review usages on EmberObserver.com and I do not think the limited usage merits intimate API deprecation. The usages in addons that are maintained (releases in the last year or so) are mostly official packages ( |
@chancancode - Should we close, or revive? |
huh yes, I thought we did the elementId fix already.. did we not? |
@chancancode is this still relevant? |
Is this still relevant? It is labeled |
This fixes an issue where event dispatching stops working if
id
is passed with splattributes, becauseelementId
will diverge from the actualid
, causing the element to not be found during event dispatching.This patch does not fix the(It's fixed.)elementId
divergent problem, but changes the framework code to not rely onelementId
and use a weak map instead. I have ideas for fixing theelementId
issue, and making it optional, but I'll probably submit it separately.It's probably best to review this commit-by-commit.
This also removes the view registry private API. The theory is that there are very few addons that uses it, and we can transition them to using the new
Ember.ViewUtils.getElementView
instead.