-
Notifications
You must be signed in to change notification settings - Fork 923
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
[lit-labs/compiler] Logic for compiling templates containing ChildParts #4047
Conversation
Note: This implementation has intentionally been simplified to make reviewing easier. Attribute part handling, uncompiled files, and many other subtleties have been skipped but will be added in followup.
🦋 Changeset detectedLatest commit: 2c328f5 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 ResultsSummaryA summary of the benchmark results will show here once they finish. ResultsThe full results of your benchmarks will show here once they finish. |
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.
Great work, this is looking really good!
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.
Nice! Just a couple minor notes.
Thank you! |
Issue: #189
RFC: lit/rfcs#21
Full prototype PR: #3984
Note to reviewer: Review this commit by commit – and skip reviewing
parse5-utils
cause I deleted it after feedback from @43081j.Context
This PR splits out some initial compiler behavior from the full prototype PR in a reviewable chunk. This PR adds the core functionality that can be built upon in followup changes (and have been de-risked in the prototype).
Features
ChildPart
s. Other template parts such as attribute and element parts will be included in a followup.This is a private only change, and no public entrypoints are being added.
In my opinion, the best place to start the review is at the
CompiledTemplatePass.getTransformer()
function which contains the high level flow of the transform:CompiledTemplatePass
instance.CompiledTemplate
s and replacinghtml
tagged templates withCompiledTemplateResult
s.Testing
Tests are contained in the
test_files
directory. Each*.js
or*.ts
has a compiled*.golden.js
which can be generated vianpm run update-goldens
, and contains the expected generated output.The test files included in this change are a subset of the tests in the prototype PR which pass with this change.
Risk
There is minimal risk to merging this PR if GitHub actions succeed. Risk is reduced because
lit-labs/compiler
is a private package and not published to NPM yet.Thank you