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
The @wordpress/lazy-import package introduced in #22684 allows for importing modules which may or may not be already installed. It's intended to be mostly interchangeable with a dynamic import or CommonJS require (aside from the fact that it returns a promise).
As part of the changes in #22684, existing usage of dependencies required in a benchmark script were ported to use @wordpress/lazy-import. One amongst these was the fbjs package, which requires that a module be imported from its path within the package, even going so far as to throw an error when the root-level package is imported.
Currently, @wordpress/lazy-import does not support path imports, which required a unique workaround for the above scenario.
Task: Support path imports in @worpress/lazy-import
Implementation Notes:
Existing supported usage should not be impacted.
Path-based imports should be supported, as in the following example:
awaitlazyImport('fbjs/lib/shallowEqual@^1.0.0');
As noted at #22684 (comment) , the npm-package-arg package used in @wordpress/lazy-import does not support strings formatted this way. It may be required to extract the path separate from this existing process, or create a custom implementation for extracting the package, path, and version from a given string.
The text was updated successfully, but these errors were encountered:
The
@wordpress/lazy-import
package introduced in #22684 allows for importing modules which may or may not be already installed. It's intended to be mostly interchangeable with a dynamicimport
or CommonJSrequire
(aside from the fact that it returns a promise).As part of the changes in #22684, existing usage of dependencies required in a benchmark script were ported to use
@wordpress/lazy-import
. One amongst these was thefbjs
package, which requires that a module be imported from its path within the package, even going so far as to throw an error when the root-level package is imported.Currently,
@wordpress/lazy-import
does not support path imports, which required a unique workaround for the above scenario.Task: Support path imports in
@worpress/lazy-import
Implementation Notes:
Existing supported usage should not be impacted.
Path-based imports should be supported, as in the following example:
As noted at #22684 (comment) , the
npm-package-arg
package used in@wordpress/lazy-import
does not support strings formatted this way. It may be required to extract the path separate from this existing process, or create a custom implementation for extracting the package, path, and version from a given string.The text was updated successfully, but these errors were encountered: