-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: inline stage 2 ESZIP bundler #102
Conversation
@@ -0,0 +1,47 @@ | |||
import { load } from "https://deno.land/x/eszip@v0.18.0/loader.ts"; |
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.
This file was copied untouched from the edge bootstrap repo.
Some of the functions here are used by the edge bootstrap when generating the stage 1 ESZIP. We can live with the duplicated code for now, and later on we can change edge bootstrap so that the files are loaded from this repo instead. Conceptually, it makes more sense for the bootstrap to load bundling logic from the bundler repo than the other way around.
@@ -0,0 +1,4 @@ | |||
export const PUBLIC_SPECIFIER = "netlify:edge"; |
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.
This file was copied untouched from the edge bootstrap repo.
@@ -0,0 +1,81 @@ | |||
import { build, LoadResponse } from 'https://deno.land/x/eszip@v0.18.0/mod.ts' |
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.
This file was copied untouched from the edge bootstrap repo.
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.
Given this was mostly copied from another repo, approving as the change of location for that code makes sense
Which problem is this pull request solving?
When bundling an edge function with the ESZIP format, Edge Bundler is fetching some logic from the edge bootstrap in order to generate the stage 2 file. In reality, this logic has very little to do with the bootstrap layer itself and is actually concerned with bundling, so it makes sense to move it to Edge Bundler.
By moving it, we're also reducing the number of network calls we need to make at build time, which are causing occasional errors.