Skip to content

Commit

Permalink
update Electron dependencies, pin [email protected]
Browse files Browse the repository at this point in the history
Also ran yarn upgrade, to also update the other dependencies in the repo that
might benefit, following the update of the Electron-related dependencies.

With recent Theia, the rebuilding of the native dependencies for Electron
does not work unless dependency "nan" is pinned to v2.18.0. For that reason,
that dependency is added to this repo's root package.json's resolutions block.

This issue highlighted that we do not perform a full build of the Electron app
by default, leaving the rebuilding of the native dependencies (theia rebuild ...)
to be done before starting the Electron app or packaging it. In consequence,
it took a while to notice there was a problem with Electron once we upgraded to
Theia v1.52.0.

To address the above, I propose we adopt a way to build similar to what's used
in Theia Blueprint and other Theia apps where both browser and electron are
present: always rebuild the native dependencies as part of the base build. Also,
in the rebuild command, use the current directory as "cache-root" so that both
versions of the native dependencies modules can co-exist on disk, and need not be
rebuilt / reverted  each time we switch from one version of the example app to the
other, as it is today. This adds ~30s to the build (running "yarn" in the repo root),
but also permits to omit calling "rebuild" on the apps, e.g. before starting them.

Alo, update Jest test snapshots - there is a slight difference in the generated
HTML code following the minor ag-grid update in this commit.

Signed-off-by: Marc Dumais <[email protected]>
  • Loading branch information
marcdumais-work committed Sep 20, 2024
1 parent b7b0bcb commit 1915c36
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 405 deletions.
4 changes: 2 additions & 2 deletions examples/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
},
"scripts": {
"prepare": "yarn build",
"build": "theia build --mode development",
"rebuild": "theia rebuild:browser --cacheRoot ../..",
"build": "yarn -s rebuild && theia build --mode development",
"rebuild": "theia rebuild:browser --cacheRoot .",
"start": "TRACE_SERVER_PATH=../../trace-compass-server/tracecompass-server theia start",
"watch": "theia build --watch --mode development"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/electron/electron-builder.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
electronVersion: 23.6.0
electronVersion: 28.3.3
electronDist: ../../node_modules/electron/dist
productName: Theia Trace Example Application
appId: theia-trace-example
Expand Down
6 changes: 3 additions & 3 deletions examples/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"devDependencies": {
"@theia/cli": "1.52.0",
"electron": "^28.2.8",
"electron-builder": "~23.6.0"
"electron-builder": "~24.13.0"
},
"scripts": {
"prepare": "yarn build",
"build": "theia build --mode development",
"rebuild": "theia rebuild:electron --cacheRoot ../..",
"build": "yarn -s rebuild && theia build --app-target=\"electron\" --mode development",
"rebuild": "theia rebuild:electron --cacheRoot .",
"start": "TRACE_SERVER_PATH=../../trace-compass-server/tracecompass-server theia start",
"watch": "theia build --watch --mode development",
"clean:dist": "rimraf dist",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"tswatch": "tsc -b -w",
"clean": "lerna run clean",
"build:examples": "yarn browser build && yarn electron build",
"start:browser": "yarn browser rebuild && yarn browser start",
"start:electron": "yarn electron rebuild && yarn electron start",
"start:browser": "yarn browser start",
"start:electron": "yarn electron start",
"download:sample-traces": "curl -o TraceCompassTutorialTraces.tgz https://raw.githubusercontent.com/tuxology/tracevizlab/master/labs/TraceCompassTutorialTraces.tgz; tar -xf TraceCompassTutorialTraces.tgz",
"download:server": "curl -o trace-compass-server.tar.gz https://download.eclipse.org/tracecompass.incubator/trace-server/rcp/trace-compass-server-latest-linux.gtk.x86_64.tar.gz; tar -xf trace-compass-server.tar.gz",
"start:server": "./trace-compass-server/tracecompass-server",
Expand Down Expand Up @@ -48,7 +48,7 @@
},
"homepage": "https://github.com/eclipse-cdt-cloud/theia-trace-extension",
"resolutions": {
"msgpackr": "^1.10.1"
"**/nan": "2.18.0"
},
"devDependencies": {
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ exports[`<TableOutputComponent /> Renders AG-Grid table with provided props & st
<div
aria-colcount="0"
aria-rowcount="-1"
class="ag-root ag-unselectable ag-layout-normal"
class="ag-root ag-unselectable ag-layout-normal ag-body-vertical-content-no-gap ag-body-horizontal-content-no-gap"
role="treegrid"
>
<div
Expand Down
Loading

0 comments on commit 1915c36

Please sign in to comment.