-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(engine): inline styles to support native shadow
fix(engine): integration test feat(compiler): inline styles to support native shadow (#691) Add compiler changes required for the shadow DOM injection of the stylesheet. The CSS transformer now attach to the template an object with 3 properties: * `hostAttribute` - the attribute to apply to the host element * `shadowAttribute` - the attribute to apply to the shadow elements * `factory` - a function accepting a `hostSelector` and a `shadowSelector` to apply to the styles. Note the difference in naming, `hostAttribute` is the attribute name, while the factory excepts a selector `[attr]`. This changes is necessary to be able to generate at runtime both native and synthetic shadow compatible stylesheets. Changes: * Make changes to the CSS transform, it nows accepts 2 parameters a `hostSelector` and a `shadowSelector`. * Update the compiler produce the new `Stylesheet` format for runtime consumption * Update references to `styleToken` in the engine code to `styleAttribute` to better match the actual purpose * [ ] Yes * [X] No - as long as nobody is invoking the CSS transform manually since it's signature changed fix: removed file missed during squash
- Loading branch information
Showing
43 changed files
with
1,091 additions
and
977 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
2 changes: 1 addition & 1 deletion
2
packages/lwc-compiler/src/__tests__/fixtures/expected-minify-no-comments.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
packages/lwc-compiler/src/__tests__/fixtures/expected-node-env-dev.js
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
10 changes: 0 additions & 10 deletions
10
packages/lwc-compiler/src/__tests__/fixtures/expected-node-env-prod.js
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
2 changes: 1 addition & 1 deletion
2
packages/lwc-compiler/src/__tests__/fixtures/expected-prod_compat-mode.js
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
2 changes: 1 addition & 1 deletion
2
packages/lwc-compiler/src/__tests__/fixtures/expected-styled-prod.js
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
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
Oops, something went wrong.