Skip to content

Use v8 Snapshot to inject polyfills #1176

@krichprollsch

Description

@krichprollsch

We use JS polyfills to supports some web APIs.
These polyfills are injected into v8 during page initialization.

The polyfill loader executes the pre-load part of the polyfill, and it lazy loads the reset by implementing a V8's callback on missing elements.

This lazy load is a hacking and not perfect way to inject polyfill, and we would prefer loading them all the time but faster.

Since we know these scripts are always the same, we would like to use a faster way to inject them into v8, one idea was to use the snapshot feature from v8. We had an attempt to implement them previously, but it didn't work. See lightpanda-io/zig-v8-fork#82 and #845

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions