You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- fixed: added missing build step
- fixed: reordered sections: Windows tool must come before build part
- added: prerequisites link to Theia and link to recommended tool: Code
- added: how to clone repo and change dir to repo root
- added: section how to start code + link to further docs
Signed-off-by: Akos Kitta <[email protected]>
Copy file name to clipboardExpand all lines: docs/development.md
+92-60
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,16 @@ This page includes technical documentation for developers who want to build the
5
5
## Architecture overview
6
6
7
7
The IDE consists of three major parts:
8
-
- the _Electron main_ process,
9
-
- the _backend_, and
10
-
- the _frontend_.
8
+
9
+
- the _Electron main_ process,
10
+
- the _backend_, and
11
+
- the _frontend_.
11
12
12
13
The _Electron main_ process is responsible for:
13
-
- creating the application,
14
-
- managing the application lifecycle via listeners, and
15
-
- creating and managing the web pages for the app.
14
+
15
+
- creating the application,
16
+
- managing the application lifecycle via listeners, and
17
+
- creating and managing the web pages for the app.
16
18
17
19
In Electron, the process that runs the main entry JavaScript file is called the main process. The _Electron main_ process can display a GUI by creating web pages. An Electron app always has exactly one main process.
18
20
@@ -21,13 +23,14 @@ By default, whenever the _Electron main_ process creates a web page, it will ins
21
23
In normal browsers, web pages usually run in a sandboxed environment, and accessing native resources are disallowed. However, Electron has the power to use Node.js APIs in the web pages allowing lower-level OS interactions. Due to security reasons, accessing native resources is an undesired behavior in the IDE. So by convention, we do not use Node.js APIs. (Note: the Node.js integration is [not yet disabled](https://github.com/eclipse-theia/theia/issues/2018) although it is not used). In the IDE, only the _backend_ allows OS interaction.
22
24
23
25
The _backend_ process is responsible for:
24
-
- providing access to the filesystem,
25
-
- communicating with the [Arduino CLI](https://github.com/arduino/arduino-cli) via gRPC,
26
-
- running your terminal,
27
-
- exposing additional RESTful APIs,
28
-
- performing the Git commands in the local repositories,
29
-
- hosting and running any VS Code extensions, or
30
-
- executing VS Code tasks<sup>[[2]]</sup>.
26
+
27
+
- providing access to the filesystem,
28
+
- communicating with the [Arduino CLI](https://github.com/arduino/arduino-cli) via gRPC,
29
+
- running your terminal,
30
+
- exposing additional RESTful APIs,
31
+
- performing the Git commands in the local repositories,
32
+
- hosting and running any VS Code extensions, or
33
+
- executing VS Code tasks<sup>[[2]]</sup>.
31
34
32
35
The _Electron main_ process spawns the _backend_ process. There is always exactly one _backend_ process. However, due to performance considerations, the _backend_ spawns several sub-processes for the filesystem watching, Git repository discovery, etc. The communication between the _backend_ process and its sub-processes is established via IPC. Besides spawning sub-processes, the _backend_ will start an HTTP server on a random available port, and serves the web application as static content. When the sub-processes are up and running, and the HTTP server is also listening, the _backend_ process sends the HTTP server port to the _Electron main_ process via IPC. The _Electron main_ process will load the _backend_'s endpoint in the `BrowserWindow`.
33
36
@@ -43,6 +46,11 @@ This repository contains the main code, but two more repositories are included d
43
46
-[vscode-arduino-tools](https://github.com/arduino/vscode-arduino-tools): provides support for the language server and the debugger
44
47
-[arduino-language-server](https://github.com/arduino/arduino-language-server): provides the language server that parses Arduino code
45
48
49
+
## Prerequisites
50
+
51
+
- To build the application, follow the Theia IDE [prerequisites](https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisites).
52
+
- This project recommends using [Visual Studio Code (VS Code)](https://code.visualstudio.com/) for the development.
53
+
46
54
## Build from source
47
55
48
56
---
@@ -61,56 +69,57 @@ Once you have all the tools installed, you can build the editor following these
61
69
62
70
If you want to develop the application, do the following:
63
71
64
-
1. Install the dependencies
72
+
1. Clone the project from Git and change directory to the `arduino-ide` folder:
> **ⓘ** For more details on how to start VS Code form the command line, see [here](https://code.visualstudio.com/docs/editor/command-line#_launching-from-command-line).
101
+
102
+
5. Rebuild the native dependencies for electron
71
103
72
104
- <kbd>Ctrl/⌘</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> to open the _Command Palette_.
73
105
- Type `Tasks: Run Task` and press <kbd>Enter</kbd>.
74
106
- Type `Rebuild App` and press <kbd>Enter</kbd>.
75
107
- Wait for the "Rebuild App" task to finish, as indicated by a "✔ Rebuild Complete" message in the Terminal.
76
108
77
-
3. Start the TypeScript compiler + `webpack` in watch mode
109
+
6. Start the TypeScript compiler + `webpack` in watch mode
- Type `Tasks: Run Task` and press <kbd>Enter</kbd>.
81
113
- Type `Watch All` and press <kbd>Enter</kbd>.
82
114
- Select how you want to scan the task output. You can press <kbd>Enter</kbd> or <kbd>Esc</kbd>. [Click](https://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher) here to learn more.
83
115
84
-
4. Start the application in debug mode
116
+
7. Start the application in debug mode
85
117
- Open the _Run and Debug_ view with <kbd>Ctrl/⌘</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>,
86
118
- Select `App` from the dropdown,
87
119
- Start debugging with <kbd>F5</kbd>.
88
120
89
121
If you change the backend application, you must restart the electron app in debug mode to use the changes.
90
-
If you change the frontend application, it's sufficient to reload the board window with _Reload Windows_ command from the _Command Palette_.
91
-
92
-
## Running Checks
93
-
94
-
To run the tests, you must rebuild the native dependencies for the browser target. See [this](https://github.com/arduino/arduino-ide/pull/1823#issuecomment-1400511031) for the technical explanation.
95
-
96
-
1. Rebuild the native dependencies for the browser
97
-
98
-
```sh
99
-
yarn rebuild:browser
100
-
```
101
-
102
-
2. To run the tests
103
-
104
-
```sh
105
-
yarn test
106
-
```
107
-
108
-
3. To run the slow tests
109
-
```sh
110
-
yarn test:slow
111
-
```
112
-
113
-
If you want to debug an individual file, open the test module (`*.test.ts` or `*.slow-test.ts`), open the _Run and Debug_ view, select the `Run Test [current]` and press <kbd>F5</kbd>.
122
+
If you change the frontend application, it's sufficient to reload the board window with _Reload Window_ command from the _Command Palette_.
114
123
115
124
### Bundle the Application
116
125
@@ -133,40 +142,63 @@ If you want to bundle the application, execute the followings:
133
142
yarn --cwd electron-app package
134
143
```
135
144
136
-
137
145
### Notes for Windows contributors
146
+
138
147
Windows requires the Microsoft Visual C++ (MSVC) compiler toolset to be installed on your development machine.
139
148
140
149
In case it's not already present, it can be downloaded from the "**Tools for Visual Studio 20XX**" section of the Visual Studio [downloads page](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) via the "**Build Tools for Visual Studio 20XX**" (e.g., "**Build Tools for Visual Studio 2022**") download link.
141
150
142
151
Select "**Desktop development with C++**" from the "**Workloads**" tab during the installation procedure.
143
152
144
-
### CI
153
+
##Running Checks
145
154
146
-
This project is built on [GitHub Actions](https://github.com/arduino/arduino-ide/actions).
155
+
To run the tests, you must rebuild the native dependencies for the browser target. See [this](https://github.com/arduino/arduino-ide/pull/1823#issuecomment-1400511031) for the technical explanation.
156
+
157
+
1. Rebuild the native dependencies for the browser
147
158
148
-
-_Snapshot_ builds run when changes are pushed to the `main` branch, or when a PR is created against the `main` branch. For the sake of the review and verification process, the build artifacts for each operating system can be downloaded from the GitHub Actions page.
149
-
-_Nightly_ builds run every day at 03:00 GMT from the `main` branch.
150
-
-_Release_ builds run when a new tag is pushed to the remote. The tag must follow the [semver](https://semver.org/). For instance, `1.2.3` is a correct tag, but `v2.3.4` won't work. Steps to trigger a new release build:
151
-
- Create a local tag:
152
-
```sh
153
-
git tag -a 1.2.3 -m "Creating a new tag for the `1.2.3` release."
154
-
```
155
-
- Push it to the remote:
156
159
```sh
157
-
git push origin 1.2.3
160
+
yarn rebuild:browser
158
161
```
159
162
163
+
2. To run the tests
164
+
165
+
```sh
166
+
yarn test
167
+
```
168
+
169
+
3. To run the slow tests
170
+
```sh
171
+
yarn test:slow
172
+
```
173
+
174
+
If you want to debug an individual file, open the test module (`*.test.ts` or `*.slow-test.ts`), open the _Run and Debug_ view, select the `Run Test [current]` and press <kbd>F5</kbd>.
175
+
176
+
### CI
177
+
178
+
This project is built on [GitHub Actions](https://github.com/arduino/arduino-ide/actions).
179
+
180
+
-_Snapshot_ builds run when changes are pushed to the `main` branch, or when a PR is created against the `main` branch. For the sake of the review and verification process, the build artifacts for each operating system can be downloaded from the GitHub Actions page.
181
+
-_Nightly_ builds run every day at 03:00 GMT from the `main` branch.
182
+
-_Release_ builds run when a new tag is pushed to the remote. The tag must follow the [semver](https://semver.org/). For instance, `1.2.3` is a correct tag, but `v2.3.4` won't work. Steps to trigger a new release build:
183
+
- Create a local tag:
184
+
```sh
185
+
git tag -a 1.2.3 -m "Creating a new tag for the `1.2.3` release."
186
+
```
187
+
- Push it to the remote:
188
+
```sh
189
+
git push origin 1.2.3
190
+
```
191
+
160
192
## FAQ
161
193
162
-
**Can I manually change the version of the [`arduino-cli`](https://github.com/arduino/arduino-cli/) used by the IDE?*
194
+
-_Can I manually change the version of the [`arduino-cli`](https://github.com/arduino/arduino-cli/) used by the IDE?_
163
195
164
-
Yes. It is possible but not recommended. The CLI exposes a set of functionality via [gRPC](https://github.com/arduino/arduino-cli/tree/master/rpc) and the IDE uses this API to communicate with the CLI. Before we build a new version of IDE, we pin a specific version of CLI and use the corresponding `proto` files to generate TypeScript modules for gRPC. This means, a particular version of IDE is compliant only with the pinned version of CLI. Mismatching IDE and CLI versions might not be able to communicate with each other. This could cause unpredictable IDE behavior.
196
+
Yes. It is possible but not recommended. The CLI exposes a set of functionality via [gRPC](https://github.com/arduino/arduino-cli/tree/master/rpc) and the IDE uses this API to communicate with the CLI. Before we build a new version of IDE, we pin a specific version of CLI and use the corresponding `proto` files to generate TypeScript modules for gRPC. This means, a particular version of IDE is compliant only with the pinned version of CLI. Mismatching IDE and CLI versions might not be able to communicate with each other. This could cause unpredictable IDE behavior.
165
197
166
-
**I have understood that not all versions of the CLI are compatible with my version of IDE but how can I manually update the `arduino-cli` inside the IDE?*
198
+
-_I have understood that not all versions of the CLI are compatible with my version of IDE but how can I manually update the `arduino-cli` inside the IDE?_
167
199
168
-
[Get](https://arduino.github.io/arduino-cli/installation) the desired version of `arduino-cli`for your platform and manually replace the one inside the IDE. The CLI can be found inside the IDE at:
[Get](https://arduino.github.io/arduino-cli/installation) the desired version of `arduino-cli` for your platform and manually replace the one inside the IDE. The CLI can be found inside the IDE at:
0 commit comments