-
Notifications
You must be signed in to change notification settings - Fork 186
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
Blocking playground renderer #16
Conversation
`(${shared.html.length} < ${html.length} bytes)` | ||
); | ||
} | ||
shared.length[0] = length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is .length
here? It reads oddly to see that name indexed like this.
type: 'shutdown'; | ||
} | ||
|
||
export class BlockingRenderer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment
|
||
export type WorkerMessage = Handshake | Render | Shutdown; | ||
|
||
export interface Handshake { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add Message
suffix
export interface Handshake { | ||
type: 'handshake'; | ||
html: Uint8Array; | ||
length: Int32Array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, about my question about the length
name... Maybe name these like lengthBuffer
or lengthData
to make it more clear?
@@ -37,7 +37,7 @@ export class Reaper { | |||
|
|||
private endKeepAlive() { | |||
this.pending--; | |||
if (this.pending == 0) { | |||
if (this.pending === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi, 11ty recently added beforeBuild and afterBuild events: https://www.11ty.dev/docs/events/
Neither markdown code fences, nor shortcodes in HTML files, support async rendering, so this makes them work by rendering in a blocking fashion. A little absurd maybe?
Atomics.wait
.{% highlight %}
shortcode with this renderer.updateComplete
, instead of spawning a new tab for each render (way faster).