Skip to content

Commit 24da5c3

Browse files
committed
[docs] Add documentation for Automatic Workspace Folders.
This adds public documentation, including installation and setup, to be consumed by ecosystem partners. Change-Id: I79fe31372a25564fe545ad3d476ffab2f024e806 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6309600 Auto-Submit: Benedikt Meurer <[email protected]> Reviewed-by: Alex Rudenko <[email protected]>
1 parent 120b831 commit 24da5c3

File tree

5 files changed

+115
-2
lines changed

5 files changed

+115
-2
lines changed

docs/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ below.**
1515

1616
[TOC]
1717

18-
## Chromium DevTools Playbook (aka Work With Us)
18+
## Work With Us
1919

20-
* See the [playbook](./playbook.md) for step-by-step instructions on how to work with Chromium DevTools to implement your idea.
20+
* See the [playbook](./playbook.md) for step-by-step instructions on how to
21+
work with Chromium DevTools to implement your idea.
22+
* See the [Ecosystem Guide](./ecosystem/README.md) if you are working on Web
23+
development tools and services, and would like to learn more about
24+
integration and extension points with Chromium DevTools.
2125

2226
## Document Index
2327

docs/ecosystem/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Chromium DevTools Ecosystem Guide
2+
3+
This guide contains information for ecosystem tools and partners regarding
4+
integration and extension points in Chromium DevTools.
5+
6+
* [Automatic Workspace Folders](automatic_workspace_folders.md)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Automatic Workspace Folders
2+
3+
[goo.gle/devtools-automatic-workspace-folders][self-link]
4+
5+
We recently added a new feature to Chromium (available with M-135 and later),
6+
which improves the ergonomics and discoverability of the [Workspace] feature,
7+
and it's called "Automatic Workspace Folders".
8+
9+
**Googlers-only:** Check out the internal resources at
10+
11+
- [go/chrome-devtools:automatic-workspace-folders-design][design-doc], and
12+
- [go/chrome-devtools:automatic-workspace-folders-demo][demo].
13+
14+
## Background
15+
16+
The [Workspace][workspace-doc] feature, which was originally (re)launched as
17+
[Workspaces 2.0][workspace-announcement] in M-63 and announced at CDS 2016,
18+
allows developers to edit and save files in your project, effectively persisting
19+
changes that you make in DevTools (during debugging) to your source files
20+
directly. However, as outlined in the documentation this requires quite a bit of
21+
[manual setup](https://developer.chrome.com/docs/devtools/workspaces#devtools),
22+
which is
23+
24+
1. not particularly obvious and discoverable, and
25+
2. not very ergonomic when working on different projects.
26+
27+
Specifically the second point is problematic, as you have to manually maintain
28+
the list of folders in your workspace, meaning that whenever you work on a new
29+
project (or just a separate checkout of an existing project) you'd need to add
30+
the relevant folder manually via the Workspace tab, and when you're done with a
31+
project (at least for a while) you'd need to remove it explicitly from the list
32+
(otherwise the list will soon grow very long).
33+
34+
## Solution
35+
36+
With M-135 we've added a feature called "Automatic Workspace Folders", where
37+
devservers can inform the developer tools running in the browser about the
38+
project folders that they are serving, and DevTools can automatically pick that
39+
up and connect to these folders during local debugging, and automatically
40+
disconnect these folders when the developer navigates somewhere else.
41+
42+
This information is communicated via a special JSON file that DevTools requests
43+
from a well-known location on the devserver, as outlined in the
44+
[DevTools Project Settings (devtools.json)][design-doc-json]. The file is named
45+
`com.chrome.devtools.json` (for now) and located in the
46+
`/.well-known/appspecific/` folder of the inspected page. For the automatic
47+
workspace folders, it has to contain a `workspace` object with two properties:
48+
49+
- `workspace.root` is the absolute path to the project folder (where the
50+
source code is located).
51+
- `workspace.uuid` is a valid UUID, ideally a v4 UUID, generated randomly when
52+
setting up the project folder.
53+
54+
An example `com.chrome.devtools.json` would look like this:
55+
56+
```
57+
{
58+
"workspace": {
59+
"root": "/Users/foobar/Projects/my-awesome-web-project",
60+
"uuid": "53b029bb-c989-4dca-969b-835fecec3717"
61+
}
62+
}
63+
```
64+
65+
Chromium DevTools will only attempt to load the `com.chrome.devtools.json` when
66+
the origin of the inspected page is `localhost`.
67+
68+
## Setup
69+
70+
In M-135, which is in Canary channel at the time of this writing, and probably
71+
M-136 too, this feature is disabled by default. To use it, you need to turn on
72+
two feature flags in `about:flags`:
73+
74+
- [chrome://flags#devtools-project-settings](chrome://flags#devtools-project-settings)
75+
- [chrome://flags#devtools-automatic-workspace-folders](chrome://flags#devtools-automatic-workspace-folders)
76+
77+
![](./images/automatic_workspace_folders_flags.png)
78+
79+
Instead of enabling the feature via `about:flags`, you can instead also enable
80+
them from the command line:
81+
82+
```
83+
google-chrome-canary--enable-features=DevToolsWellKnown,DevToolsAutomaticFileSystems
84+
```
85+
86+
To check if your setup is correct, you can try out my [Hello World][hello-world]
87+
demo project. Just follow the steps outlined in the `README.md` there.
88+
89+
[self-link]: http://goo.gle/devtools-automatic-workspace-folders
90+
[design-doc]: http://go/chrome-devtools:automatic-workspace-folders-design
91+
[demo]: http://go/chrome-devtools:automatic-workspace-folders-demo
92+
[workspace-doc]: https://developer.chrome.com/docs/devtools/workspaces
93+
[workspaces-announcement]: https://developer.chrome.com/blog/new-in-devtools-63#workspaces
94+
[design-doc-json]: https://goo.gle/devtools-json-design
95+
[hello-world]: https://github.com/bmeurer/automatic-workspace-folders-hello-world
87.4 KB
Loading

docs/ecosystem/navbar.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Chromium DevTools Ecosystem Guide
2+
3+
[logo]: https://github.com/ChromeDevTools/devtools-logo/raw/master/logos/png/devtools-circle-48.png
4+
[home]: README.md
5+
[devtools]: ../README.md
6+
7+
* [Chromium DevTools Ecosystem Guide][home]
8+
* [Chromium DevTools Documentation][devtools]

0 commit comments

Comments
 (0)