Peregrine Extensibility Targets

This page lists the Targets declared in the Peregrine package. Access these in your intercept files by calling targets.of('@magento/peregrine') on the TargetProvider object.

/* my-custom-interceptors.js */
module.exports = targets => {
    const peregrineTargets = targets.of('@magento/peregrine')
}

See the PWA Studio Target Experiments project repository for documented examples of extensions that use PWA Studio’s extensibility framework.

Members

talons : tapable.SyncHook

Provides access to Peregrine talon wrappers.

This target collects requests to intercept and "wrap" individual Peregrine talons in decorator functions.

Use this target to run custom code whenever the application calls a Peregrine talon. You can also use this target to modify the behavior or output returned by a talon.

Typedefs

talonInterceptFunction : function

Intercept function signature for the talons target.

Interceptors of talons should call wrapWith on the individual talons in the provided TalonWrapperConfig object.

talons : tapable.SyncHook

Provides access to Peregrine talon wrappers.

This target collects requests to intercept and “wrap” individual Peregrine talons in decorator functions.

Use this target to run custom code whenever the application calls a Peregrine talon. You can also use this target to modify the behavior or output returned by a talon.

Kind: global variable
See

Example (Access the tapable object)

const peregrineTargets = targets.of('@magento/peregrine');
const talonsTarget = peregrineTargets.talons;

Example (Wrap the `useApp()` hook with a logging extension)


talonsTarget.tap(talonWrapperConfig => {
  talonWrapperConfig.App.useApp.wrapWith('@my-extensions/log-wrapper');
})

talonInterceptFunction : function

Intercept function signature for the talons target.

Interceptors of talons should call wrapWith on the individual talons in the provided TalonWrapperConfig object.

Kind: global typedef

Param Type Description
talonWrapperConfig TalonWrapperConfig Registry of wrappable talon namespaces, talons, and interceptor sets

For implementation details View Source.