Here is the procedure to follow to update Dockside to run the latest version of Theia.
- Find the latest version of Theia e.g.
1.35.0via the Eclipse Theia GitHub website (https://github.com/eclipse-theia/theia). - Inside a clone of the Dockside repo, duplicate the latest Theia folder inside
ide/theiaand rename it to the new Theia version i.e.1.35.0 - Inside the
buildsubdirectory of1.35.0- Delete
yarn.lock. - Inside the
patchesdirectory, rename each file, changing references to the old Theia version to the new Theia version. - In
package.json:- Update references to the old Theia version to the new version.
- Audit the list of dependencies to ensure that every dependency referenced in the upstream new Theia version (at e.g. https://github.com/eclipse-theia/theia/blob/release/1.35.0/examples/browser/package.json) is referenced in your
package.jsonwith the exception of:- @theia/api-samples
- @theia/memory-inspector
- Delete
- Update
Dockerfileto reference the new Theia version for supported platforms. - Build a test image locally (see below):
- Resolve any build issues. e.g. You may need to upgrade the version of Node specified in the
Dockerfile, or re-implement the patches. - Test the image to ensure all patched functionality is working correctly
- Resolve any build issues. e.g. You may need to upgrade the version of Node specified in the
- Finally, when everything is tested and working, copy
yarn.lockfrom the test image to the same Theiabuildsubdirectory as contains the newpackage.json(i.e.ide/theia/1.35.0/build). - Don't forget to update the
READMEfile to describe the patches, should any patch files have been deleted or added.
The process for reimplementing Theia patches involves launching Theia, developing the necessary code changes to reimplement the desired functionality, and then regenerating the patches.
- Build a Theia image using:
(N.B. If you are developing on another platform architecture, adjust the command accordingly.)
./build/build.sh --builder buildkit --platform linux/amd64 --stage theia-build
- Launch Theia using:
docker run --name=my-theia-build -it -p 80:3131 newsnowlabs/dockside:theia-build
- Open Theia at http://localhost/ and begin debugging and development:
- Modify Theia javascript files (not typescript, though it can be useful to look at the typescript files to understand the javascript files).
- Rebuild the Theia javascript bundle using:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 && NODE_OPTIONS="--max_old_space_size=4096" && yarn config set network-timeout 600000 -g && yarn
- Reload Theia in your browser (assuming client-side code patches only) and/or stop/start the Theia backend by stopping and starting
my-theia-build(assuming server-side code has been touched). - Test your changes to ensure they deliver the desired functionality (see below).
- Lastly, regenerate
patch-packagepatch files, replacing<package>with the name of the relevant Theia package (e.g.@theia/core,@theia/application-manageror@theia/plugin-ext) using:apk add git; yarn patch-package <package>
- Finally, the
yarn.lockfile you need is the one present in themy-theia-buildcontainer home directory. You can copy it to theide/theia/<version>/builddirectory of your repo, assuming you are already in that directory, using:docker cp my-theia-build:/opt/dockside/theia/theia/yarn.lock .
In order to test that the Dockside Theia patches exhibit the desired functionality, you'll need to launch a test instance of Dockside, from a test image. See Building a Dockside image or Building a Dockside production image.
Perform the following steps within the IDE of a devtainer launched from a test Dockside image using the Dockside (IDE from image) profile:
- Install the Git Graph extension
- View > Extensions
- Search for 'Git Graph'
- Click 'Install'
- Run command
Git Graph: Add Git Repository, select thedocksidefolder and clickOpen. - Run command
Git Graph: View Git Graph (git log). - Confirm that the Git Graph git log display opens up.
Perform the following steps within Theia running inside the my-theia-build test image:
- Confirm that the title of the browser window is of the form
[devtainer] - theia - Theia for Dockside from NewsNow Labs.
Perform the following steps within the IDE of a devtainer launched from a test Dockside image using the Dockside (IDE from image) profile:
- Launch the test image, log in and launch a test devtainer from any profile.
- Confirm that the title of the brown's a window is of the form
<devtainer name> - <open file> - <workspace> - Theia for Dockside from NewsNow Labs.