Web app support requirements
See original GitHub issueI had a quick play around with the Debugger for Chrome extension in a branch today (web
) and using pub serve
. Seems like it’s not hard to launch pub serve
and then start a debug session using the other extension (if installed; otherwise show an error).
We need Code 1.15 in order to hook the debug session ending to terminate pub serve
, but that’s not too far off.
However, while working on this I started wondering about people writing a backend in Dart - is pub serve
the correct thing here? Will they also need us to run dart bin/server.dart
to run their backend? Would this be instead of pub serve
or as well as? Having two endpoint seems a bit weird but a custom web server/backend isn’t going to be compiling the frontend/providing source maps, etc.
@devoncarew Do you have any thoughts on this? How common is launching for a Dart web server as well the frontend app? If other IDEs support this, how is it normally configured?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:35 (17 by maintainers)
Top GitHub Comments
@mnordine sorry, I should’ve documented this better. You should use a standard Dart launch config, not
chrome
. Using Chrome was the old workaround which ran webdev as a task.The example project used in the integration tests is here:
https://github.com/Dart-Code/Dart-Code/tree/master/src/test/test_projects/web/hello_world
And its launch.json looks like this:
Things like debugging are still very much work in progress, but please do open issues for anything that doesn’t work right (or suggestions to improve it).
@Lisenish You are correct. Today Dart Code has no support for running/debugging web apps.
There is some discussion in this thread you may be interested in though:
https://github.com/dart-lang/build/issues/1025
There’s a few things in there:
I haven’t personally used these much; I expect the experience is not perfect, but I think you can get a reasonable way without any official support in Dart Code for now.
Long-term, I’d still love to get to the point where you can “just press F5” for a web app; but right now Flutter is the main focus (though as always, PRs are welcome and I can provide assistance if anyone wants to take a go - the discussion in the above thread has some reasonable first steps).