opennextjs / opennextjs-netlify

Open Next.js adapter for Netlify
https://opennext.js.org/netlify
678 stars 87 forks source link

fix: use version of htmlrewriter which does not make use of asyncify, which looks to have a potential memory leak under high load #2707

Open JakeChampion opened 5 hours ago

JakeChampion commented 5 hours ago

Description

We noticed the memory issue with Netlify's CSP plugin which used the same htmlrewriter library. We've built a new htmlrewriter library which uses the latest version of lol-html and removes the ability to use async-handlers, which is what required asyncify to be included.

Documentation

This is intended to be a pure refactor and have no user visible changes, as such no documentation updates should be required

Tests

You can test this change yourself like so:

  1. deno test -A edge-runtime/

Relevant links (GitHub issues, etc.) or a picture of cute animal

https://deno.land/x/htmlrewriter@v1.0.0

image