-
Notifications
You must be signed in to change notification settings - Fork 28
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
Assure gts works #206
Assure gts works #206
Conversation
@@ -86,6 +86,18 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) { | |||
'template-registry.js.map', | |||
]); | |||
|
|||
expect(distContents.hashed.length).toBe(4); | |||
expect( |
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.
if anyone knows of a more ergonomic way to do this, I'm all ears
@@ -0,0 +1,3 @@ | |||
import templateOnly from '@ember/component/template-only'; |
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 file is needed so that Glint knows what type the hbs file is.
In TS, we cannot have bare-hbs-file-components.
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 🎉
Just have some questions about the test changes here...
@@ -86,6 +86,18 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) { | |||
'template-registry.js.map', | |||
]); | |||
|
|||
expect(distContents.hashed.length).toBe(4); |
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.
Why is it 4, and is this necessarily the case? Or are we assuming rollup implementation details here, and potentially making the test brittle?
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.
rollupSomething js + map
template-only js + map
Previously the rollup files were filtered out
I do not believe the test would become brittle (all 4 files have hashes in their names, so I can't directly check what their file names are)
distContents.hashed | ||
.filter(file => file.includes('template-only')) | ||
.map(file => file.split('.js')[1]) | ||
).to.deep.equal(["", '.map'], 'the template-only component is emitted with a source map'); |
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.
Are these additional assertions related to gts support? Or why are they in this PR?
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.
For the template-only file, it was previously un-asserted.
Since the import path changed (by adding an extension), I thought it might be good to assure the template-only component is in the dist output.
🤷
Supersedes: #199
Resolves: #196
.gts
extensions typed-ember/glint#618