Create a configuration for use with the JSDOM environment.
Callback that should return a promise for the list of JavaScript files the environment must execute in order to produce a result for the given render request.
Callback that should return a JSDOM resource loader for the given request. We must call this per render so that logging is appropriately channeled for the request being made.
Optional
afterEnvSetup: (Callback to perform additional environment setup before the render occurs. This can optionally return an object that can add extra fields to the environment context for rendering code to access. This is useful if your render server wants to add some specific configuration, such as setting up some versions of Apollo for server-side rendering. Be careful; any functions you attach can be executed by the rendering code.
Optional
registrationCallbackName: string = "__jsdom_env_register"The name of the function
that the environment should expose for client code to register for
rendering. This defaults to __jsdom_env_register
.
Readonly
afterPerform any additional environment setup.
This method gets access to the actual environment in which code will execute. Be careful what you do.
The URL that is to be rendered.
An API of utilities for assisting with the render operation.
Optional
vmContext: anyThe actual environment that is being setup.
A promise that the additional setup is done.
Readonly
getGet the list of file URLs to retrieve and execute for the given request.
The URL that is to be rendered.
An API of utilities for assisting with the render operation.
Function to fetch a URL. Using this ensures proper tidy-up of associated sockets and agents.
An ordered array of absolute URLs for the JavaScript files that are to be executed. These are exectued in the same order as the array.
Readonly
getGet a JSDOM resource loader for the given render request.
The URL that is to be rendered.
An API of utilities for assisting with the render operation.
A ResourceLoader instance for use with JSDOM that can optionally have a close() method, which will be invoked when the render completes.
Readonly
registrationThe name of the callback function that should be exposed by the environment for renderable code to use when registering for rendering.
Utility for creating a valid configuration to use with the JSDOM environment.