-
-
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
[BUGFIX beta] Deprecate {{view "string"}} and special case {{view "select"}} #11418
Conversation
Looks like this needs a rebase. |
4559b82
to
7d9d02b
Compare
@rwjblue Rebased and made a few changes. Updated the description above with notes. Because the |
cc @mixonic |
@@ -55,7 +55,7 @@ function deprecatePaths(moduleName, node, paths) { | |||
} | |||
|
|||
function deprecatePath(moduleName, node, path) { | |||
Ember.deprecate(`Using \`{{${path && path.type === 'PathExpression' && path.parts[0]}}}\` or any path based on it ${calculateLocationDisplay(moduleName, node.loc)}has been deprecated.`, !(path && path.type === 'PathExpression' && (path.parts[0] === 'view' || path.parts[0] === 'controller')), { url: 'http://emberjs.com/deprecations/v1.x#toc_view-and-controller-template-keywords', id: 'view-controller-keyword' }); | |||
Ember.deprecate(`Using \`{{${path && path.type === 'PathExpression' && path.parts[0]}}}\` or any path based on it ${calculateLocationDisplay(moduleName, node.loc)}has been deprecated.`, !(path && path.type === 'PathExpression' && (path.parts[0] === 'view' || path.parts[0] === 'controller')), { url: 'http://emberjs.com/deprecations/v1.x#toc_view-and-controller-template-keywords', id: (path.parts && path.parts[0] === 'view' ? 'view.keyword.view' : 'view.keyword.controller') }); |
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.
this ensures that {{view}}
keyword gets a deprecation id of view.keyword.view
and {{controller}}
keyword gets a different deprecation id of view.keyword.controller
.
I am working on this... |
after discussion with @mixonic I am going to make a quick change to make it so |
waiting on emberjs/ember-dev#153 |
7d9d02b
to
267d6b9
Compare
And this is now ready to go. It updates the bower dep to point at updated cc @rwjblue thanks for your patience |
} | ||
|
||
return noDeprecate; | ||
}, { url: 'http://emberjs.com/deprecations/v1.x#toc_view-and-controller-template-keywords', id: (path.parts && path.parts[0] === 'view' ? 'view.keyword.view' : 'view.keyword.controller') }); |
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.
being able to expectDeprecation
with this function is the part that needed this update to ember-dev
…lect"}} Use a template-compiler plugin to detect `{{view "string"}}` at compile-time and issue a deprecation with location information. Has a special case deprecation when the string === "select". Removes a test from the view helper tests that was checking for the deprecation at runtime (and removes the associated code in the ember-htmlbars package's `keywords/view`). Note: This does not catch a deprecation when the path is not a string, e.g., `{{view view.someProperty}}`, however emberjs#11401 would catch and issue a deprecation message for that case (at runtime). Also a few changes to deprecations: * document `id` param to `Ember.deprecate` * include deprecation id in log/error message * Use dot-namespaced deprecation ids (more similar to how `instrument` works and paves the way to in the future changing deprecation log levels by paths ie `"view.*"`) * globally silence view-related deprecations in tests to avoid overflowing travis ci's log * update ember-dev dep in bower (pr: emberjs/ember-dev#153) to `a064f0cd2f4c225ffd023b63d4cb31a79db04aaf` * change the view-and-controller-path template compiler plugin to always deprecate `{{controller}}` * change the view-and-controller-path template compiler plugin to skip deprecating `{{view}}` when `Ember.ENV._ENABLE_LEGACY_VIW_SUPPORT` is true refs emberjs#11377
267d6b9
to
c2bcc86
Compare
[BUGFIX beta] Deprecate {{view "string"}} and special case {{view "select"}}
🎉 |
ember-cli-htmlbars@0.7.9 has been published with the required ability to propagate |
thanks! Added an issue to update ember-legacy-views to mention this |
Use a template-compiler plugin to detect
{{view "string"}}
at compile-timeand issue a deprecation with location information. Has a special case
deprecation when the string === "select".
Removes a test from the view helper tests that was checking for the
deprecation at runtime (and removes the associated code in
the ember-htmlbars package's
keywords/view
).Note: This does not catch a deprecation when the path is not a string,
e.g.,
{{view view.someProperty}}
, however #11401 would catch and issuea deprecation message for that case (at runtime).
Other changes:
id
param toEmber.deprecate
instrument
works and paves the way to in the future changing deprecation log levels by paths ie"view.*"
)expectDeprecation
whentest
parameter is a function ember-dev#153) toa064f0cd2f4c225ffd023b63d4cb31a79db04aaf
{{controller}}
{{view}}
whenEmber.ENV._ENABLE_LEGACY_VIW_SUPPORT
is truerefs #11377