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

TeX SSR #150

Closed
wants to merge 4 commits into from
Closed

TeX SSR #150

wants to merge 4 commits into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Nov 11, 2023

(still very drafty; I did not regenerate the build tests)

closes #141 for TeX

#153 does a similar thing for DOT.

TODO:

  • A difficulty is to know when it's safe to do SSR, i.e. detect if there is interpolation. The hack I'm using for TeX probably doesn't work for DOT. A consolidated approach would be better.

@Fil Fil requested a review from mbostock November 11, 2023 15:10
@Fil Fil changed the title first stab at inline SSR TeX first stab at TeX SSR Nov 11, 2023
@Fil Fil changed the title first stab at TeX SSR TeX SSR Nov 11, 2023
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should detect tex, and in particular SSR-able tex, by parsing rather string matching or trying to compile and detecting an error. This means using the TemplateParser in tag.js, and then if that succeeds, checking that there are no interpolations.

In the case of inline expressions, it means parsing the expression and likewise checking that it’s a tagged template literal with no interpolations. (And ideally that tex isn’t defined elsewhere in the notebook.) But I think it might even be preferred to not support SSR for inline expressions yet so that we can think about a stronger signal that the user can control to opt-in or opt-out of SSR.

Perhaps we also need to think a bit more generally about how we might SSR JavaScript and HTML and other things too…

@Fil Fil mentioned this pull request Nov 23, 2023
@Fil Fil mentioned this pull request Dec 3, 2023
@Fil Fil closed this Feb 2, 2024
@Fil
Copy link
Contributor Author

Fil commented Feb 2, 2024

superseded by #413

@Fil Fil deleted the fil/static-tex branch February 2, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server-side render static DOT and TeX?
2 participants