Open webpack-bot opened 1 year ago
@alexander-akait I'm having to dig into the code to understand what exactly the new syntax will match. Could you add some documentation for this with some match / won't match examples?
For example, would the syntax as written be expected to match:
await this._context.audioWorklet.addModule(
new URL("./recorder.worklet.js", import.meta.url)
);
A pull request by @alexander-akait was merged and maintainers requested a documentation change.
See pull request: https://github.com/webpack/webpack/pull/17212
Part of https://github.com/webpack/webpack/issues/11543, currently you can't use
But now you can use:
Using
*
allow to build worklet from a variable (i.e.*context
means takecontext
variable and check members after it, it works only on start of line, i.e.context.foo*.addModule()
doesn't supported), i.e.Note - you can use it not only for worklets, for any custom syntax with call and member expressions
Summary
🤖 Generated by Copilot at 20c6900
This pull request adds a new feature to the
WorkerPlugin
that allows using a special syntax for worker specifiers that match a worklet API. It also adds several test files and helpers to verify the functionality and compatibility of the feature.Details
🤖 Generated by Copilot at 20c6900
WorkerSpecifierTag
symbol to mark variables as worker specifiers (link)url
property toWorker
class increateFakeWorker
helper (link)