Skip to content

[NO_MERGE][WIP] Startup time #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
db26148
Dropped Git and the custom layout restorer.
May 20, 2022
5da4b1a
duration decorator.
May 20, 2022
986d597
get ws root withot check.
May 20, 2022
8c95086
Enabled `noImplicitOverride` TS option.
May 20, 2022
307546c
Switched to sketchRef for examples and builtins.
May 20, 2022
77d7416
can disable splash.
May 21, 2022
99caaa8
speed up examples load.
May 21, 2022
9301121
disabled old way of computing the examples.
May 21, 2022
23a1693
do not resolve all sketches as possible ws roots.
May 21, 2022
ba1ff1a
Generate bultin examples structure at build time.
May 21, 2022
5cecaab
load the list widget content only when activated.
May 23, 2022
6179300
reimpl. discovering sketches from the sketchbook
May 23, 2022
17b5646
dropped old way of calculating sketchbook content
May 23, 2022
7e5be19
fixed typo in logs.
May 23, 2022
cf17ce1
changed how to init cli config service.
May 23, 2022
61279fe
run update after show.
May 24, 2022
3e583a7
fall back to new temp sketch URI when no recent WS
May 24, 2022
d5fabc1
customized JSON schema store, editor navigation history, and preferen…
May 24, 2022
fdca524
launch config to start with dev tools + w/o splash
May 24, 2022
dbf635a
defer all menu updates before app is ready.
May 24, 2022
7ccb92b
do not parse the CLI log JSON, use as is.
May 24, 2022
67a456d
fixed port for the LS.
May 24, 2022
dc3b748
deferred contributions to start on app ready.
May 24, 2022
ab163a5
disabled "trick" for deferring menu update.
May 24, 2022
469159e
updated translation files.
May 24, 2022
08f6b27
i18n fixup.
May 24, 2022
c81d1c5
removed native grpc dependencies.
May 24, 2022
71bbeda
Can start the IDE with content tracing.
May 25, 2022
ad76045
Skip loading extensions for the Theia about dialog
May 25, 2022
47620ef
Defer running the FW updates.
May 25, 2022
bc3aee6
Do not require the current window on IDE2 start.
May 25, 2022
313c96c
Do not explicitly initialize the layout on start.
May 25, 2022
68afacf
Added missing protobuf dep.
May 27, 2022
c7f2f4f
asynchronous core and lib index update.
May 27, 2022
e27b9f1
:lipstick: improved dev comments.
May 27, 2022
79503ef
removed debug log.
May 27, 2022
8ffee32
run core and lib index updates parallel.
May 27, 2022
efe7399
Use nightly (20220527) CLI and 2.2.0 FW uploader.
May 27, 2022
05af641
Defer loading boards until the app is ready.
May 27, 2022
b947be0
Open devtools when tracing.
May 27, 2022
2fbf3cb
Resolve and cache current sketch.
May 27, 2022
0e4881c
Reverted titleBarStyling for Windows/Linux.
May 31, 2022
644bf14
workaround for the non realpath.
May 31, 2022
ab56005
Relaxed prettier on Windows.
Jun 1, 2022
8a04d47
Workaround for non-realpaths on Windows.
Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ yarn*.log
plugins
# the config files for the CLI
arduino-ide-extension/data/cli/config
# content trace files for electron
electron-app/traces
40 changes: 38 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "App (Electron) [Dev]",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd",
},
"cwd": "${workspaceFolder}/electron-app",
"args": [
".",
"--log-level=debug",
"--hostname=localhost",
"--no-cluster",
"--app-project-path=${workspaceRoot}/electron-app",
"--remote-debugging-port=9222",
"--no-app-auto-install",
"--plugins=local-dir:../plugins",
"--hosted-plugin-inspect=9339",
"--nosplash",
"--content-trace",
"--open-devtools"
],
"env": {
"NODE_ENV": "development"
},
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/electron-app/src-gen/backend/*.js",
"${workspaceRoot}/electron-app/src-gen/frontend/*.js",
"${workspaceRoot}/electron-app/lib/**/*.js",
"${workspaceRoot}/arduino-ide-extension/lib/**/*.js",
"${workspaceRoot}/node_modules/@theia/**/*.js"
],
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"outputCapture": "std"
},
{
"type": "node",
"request": "launch",
Expand All @@ -10,7 +48,6 @@
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd",
},
"cwd": "${workspaceFolder}/electron-app",
"protocol": "inspector",
"args": [
".",
"--log-level=debug",
Expand Down Expand Up @@ -78,7 +115,6 @@
{
"type": "node",
"request": "launch",
"protocol": "inspector",
"name": "Run Test [current]",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": [
Expand Down
18 changes: 9 additions & 9 deletions arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
"test:watch": "mocha --watch --watch-files lib \"./lib/test/**/*.test.js\""
},
"dependencies": {
"@grpc/grpc-js": "^1.3.7",
"@grpc/grpc-js": "^1.6.7",
"@theia/application-package": "1.25.0",
"@theia/core": "1.25.0",
"@theia/editor": "1.25.0",
"@theia/editor-preview": "1.25.0",
"@theia/electron": "1.25.0",
"@theia/filesystem": "1.25.0",
"@theia/git": "1.25.0",
"@theia/keymaps": "1.25.0",
"@theia/markers": "1.25.0",
"@theia/monaco": "1.25.0",
Expand All @@ -45,7 +44,7 @@
"@types/btoa": "^1.2.3",
"@types/dateformat": "^3.0.1",
"@types/deepmerge": "^2.2.0",
"@types/glob": "^5.0.35",
"@types/glob": "^7.2.0",
"@types/google-protobuf": "^3.7.2",
"@types/js-yaml": "^3.12.2",
"@types/keytar": "^4.4.0",
Expand All @@ -63,14 +62,15 @@
"atob": "^2.1.2",
"auth0-js": "^9.14.0",
"btoa": "^1.2.1",
"css-element-queries": "^1.2.0",
"dateformat": "^3.0.3",
"deepmerge": "2.0.1",
"deep-equals": "^0.0.2",
"deep-object-diff": "^1.1.7",
"deep-sort-object": "^1.0.2",
"electron-updater": "^4.6.5",
"fuzzy": "^0.1.3",
"fast-safe-stringify": "^2.1.1",
"glob": "^7.1.6",
"google-protobuf": "^3.11.4",
"grpc": "^1.24.11",
"google-protobuf": "^3.20.1",
"hash.js": "^1.1.7",
"is-valid-path": "^0.1.1",
"js-yaml": "^3.13.1",
Expand Down Expand Up @@ -157,10 +157,10 @@
],
"arduino": {
"cli": {
"version": "0.21.0"
"version": "20220527"
},
"fwuploader": {
"version": "2.0.0"
"version": "2.2.0"
},
"clangd": {
"version": "13.0.0"
Expand Down
105 changes: 84 additions & 21 deletions arduino-ide-extension/scripts/download-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,93 @@
const version = '1.9.1';

(async () => {
const os = require('os');
const { promises: fs } = require('fs');
const path = require('path');
const shell = require('shelljs');
const { v4 } = require('uuid');

const os = require('os');
const path = require('path');
const shell = require('shelljs');
const { v4 } = require('uuid');
const repository = path.join(os.tmpdir(), `${v4()}-arduino-examples`);
if (shell.mkdir('-p', repository).code !== 0) {
shell.exit(1);
}

const repository = path.join(os.tmpdir(), `${v4()}-arduino-examples`);
if (shell.mkdir('-p', repository).code !== 0) {
shell.exit(1);
process.exit(1);
}

if (shell.exec(`git clone https://github.com/arduino/arduino-examples.git ${repository}`).code !== 0) {
shell.exit(1);
process.exit(1);
}
if (
shell.exec(
`git clone https://github.com/arduino/arduino-examples.git ${repository}`
).code !== 0
) {
shell.exit(1);
}

if (shell.exec(`git -C ${repository} checkout tags/${version} -b ${version}`).code !== 0) {
shell.exit(1);
process.exit(1);
}
if (
shell.exec(`git -C ${repository} checkout tags/${version} -b ${version}`)
.code !== 0
) {
shell.exit(1);
}

const destination = path.join(__dirname, '..', 'Examples');
shell.mkdir('-p', destination);
shell.cp('-fR', path.join(repository, 'examples', '*'), destination);
const destination = path.join(__dirname, '..', 'Examples');
shell.mkdir('-p', destination);
shell.cp('-fR', path.join(repository, 'examples', '*'), destination);

const isSketch = async (pathLike) => {
try {
const names = await fs.readdir(pathLike);
const dirName = path.basename(pathLike);
return names.indexOf(`${dirName}.ino`) !== -1;
} catch (e) {
if (e.code === 'ENOTDIR') {
return false;
}
throw e;
}
};
const examples = [];
const categories = await fs.readdir(destination);
const visit = async (pathLike, container) => {
const stat = await fs.lstat(pathLike);
if (stat.isDirectory()) {
if (await isSketch(pathLike)) {
container.sketches.push({
name: path.basename(pathLike),
relativePath: path.relative(destination, pathLike),
});
} else {
const names = await fs.readdir(pathLike);
for (const name of names) {
const childPath = path.join(pathLike, name);
if (await isSketch(childPath)) {
container.sketches.push({
name,
relativePath: path.relative(destination, childPath),
});
} else {
const child = {
label: name,
children: [],
sketches: [],
};
container.children.push(child);
await visit(childPath, child);
}
}
}
}
};
for (const category of categories) {
const example = {
label: category,
children: [],
sketches: [],
};
await visit(path.join(destination, category), example);
examples.push(example);
}
await fs.writeFile(
path.join(destination, 'examples.json'),
JSON.stringify(examples, null, 2),
{ encoding: 'utf8' }
);
shell.echo(`Generated output to ${path.join(destination, 'examples.json')}`);
})();
Loading