To support a fully dynamic component testing environment, we need a way for the Playwright test runner (main thread) to dynamically load ES modules into the App Worker on demand. The current approach used by the Siesta harness, which involves a static manifest file (test/components/app.mjs), is brittle and does not support proper test isolation.
This task is to implement a new Remote Method Access (RMA) method, loadModule(), in src/worker/App.mjs.
Acceptance Criteria
- Create a new
async method loadModule(path) in src/worker/App.mjs.
- This method must use a dynamic
import() statement to load the module specified by the path.
- Crucially, the import statement must include the
/* webpackIgnore: true */ magic comment to prevent webpack from trying to bundle the dynamic path.
- The new
loadModule method must be added to the remote.main array in the config of src/worker/App.mjs to make it accessible from the main thread.
To support a fully dynamic component testing environment, we need a way for the Playwright test runner (main thread) to dynamically load ES modules into the App Worker on demand. The current approach used by the Siesta harness, which involves a static manifest file (
test/components/app.mjs), is brittle and does not support proper test isolation.This task is to implement a new Remote Method Access (RMA) method,
loadModule(), insrc/worker/App.mjs.Acceptance Criteria
asyncmethodloadModule(path)insrc/worker/App.mjs.import()statement to load the module specified by thepath./* webpackIgnore: true */magic comment to prevent webpack from trying to bundle the dynamic path.loadModulemethod must be added to theremote.mainarray in theconfigofsrc/worker/App.mjsto make it accessible from the main thread.