Skip to content

Optimize sandboxed Component fetches #381

Open

Description

@andy-haynes

When the compiler statically analyzes Component children, it ignores untrusted renders since they get evaluated at runtime. If the path of these sandboxed child Components are known at parent bundle time however, the compiler could warm the cache by requesting the source for these children after it finishes servicing the current request.

This fetching would occur in the worker context while the parent's initial render plays out, reducing wait time for the subsequent compiler request of the sandboxed children. Note that this works same regardless of whether or not the preemptive fetch has completed by the time the child is requested.

E.g.

this.sendWorkerMessage(...);

// `sandboxedChildComponents` is the set of all sandboxed Components
// rendered as children of any of this container's Components
this.getComponentSources(sandboxedChildComponents);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions