-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX beta] internal templates should be strictMode
As of #20587, the modules published under `dist/packages` act more like normal addon code, in that their templates are published as calls to `precompileTemplate` rather than wire format. But that makes this the first time that Embroider is seeing these templates, and because they are in loose mode and use the dynamic component helper they are un-analyzable. This PR: - switches them to strict mode - fixes the declared types for `precompileTemplate`, which were a lie before. `scope` is allowed in non-strict mode. `scope` is optional even in strict mode. - fixes a spelling error in a recently-introduced internal method, because I noticed it and it annoyed me.
- Loading branch information
Showing
12 changed files
with
51 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)}}`, { | ||
moduleName: 'packages/@ember/-internals/glimmer/lib/templates/outlet.hbs', | ||
strictMode: true, | ||
scope() { | ||
return { outletHelper }; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters