Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable --wasm flag for production builds #3039

Merged
merged 3 commits into from
Aug 14, 2024
Merged

Conversation

johnpryan
Copy link
Contributor

@johnpryan johnpryan commented Aug 8, 2024

The UI is working nicely when built with the latest version Flutter engine, so it would be great to start using Wasm for the production version of DartPad. (The remaining issues with platform views have been fixed on the main channel of the SDK.)

Here's a staged version built with the --wasm flag, using the latest Flutter SDK (main channel): https://dart-pad-a3c64--wasm-cdjiko6q.web.app/

I made sure to update the Flutter SDK images to the latest version of the main channel of the SDK in GCP, so once this is merged it should use those images.

@parlough
Copy link
Member

parlough commented Aug 8, 2024

Cool. Thanks!

Here's a staged version built with the --wasm flag, using the latest Flutter SDK (main channel): https://dart-pad-a3c64.web.app/

I'm able to run other Flutter web apps with Wasm, but the staged version at the link you sent seems to still be running with (or picking) JS. Is it the wrong link or do you still expect that?

@johnpryan
Copy link
Contributor Author

Sorry, wrong link: https://dart-pad-a3c64--wasm-cdjiko6q.web.app/

@johnpryan
Copy link
Contributor Author

johnpryan commented Aug 8, 2024

It looks like the platform view is blank when changing between different samples:

dartpad 2024-08-08 13_57_42

@johnpryan
Copy link
Contributor Author

This doesn't appear to be related to Wasm, but seems to be happening due to a timing issue related to calling refresh() on the Codemirror API. I patched this issue by adding an artificial delay whenever a new CodeMirror platform view is created: 75542ec

@johnpryan
Copy link
Contributor Author

Updated staging link: https://dart-pad-a3c64--wasm-cdjiko6q.web.app/

@devoncarew
Copy link
Member

devoncarew commented Aug 8, 2024

With this link: https://dart-pad-a3c64--wasm-cdjiko6q.web.app/, I don't see content in the codemirror editor until I click inside it.

(ed: perhaps an intermittent issue?)

@johnpryan
Copy link
Contributor Author

johnpryan commented Aug 14, 2024

I don't see content in the codemirror editor until I click inside it.
We should add a brief comment for why we have this delay.

63b1d9d should fix that.

Updated staging link: https://dart-pad-a3c64--wasm-cdjiko6q.web.app/

Copy link
Member

@devoncarew devoncarew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@johnpryan johnpryan merged commit 5f58825 into dart-lang:main Aug 14, 2024
2 checks passed
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.

3 participants