Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: provide html.partial and css.partial as standalone tagged template literals #6961

Open
radium-v opened this issue May 15, 2024 · 0 comments
Labels
area:fast-element Pertains to fast-element feature A new feature status:under-consideration Issue is being reviewed by the team.

Comments

@radium-v
Copy link
Collaborator

馃檵 Feature Request

It would be very convenient to provide the html.partial() and css.partial methods as tagged template literal functions. Perhaps both the methods and the tagged template literal functions could coexist:

// Since `css.partial` is already a TTL, it can be reflected
export const cssPartial = css.partial;

// `html.partial` only accepts one string so it has to be transformed
export const htmlPartial = (strings: TemplateStringsArray, ...values: any[]) => html.partial(strings[0]);

馃敠 Context

The css.partial and html.partial() methods can't be compressed at build-time with most tagged template literal optimization methods, which usually work by identifying a tagged template literal via an AST. Our current solution is a rollup plugin which accepts an array of tags to optimize, but the AST implementation only sees partial and not the full css.partial or html.partial.

@radium-v radium-v added the status:triage New Issue - needs triage label May 15, 2024
@janechu janechu added area:fast-element Pertains to fast-element feature A new feature status:under-consideration Issue is being reviewed by the team. and removed status:triage New Issue - needs triage labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-element Pertains to fast-element feature A new feature status:under-consideration Issue is being reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants