gonia 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- export { render, registerDirective } from './render.js';
6
+ export { render, registerDirective, registerService } from './render.js';
7
7
  export type { DirectiveRegistry } from './render.js';
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- export { render, registerDirective } from './render.js';
6
+ export { render, registerDirective, registerService } from './render.js';
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
- import { parseHTML } from 'linkedom/worker';
6
+ import { Window } from 'happy-dom';
7
7
  import { Mode, DirectivePriority, getDirective } from '../types.js';
8
8
  import { createContext } from '../context.js';
9
9
  import { processNativeSlot } from '../directives/slot.js';
@@ -123,10 +123,11 @@ function createServerResolverConfig(el, rootState) {
123
123
  * ```
124
124
  */
125
125
  export async function render(html, state, registry) {
126
- const { document, MutationObserver } = parseHTML('<!DOCTYPE html><html><body></body></html>');
126
+ const window = new Window();
127
+ const document = window.document;
127
128
  const index = [];
128
129
  const selector = getSelector(registry);
129
- const observer = new MutationObserver((mutations) => {
130
+ const observer = new window.MutationObserver((mutations) => {
130
131
  for (const mutation of mutations) {
131
132
  for (const node of mutation.addedNodes) {
132
133
  if (node.nodeType !== 1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gonia",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "A lightweight, SSR-first reactive UI library with declarative directives",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "linkedom": "^0.18.0",
49
+ "happy-dom": "^17.4.4",
50
50
  "tinyglobby": "^0.2.15"
51
51
  },
52
52
  "peerDependencies": {