Skip to content

Features/wasm support#96

Merged
foscomputerservices merged 5 commits intomainfrom
features/wasm-support
Jan 23, 2026
Merged

Features/wasm support#96
foscomputerservices merged 5 commits intomainfrom
features/wasm-support

Conversation

@foscomputerservices
Copy link
Copy Markdown
Owner

No description provided.

foscomputerservices and others added 5 commits January 22, 2026 21:30
- Implement URLSession using JavaScriptKit fetch for WASM/browser
- Add HTTPURLResponse with header support and value(forHTTPHeaderField:)
- Add console logging helper to route Swift logs to browser console
- Support full HTTP request/response cycle including headers and body

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…context

JavaScriptKit's function extraction loses JavaScript 'this' context, causing
"Illegal invocation" errors. Solution: use JavaScript wrapper functions in HTML
that properly call browser APIs:

- window.wasmFetch(url, options) - wraps fetch()
- window.wasmHeadersGet(headers, name) - wraps headers.get()
- window.wasmHeadersEntries(headers) - wraps headers.entries()
- window.wasmIteratorNext(iterator) - wraps iterator.next()
- window.wasmArrayBuffer(response) - wraps response.arrayBuffer()

These wrappers are called from Swift via JSObject.global.wasmFetch.function!()
and preserve the necessary context for browser APIs to work correctly.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates FOSFoundation and FOSMVVM for WASM/WASI compatibility:
- Platform-specific conditionals for async Task operations
- URL data fetching adaptations for WASM environment
- URLSession mocking and WebSocket support for WASM
- SystemVersion handling for WASM platforms
- MVVMEnvironment and TestHost WASM compatibility

Updates governance documentation in .claude/CLAUDE.md with current
session context and refined principles/lessons collection.

Updates Package dependencies to support WASM builds.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@foscomputerservices foscomputerservices merged commit 61623ae into main Jan 23, 2026
5 checks passed
@foscomputerservices foscomputerservices deleted the features/wasm-support branch January 23, 2026 21:16
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.

1 participant