Open dkegel-fastly opened 1 year ago
This seems reasonable. The net/http
package is also a large dependency, and people who are only using C@E won't need it. That's probably easier than moving those two files to their own subpackage.
I wonder if we should actually go the other way and require opting in to the net/http
dependency? Although if we're going to break the API, having it in a separate package is probably nicer.
https://github.com/tinygo-org/tinygo/pull/4502 should fix the Mac build but doesn't solve the issue of adding in a net/http
for everybody who doesn't need it.
An app that imports fsthttp, and which builds in both go, tinygo native, and tinygo wasm (with -tag nofastlyhostcalls) stopped building on tinygo native when we upgraded it to v0.1.2; wrapping fsthttp/{transport,adapter}.go in another build tag seems to resolve the problem.
So adding a build tag to disable the net/http dependency seems like a good thing to add... maybe named fastly.compute.nostdhttp for clarity.