Skip to content

Draft: what the JS/HTML template building might look like - #141

Closed
wegry wants to merge 5 commits into
user-componentsfrom
playground-runtime
Closed

Draft: what the JS/HTML template building might look like#141
wegry wants to merge 5 commits into
user-componentsfrom
playground-runtime

Conversation

@wegry

@wegry wegry commented Jun 16, 2021

Copy link
Copy Markdown
Contributor

I'd like for the building and loading of playgrounds to look something like this list

  • stitches a module with a default export together with a very basic playground runtime.

  • Compile JS and HTML templates once instead of per request

  • extract playground instance source from the document tree

  • map playground instance source with a content hash

  • cache playground instance builds after the first

  • Figure out a way around loading React from a CDN. For now this uses nodeLinker: node_modules.

@wegry
wegry requested a review from mariuswilms June 16, 2021 00:46
@wegry
wegry force-pushed the playground-runtime branch from ff46436 to b82c4d1 Compare June 16, 2021 00:48
@wegry wegry changed the title Rough draft of what the JS/HTML template building might look like Draft: what the JS/HTML template building might look like Jun 20, 2021
@wegry

wegry commented Jun 20, 2021

Copy link
Copy Markdown
Contributor Author

@mariuswilms I think the basic concept is outlined here. It's very rough, but the biggest thing between getting this off the ground now is, I think, the parse/rewriting in node_doc_transformer.go. Maybe you'd like to take a stab at that?

I'll confess I'm tempted to say something like https://github.com/russross/blackfriday with https://pkg.go.dev/github.com/russross/blackfriday/v2#HTMLRenderer.RenderNode changed might fit our needs.

@mariuswilms
mariuswilms force-pushed the user-components branch 2 times, most recently from 1992b97 to 629149a Compare August 20, 2021 10:50
@mariuswilms
mariuswilms force-pushed the user-components branch 2 times, most recently from ea9c955 to 414385b Compare August 29, 2021 17:53
@mariuswilms

mariuswilms commented Aug 29, 2021

Copy link
Copy Markdown
Member

@wegry I've rebased your changes and merged them into #139 and fitted them together with the code I've wrote. I'm closing this PR in favor of #139, let's continue our work there.

I'm commenting on that PR on the status,

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.

2 participants