JavaScript plugin hooks can now import other files instead of being squeezed into one.
What's wrong with this entry?
Hooks written in JavaScript were limited to one file; the entry file may now import other files, which are followed, compiled and parsed as part of the module. Two new ceilings apply, MAX_HOOKS_MODULE_FILES and MAX_HOOKS_MODULE_TOTAL_BYTES, on top of the existing per-file byte cap. Anything outside the import graph is refused. No new flag: this works wherever hooks modules already load.
- Only the entry file may use top-level await. An imported file that uses it is refused, because the runtime links the entry alone as an async module.
- Hook registrations made through
onare followed into imported helper functions. - Refused outright: shadowing or reassigning the registration API, re-exporting it from another file, and
export *.
a top-level await in a file the entry imports; the environment links the entry alone as an async module
Strings lifted out of the shipped bundle, so the claim above can be checked against them.