Skip to content

Commit 8322a34

Browse files
committed
Switch from Gitpod to GitHub Codespaces
1 parent d442348 commit 8322a34

File tree

8 files changed

+110
-61
lines changed

8 files changed

+110
-61
lines changed

.devcontainer/devcontainer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "Firefox Profiler",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node:22",
4+
"features": {
5+
"ghcr.io/devcontainers/features/node:1": {
6+
"version": "22"
7+
}
8+
},
9+
"forwardPorts": [4242],
10+
"portsAttributes": {
11+
"4242": {
12+
"label": "Firefox Profiler",
13+
"onAutoForward": "openBrowser"
14+
}
15+
},
16+
"postCreateCommand": "yarn install",
17+
"postStartCommand": "FX_PROFILER_HOST=\"0.0.0.0\" yarn start",
18+
"customizations": {
19+
"vscode": {
20+
"extensions": [
21+
"dbaeumer.vscode-eslint",
22+
"esbenp.prettier-vscode",
23+
"stylelint.vscode-stylelint"
24+
],
25+
"settings": {
26+
"editor.formatOnSave": true,
27+
"editor.defaultFormatter": "esbenp.prettier-vscode"
28+
}
29+
}
30+
}
31+
}

.gitpod.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,11 @@ module.exports = function (config, serverConfig) {
5252

5353
This project uses [TypeScript](https://www.typescriptlang.org/).
5454

55-
## Using Gitpod
55+
## Using GitHub Codespaces
5656

57-
Alternatively, you can also develop the Firefox Profiler online in a pre-configured development environment:
57+
Alternatively, you can also develop the Firefox Profiler online in a pre-configured development environment using [GitHub Codespaces](https://github.com/features/codespaces).
5858

59-
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/firefox-devtools/profiler)
60-
61-
Gitpod will automatically install all dependencies; start the webpack server for you; and open the web app in a new browser tab. Please look at our [gitpod documentation](./docs-user/gitpod.md) for more information.
59+
GitHub Codespaces will automatically install all dependencies, start the webpack server for you, and forward port 4242 so you can access the web app. Please look at our [GitHub Codespaces documentation](./docs-developer/codespaces.md) for more information.
6260

6361
## Loading in profiles for development
6462

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,20 @@ yarn start
4343

4444
This project uses [TypeScript](https://www.typescriptlang.org/).
4545

46-
You can also develop the Firefox Profiler online in a pre-configured development environment.
46+
You can also develop the Firefox Profiler online in a pre-configured development environment using [GitHub Codespaces](https://github.com/features/codespaces).
4747

48-
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/firefox-devtools/profiler)
49-
50-
Please look at our [gitpod documentation](./docs-user/gitpod.md) for more information.
48+
Please look at our [GitHub Codespaces documentation](./docs-developer/codespaces.md) for more information.
5149

5250
For more detailed information on getting started contributing. We have plenty of docs available to get you started.
5351

54-
| | |
55-
| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
56-
| [Contributing](./CONTRIBUTING.md) | Find out in detail how to get started and get your local development environment configured. |
57-
| [Code of Conduct](./CODE_OF_CONDUCT.md) | We want to create an open and inclusive community, we have a few guidelines to help us out. |
58-
| [Developer Documentation](./docs-developer) | Want to know how this whole thing works? Get started here. |
59-
| [Source Files](./src) | Dive into the inner workings of the code. Most folders have a `README.md` providing more information. |
60-
| [End-User Documentation](https://profiler.firefox.com/docs/#/) | These docs are customized for actual users of the profiler, not just folks contributing. |
61-
| [Gitpod documentatation](./docs-user/gitpod.md) | Start here if you want to set up a work space on gitpod. |
52+
| | |
53+
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
54+
| [Contributing](./CONTRIBUTING.md) | Find out in detail how to get started and get your local development environment configured. |
55+
| [Code of Conduct](./CODE_OF_CONDUCT.md) | We want to create an open and inclusive community, we have a few guidelines to help us out. |
56+
| [Developer Documentation](./docs-developer) | Want to know how this whole thing works? Get started here. |
57+
| [Source Files](./src) | Dive into the inner workings of the code. Most folders have a `README.md` providing more information. |
58+
| [End-User Documentation](https://profiler.firefox.com/docs/#/) | These docs are customized for actual users of the profiler, not just folks contributing. |
59+
| [GitHub Codespaces documentation](./docs-developer/codespaces.md) | Start here if you want to set up a workspace on GitHub Codespaces. |
6260

6361
### Discussion
6462

docs-developer/codespaces.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Setting up profiler on GitHub Codespaces
2+
3+
Instead of configuring a local setup, you can also use [GitHub Codespaces](https://github.com/features/codespaces), a cloud-based development environment with minimal setup.
4+
5+
## Getting Started
6+
7+
You can create a new Codespace directly from the repository:
8+
9+
1. Navigate to the [Firefox Profiler repository](https://github.com/firefox-devtools/profiler)
10+
2. Click the green `Code` button
11+
3. Click on the `Codespaces` tab
12+
4. Click `Create codespace on main` (or on your branch)
13+
14+
GitHub will automatically:
15+
16+
- Create a new development environment
17+
- Install all dependencies using `yarn install`
18+
- Start the development server on port 4242
19+
20+
## Open the profiler UI in your web browser
21+
22+
Once the Codespace is ready, GitHub will automatically forward port 4242. You'll see a notification that a service is available on this port.
23+
24+
- Click `Open in Browser` to open the profiler UI in a new tab
25+
- Alternatively, you can access forwarded ports from the `PORTS` tab at the bottom of the VS Code interface
26+
27+
## Load custom profiles
28+
29+
If you want to load profiles for development, you can follow the steps described in [Loading in profiles for development](../CONTRIBUTING.md#loading-in-profiles-for-development) section.
30+
31+
## Advanced usage
32+
33+
### Opening a specific branch or pull request
34+
35+
You can create a Codespace for any branch or pull request:
36+
37+
1. Navigate to the branch or pull request you want to work on
38+
2. Click the `Code` button
39+
3. Select the `Codespaces` tab
40+
4. Click `Create codespace on [branch-name]`
41+
42+
### Using the GitHub CLI
43+
44+
You can also create and manage Codespaces using the [GitHub CLI](https://cli.github.com/):
45+
46+
```bash
47+
# Create a new codespace
48+
gh codespace create --repo firefox-devtools/profiler
49+
50+
# List your codespaces
51+
gh codespace list
52+
53+
# Connect to a codespace
54+
gh codespace code
55+
```
56+
57+
### Configuration
58+
59+
The Codespace is configured using the `.devcontainer/devcontainer.json` file in the repository. This includes:
60+
61+
- Node.js environment
62+
- Automatic port forwarding for port 4242
63+
- Pre-installed VS Code extensions (ESLint, Prettier, Stylelint)
64+
- Automatic dependency installation and server startup

docs-user/gitpod.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

res/photon/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const port = process.env.FX_PROFILER_PHOTON_PORT || 4243;
66
const host = process.env.FX_PROFILER_PHOTON_HOST || 'localhost';
77

88
const serverConfig = {
9-
allowedHosts: ['localhost', '.gitpod.io'],
9+
allowedHosts: ['localhost', '.app.github.dev'],
1010
host,
1111
port,
1212
static: false,

server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ config.cache = {
2929
type: 'filesystem',
3030
};
3131
const serverConfig = {
32-
allowedHosts: ['localhost', '.gitpod.io'],
32+
allowedHosts: ['localhost', '.app.github.dev'],
3333
host,
3434
port,
3535
// We disable hot reloading because this takes lot of CPU and memory in the

0 commit comments

Comments
 (0)