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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine how FASTStyle and Command Buffering client code gets exposed #5908

Open
nicholasrice opened this issue Apr 27, 2022 · 1 comment
Open
Labels
area:ssr Pertains to SSR. improvement A non-feature-adding improvement status:needs-investigation Needs additional investigation
Milestone

Comments

@nicholasrice
Copy link
Contributor

SSR has two features that require client-side JavaScript code to be executed prior to custom element parsing on the client;

  1. The FASTStyle custom element
  2. command-buffering custom element

For both of these features, we need to decide how exactly to expose the JavaScript for those features. The JavaScript will need to be emitted to a <script> element in the page response / resulting HTML.

Emit from TemplateRenderer.render()
A naive approach would be to emit the code when configured whenever TemplateRenderer.render() is called. However, this would limit implementations to only invoking TemplateRenderer.render() oncer per page request, otherwise duplicating the script code which would cause client side errors from defining the same element multiple times.

Require authors to write the <script> into the template / page response
@microsoft/fast-ssr can expose the script content as a string. With that, authors can write that script content into their template, or otherwise ensure it is sent appropriately with the request response. At this point this is the approach I would prefer but I'm open to other ideas or ways to improve.

@nicholasrice nicholasrice added status:triage New Issue - needs triage area:ssr Pertains to SSR. labels Apr 27, 2022
@nicholasrice nicholasrice added this to the SSR Future milestone Apr 27, 2022
@EisenbergEffect EisenbergEffect added improvement A non-feature-adding improvement status:needs-investigation Needs additional investigation and removed status:triage New Issue - needs triage labels Apr 27, 2022
@prudepixie prudepixie self-assigned this Jul 28, 2022
@prudepixie prudepixie moved this from Triage to In Progress in FAST Architecture Roadmap Jul 28, 2022
@prudepixie
Copy link
Contributor

discussion on typescript minification microsoft/TypeScript#8

@prudepixie prudepixie moved this from In Progress to Todo in FAST Architecture Roadmap Aug 8, 2022
@prudepixie prudepixie moved this from Todo to Backlog in FAST Architecture Roadmap Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ssr Pertains to SSR. improvement A non-feature-adding improvement status:needs-investigation Needs additional investigation
Projects
Status: Backlog
Development

No branches or pull requests

3 participants