-
Notifications
You must be signed in to change notification settings - Fork 1k
[infra][lit-labs/compiler] lit-html tests are now also compiled and tested #4102
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
Conversation
🦋 Changeset detectedLatest commit: a888ebf The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummary⏳ Benchmarks are currently running. Results below are out of date. nop-update
render
update
update-reflect
Results⏳ Benchmarks are currently running. Results below are out of date. this-change
render
update
update-reflect
this-change, tip-of-tree, previous-release
render
update
nop-update
this-change, tip-of-tree, previous-release
render
update
this-change, tip-of-tree, previous-release
render
update
update-reflect
|
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.
Should this file actually be in packages/lit-html and we add @lit-labs/compiler to it as dev dependency? It is called from, and its output present in, packages/lit-html.
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 compatibility with the 2.0 branch and 3.0 branch we cannot do this because lit-html uses TypeScript 4.x.
Thus any usage of the compiler from lit-html results in the transformer crashing because the TypeScript version is wrong.
I'd like to do what you suggest, but currently it's not possible except in the 3.0 branch. This is a temporary compromise to get runtime tests in.
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.
Aha, right. I saw that note but totally glanced over the fact that the TS import would be project dependent. Thanks for clarifying!
augustjk
left a comment
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.
Excellent!
rictic
left a comment
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.
excellent!
Issue: #189
RFC: lit/rfcs#21
Full prototype PR: #3984
Context
This is an infrastructure only, and test-only change. No user facing impact.
It does change some lit-html tests, but only slightly such that they can test both uncompiled & compiled templates.
Specifically, any tests that explicitly tested detection of uncompiled templates, need to handle the whole file being compiled.
The compiler also strips markers from comments which required one test to be updated.
Features
test/directory.lit-labs/compiler) so we can compile thelit-html/testdirectory (and not run into a TS version issue if lit-html was housing the transform).test:dev:compiled.compiled/test path can be tested.Test plan
This whole PR is a test plan ensuring robust tests for the lit-labs/compiler transform.
It proves that the compiler gracefully handles all the edge cases we test in the lit-html tests.
Future consideration
Note that in the future when the whole repo is on TS 5.x, we'll be able to use a rollup config to compile the tests instead of a script in the compiler package.
Thank you so much!