flutter_widget_from_html
flutter_widget_from_html copied to clipboard
Meta: test on dartpad
Link: https://dartpad.dev/embed-flutter.html
Need to wait for https://github.com/dart-lang/dart-pad/issues/901
Need whitelisting https://medium.com/dartlang/announcing-package-support-for-dartpad-66a4b415970b
https://try.fwfh.dev/ is functional.
- dart-services is running in a Cloud Run container with 4GB RAM, 2 CPU
- dart-pad is running with 512MB, 1 CPU
- There is only 1 NNBD backend
- Both services are behind one single global LB

It's quite slow:
- Obvious issue with cold start, which is unavoidable to save cost
- Importing
flutter_widget_from_html
produces a 5MB compiled JS bundle. - Importing core is better but still ~2MB
https://try.fwfh.dev/ tech stack has been updated
- Frontend is now served via Firebase hosting, way faster than the previous Cloud Run deployment
- Backend is configured with --cpu-boost to reduce cold start; concurrency=2, max=5 for better performance
- The old GCP load balancer is being retired
Since flutter-widget-from-html/try#5, it has been updated again. Backend is now being deployed in Railway to avoid the slow GCP cold start: only 15s now vs. the previous 45s.
Thanks to efforts in flutter-widget-from-html/try@6674408, cold start is usually less than 6s now.