-
-
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] internal templates should be strictMode #20603
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { precompileTemplate } from '@ember/template-compilation'; | ||
export default precompileTemplate('', { | ||
moduleName: 'packages/@ember/-internals/glimmer/lib/templates/empty.hbs', | ||
strictMode: true, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
import { precompileTemplate } from '@ember/template-compilation'; | ||
export default precompileTemplate(`{{component (-outlet)}}`, { | ||
import { outletHelper } from '../syntax/outlet'; | ||
|
||
export default precompileTemplate(`{{component (outletHelper)}}`, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was one of the problematic cases. In loose mode, this could resolve a string into a component, which would be unsafe to optimize. In strict mode that kind of resolution is forbidden, so embroider can tell this is safe. |
||
moduleName: 'packages/@ember/-internals/glimmer/lib/templates/outlet.hbs', | ||
strictMode: true, | ||
scope() { | ||
return { outletHelper }; | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { precompileTemplate } from '@ember/template-compilation'; | ||
export default precompileTemplate(`{{component this}}`, { | ||
moduleName: 'packages/@ember/-internals/glimmer/lib/templates/root.hbs', | ||
strictMode: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Notice that this benefits from being strictMode and does not need anything from scope. Hence the type declaration change in this PR. |
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ registerWaiter = testingNotAvailableMessage; | |
unregisterHelper = testingNotAvailableMessage; | ||
unregisterWaiter = testingNotAvailableMessage; | ||
|
||
export function registerTestImplementaiton(impl: typeof EmberTesting) { | ||
export function registerTestImplementation(impl: typeof EmberTesting) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is newly-added private API appearing for the first time in this beta. Seems a good time to fix my typo. |
||
let { Test } = impl; | ||
registerAsyncHelper = Test.registerAsyncHelper; | ||
registerHelper = Test.registerHelper; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from './lib/public-api'; | ||
import * as EmberTesting from './lib/public-api'; | ||
import { registerTestImplementaiton } from '@ember/test'; | ||
import { registerTestImplementation } from '@ember/test'; | ||
|
||
registerTestImplementaiton(EmberTesting); | ||
registerTestImplementation(EmberTesting); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 one was not a problem, I just updated all of them to strict mode because why not?