question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add the ability to run Dart web apps

See original GitHub issue

(Updated July 2017)

Given DDC now works in pub serve the plan is to just use that and the Chrome Debugger protocol for debugging. This means no Dartium support.

I’ve opened #386 to collect some requirements/ideas for how this will work and plan to work on it over the coming weeks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

6reactions
DanTupcommented, Apr 6, 2018

FWIW for anyone doing web apps, while Dart Code doesn’t have supports, I still managed to get some basic behaviour for hitting F5 with the following config in Code (this is without any Dart Code changes - you can do this today; though it shouldn’t be required when Dart Code has real web support). F5 kicks off the Chrome debugger, but first it invokes pub run build_runner serve and it has some regexes so Code knows when it’s idle (versus building), so it will wait until the build is finished before opening the browser.

tasks.json:

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "pub serve",
			"type": "shell",
			"args": [
				"run",
				"build_runner",
				"serve"
			],
			"command": "pub",
			"group": "build",
			"isBackground": true,
			"problemMatcher": {
				"owner": "custom",
				"pattern": {
					"regexp": "__________"
				},
				"background": {
					"activeOnStart": true,
					"beginsPattern": "^\\[INFO\\] Starting Build",
					"endsPattern": "^\\[INFO\\] Succeeded after"
				}
			}
		}
	]
}

launch.json:

{
	"version": "0.2.0",
	"configurations": [
		{
			"type": "chrome",
			"request": "launch",
			"name": "Launch web app",
			"url": "http://localhost:8080",
			"webRoot": "${workspaceFolder}/web",
			"preLaunchTask": "pub serve"
		}
	]
}

Source maps for the files in web seem to work out of the box, but I haven’t had chance to dig into other files (like the SDK) yet.

6reactions
marcojakobcommented, Sep 5, 2016

Something similar to what Webstorm has would be great. An opinionated list of priorities:

  1. Open HTML in Dartium
  2. Open HTML in Dartium, debug in Visual Studio Code
  3. pub build menu in editor
  4. Open HTML in any other browser (Firefox, Chrome, IE, Safari), automatically compile
  5. Automatically install and update Dart SDK and Dartium from Dart Code extension (don’t know if this is possible in any way)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started: Web apps - Dart
1. Play with a web app in DartPad · 2. Install Dart · 3. Get CLI tools or an IDE (or both) ·...
Read more >
Chapter 10. Building a Dart web app - Dart in Action
When a Dart app starts running, it uses the code started by main() to build a UI and wire up event handlers, such...
Read more >
Building a Simple Web Application in Dart
Learn how to build a simple web application using the Dart programming language.
Read more >
Dart's plan to make it easier for you to build web apps - YouTube
Thanks to Dart's Dart to JavaScript compiler, you'll see how you get all of that while still being able to run on any...
Read more >
Server Side Dart for Beginners: 04 Setting Up Web Application
In this video, we set up the web application to interact with the server. We introduce the form element in html, and discuss...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found