Skip to content

Conversation

@tigloo
Copy link

@tigloo tigloo commented Oct 28, 2025

The current evaluation logic to determine the platform that Time Machine is running on uses dart.library.html (true on web/JS) and dart.library.io (true on everything else that runs in the Dart/Flutter VM). However, both evaluate to false when run in a WASM container, as WASM containers neither use html nor dart:io.

This patch adds a check for dart.library.js_interop to detect WASM and treats it like a web platform. This means that for WASM

  • assets get loaded through Flutter's bundle loader (as opposed to being statically compiled in on Dart native)
  • time zone configuration is read from the browser

Additional changes:

  • browser JS interop layer has been switched to dart:js_interop as dart:js is unsupported with WASM
  • dart:io has been removed completely in favor of universal_io. This will flag the package as WASM-compatible on pub.dev
  • fixes some lints

Notable side effect: this bumps the minimum Dart SDK from 2.19 to 3.3, which is quite a change - so old code won't be supported anymore.

Fix #55

@tigloo tigloo merged commit 8c8447e into master Nov 1, 2025
3 checks passed
@tigloo tigloo deleted the add-wasm-compatibility branch November 1, 2025 17:56
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.

Does not work when compiling for web under WASM

2 participants