Skip to content

Conversation

@webmaven
Copy link
Owner

Abstracts all DOM operations in the Rendition class behind a DOMAdapter protocol. This decouples the class from the Pyodide environment, allowing for easier testing and improved modularity.

  • Creates a DOMAdapter protocol and PyodideDOMAdapter implementation.
  • Refactors Rendition to accept a DOMAdapter via dependency injection.
  • Introduces a MockDOMAdapter for use in unit tests.
  • Updates all relevant tests to use the new mock adapter, removing the need for sys.modules patching.

Closes #14.

Abstracts all DOM operations in the Rendition class behind a `DOMAdapter` protocol. This decouples the class from the Pyodide environment, allowing for easier testing and improved modularity.

- Creates a `DOMAdapter` protocol and `PyodideDOMAdapter` implementation.
- Refactors `Rendition` to accept a `DOMAdapter` via dependency injection.
- Introduces a `MockDOMAdapter` for use in unit tests.
- Updates all relevant tests to use the new mock adapter, removing the need for `sys.modules` patching.
Abstracts all DOM operations in the Rendition class behind a `DOMAdapter` protocol. This decouples the class from the Pyodide environment, allowing for easier testing and improved modularity.

- Creates a `DOMAdapter` protocol and `PyodideDOMAdapter` implementation.
- Refactors `Rendition` to accept a `DOMAdapter` via dependency injection.
- Introduces a `MockDOMAdapter` for use in unit tests.
- Updates all relevant tests to use the new mock adapter, removing the need for `sys.modules` patching.
Abstracts all DOM operations in the Rendition class behind a `DOMAdapter` protocol. This decouples the class from the Pyodide environment, allowing for easier testing and improved modularity.

- Creates a `DOMAdapter` protocol and `PyodideDOMAdapter` implementation.
- Refactors `Rendition` to accept a `DOMAdapter` via dependency injection.
- Introduces a `MockDOMAdapter` for use in unit tests.
- Updates all relevant tests to use the new mock adapter, removing the need for `sys.modules` patching.
@webmaven webmaven merged commit a2fa1ad into main Jan 14, 2026
1 check passed
@webmaven webmaven deleted the feature-issue-14-refactor-rendition-8139800673545755144 branch January 14, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Rendition to abstract DOM operations

2 participants