You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add feature similar to require.ensure, but call it require.async.
These function calls should be detected in much the same way as require(...) calls.
Modules should still be recursively discovered and included in build.
Build-time behavior should be identical - require.async has no effect on splitting. That is still managed by the build config itself.
Run-time behavior is different - module is not included in dependencies hash, and is not guaranteed to have been invoked prior to containing module.
When require.async (or compiled equivalent) is invoked at run-time, 1) modules are resolved and invoked, 2) callback is invoked with params matching the required modules.
When the require.async is invoked within the example module, the Interlock will call the cccccc module as if it were an entry point - first ensuring that all dependencies are installed and invoked, resolving/installing/invoking any missing dependencies, and finally calling the cccccc module itself. This module's exports will be a function that invokes a callback, requiring and passing constituent dependencies as parameters.
The require.async implementation will have recorded the callback passed to it, and pass that to cccccc's returned function when available.
The text was updated successfully, but these errors were encountered:
Add feature similar to
require.ensure
, but call itrequire.async
.require(...)
calls.require.async
has no effect on splitting. That is still managed by the build config itself.require.async
(or compiled equivalent) is invoked at run-time, 1) modules are resolved and invoked, 2) callback is invoked with params matching therequire
d modules.Example input
Example output
When the
require.async
is invoked within the example module, the Interlock will call thecccccc
module as if it were an entry point - first ensuring that all dependencies are installed and invoked, resolving/installing/invoking any missing dependencies, and finally calling thecccccc
module itself. This module's exports will be a function that invokes a callback, requiring and passing constituent dependencies as parameters.The
require.async
implementation will have recorded the callback passed to it, and pass that tocccccc
's returned function when available.The text was updated successfully, but these errors were encountered: