Skip to content

Deploy edge handlers locally #1236

@mraerino

Description

@mraerino

Is your feature request related to a problem? Please describe.

Right now, the edge handler plugin will only put the bundled edge handler into a local directory when running via netlify build in the CLI. We need to upload bundled edge handlers when deploying locally.

Describe the solution you'd like

netlify deploy should detect whether there are bundled edge handlers in .netlify/edge-handlers

If there is a manifest & a bundle, it should use the upload method from the edge handler plugin to upload the bundle to the api: https://github.com/netlify/netlify-plugin-edge-handlers/blob/master/src/upload.js

  • Read the bundle file and pass the file buffer as buf
  • Read the manifest and parse it as json, pass the object as info
  • The access token should be valid for the site that is being deployed to

This should happen after the deploy has been created, but before the deploy is complete (and post-processing starts).

Describe alternatives you've considered

The edge handler plugin could upload the bundle directly, but when netlify build runs locally, we don't have a deploy object yet.

Additional context

API endpoint used by the plugin: https://bitballoon-openapi.netlify.app/external#operation/Edge%20Handlers-create

Can you submit a pull request?

Yes, but @erezrokah might be helping with this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions