Frontmatter
| id | 7438 |
| title | Create RMA Helper Scripts for Component Tests |
| state | Closed |
| labels | enhancementhelp wantedhacktoberfestai |
| assignees | Aki-07 |
| createdAt | Oct 10, 2025, 6:48 PM |
| updatedAt | Oct 11, 2025, 1:43 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7438 |
| author | tobiu |
| commentsCount | 3 |
| parentIssue | 7435 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Oct 11, 2025, 10:40 AM |
Create RMA Helper Scripts for Component Tests

Let me add some more context what remote method access is all about, since this is one of my favorite topics. It simplifies cross-thread communication via using namespaces.
As an example, inside workers we can not access the live-DOM. When using e.g. CSS flexbox layouts, the virtual DOM abstraction layer does not know about the real sizes of DOM nodes inside of it. So, inside the app worker we can call:
const buttonRect = await Neo.main.DomAccess.getBoundingClientRect({windowId, id});
Neo.main.DomAccess exists inside main threads, but not inside the app worker. An app worker can communicate with multiple browser windows (main threads), so we pass the windowId to get the right one. Under the hood, we send a postMessage from the app worker to main, execute the method, send the return value back and this resolves the Promise.
The real method definitions can be either sync or async, calling them from other threads is always async, due to the nature of post messages.
This concept also works for cross-worker communication, and workers are connected via MessageChannels for direct communication.
Code: https://github.com/neomjs/neo/blob/dev/src/worker/mixin/RemoteMethodAccess.mjs https://github.com/neomjs/neo/blob/dev/src/core/Base.mjs#L569

This one might be worth a read too: https://github.com/neomjs/neo/blob/dev/learn/benefits/RPCLayer.md
IMPORTANT: Before starting, please read the parent epic in detail to understand the required architecture and testing patterns: https://github.com/neomjs/neo/issues/7435
To facilitate communication between the Playwright test runner and the component instances in the app worker, a set of RMA (Remote Method Access) helper scripts is required. These scripts will be injected into the browser context using
page.addInitScript().Acceptance Criteria
test/playwright/util/rma-helpers.mjs.loadModule(path): A wrapper aroundNeo.worker.App.loadModule({path}).createComponent(config): A wrapper aroundNeo.worker.App.createNeoInstance().destroyComponent(id): A wrapper aroundNeo.worker.App.destroyNeoInstance().getComponentConfig(id, keyOrKeys): A wrapper aroundNeo.worker.App.getConfigs().setComponentConfig(id, config): A wrapper aroundNeo.worker.App.setConfigs().beforeEach,afterEach, and test body sections of the component tests.