Add WASM compatibility #57
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current evaluation logic to determine the platform that Time Machine is running on uses
dart.library.html(true on web/JS) anddart.library.io(true on everything else that runs in the Dart/Flutter VM). However, both evaluate tofalsewhen run in a WASM container, as WASM containers neither use html nordart:io.This patch adds a check for
dart.library.js_interopto detect WASM and treats it like a web platform. This means that for WASMAdditional changes:
dart:js_interopasdart:jsis unsupported with WASMdart:iohas been removed completely in favor ofuniversal_io. This will flag the package as WASM-compatible on pub.devNotable 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