rsnext/packages/next/build/webpack
Seiya Nuta 0bf9233e14
[middleware] Warn dynamic WASM compilation (#37681)
In Middlewares, dynamic code execution is not allowed. Currently, we warn if eval / new Function are invoked in dev but don't warn another dynamic code execution in WebAssembly.

This PR adds warnings for `WebAssembly.compile` and `WebAssembly.instantiate` with a buffer parameter (note that `WebAssembly.instantiate` with a **module** parameter is legit) invocations. Note that other methods that compile WASM dynamically such as `WebAssembly.compileStreaming` are not exposed to users so we don't need to cover them.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-06-16 14:59:30 +00:00
..
config Skip loading unused plugins in next dev (#37430) 2022-06-03 14:47:16 -04:00
loaders chore: bump react dev dep to 18.2 (#37697) 2022-06-15 10:14:43 -05:00
plugins [middleware] Warn dynamic WASM compilation (#37681) 2022-06-16 14:59:30 +00:00
require-hook.ts Pre-compile more dependencies (#32742) 2022-01-17 15:17:22 +00:00
stringify-request.ts Update loader-utils (#30743) 2021-11-02 16:13:15 +01:00