Skip to content
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

Support 'browser-only' Theia #12853

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

sdirix
Copy link
Member

@sdirix sdirix commented Aug 22, 2023

image

Adds tooling, adapts the current code base and provides an example application for the new 'browser-only' Theia application target. This target generates a Theia frontend application which can run without a backend, transforming the Theia application to a static site.

Implements #12852

What it does

Adapts tooling to:

  • support new 'browser-only' application target
  • support new 'frontendOnly' and 'frontendOnlyPreload' module declaration
  • use http-server when starting 'browser-only' applications

Replaces backend services with browser-only variants

  • implementation of BrowserFS-based filesystem
  • implementation of 'ServiceConnectionProvider' which timeouts for all requests, enabling loading all Theia packages

Adds a browser-only example application and api-samples showcasing the customization of the new BrowserFS-based filesystem.

How to test

Build and run the 'browser-only' Theia example.

You can also find a hosted variant here.

Note that you can build the 'browser-only' Theia even without building the Node native parts via:

yarn install --ignore-scripts
yarn browser-only prepare:no-native
yarn browser-only build

Review checklist

Reminder for reviewers

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works really well. Good job 👍

I have a few remarks and questions on some of the changes here though.

dev-packages/cli/src/theia.ts Outdated Show resolved Hide resolved
dev-packages/application-package/src/application-props.ts Outdated Show resolved Hide resolved
examples/browser-only/webpack.config.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@sdirix
Copy link
Member Author

sdirix commented Dec 8, 2023

We're currently working on updating the branch on the latest state of master as well as incorporating the feedback of @msujew. I'll ping you once it's ready to be reviewed again.

@sdirix sdirix force-pushed the browser-only-theia branch 4 times, most recently from 31e754f to c9dfb70 Compare December 22, 2023 10:18
@sdirix
Copy link
Member Author

sdirix commented Dec 22, 2023

Hi @msujew,
Thanks again for your review! I updated the PR to the latest state of Theia and integrated all your review comments.

The license check complains about browserfs although it's MIT licensed. Do you know why this is the case and how we can resolve the issue?

@msujew
Copy link
Member

msujew commented Dec 23, 2023

@sdirix I had to trigger the license harvesting manually on clearlydefined.io. It's now correctly recognized 👍

I'll take another look at this PR once I'm back from vacation (second week of January).

@JonasHelming
Copy link
Contributor

@msujew could we maybe get this in for January?

@paulalexwilson
Copy link

The landscape of theia plugin types and deployment modes is feeling somewhat complex from a relative outsider looking in:

  • Theia Extensions
  • Theia Plugins (deprecated?)
  • VS Code Extensions
  • Headless (Daemon?) Plugins
  • FrontendOnly Mode

It would be great if this PR also added some statement around how this interacts with existing plugin/extension types and what limitations exist.

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, looks good to me.

@msujew
Copy link
Member

msujew commented Jan 16, 2024

@paulalexwilson I don't think that the documentation change makes sense in the scope of this PR. Feel free to create a separate issue though, and someone might pick it up. Note that in general, the browser-only Theia version is supposed to eventually support all features of Theia that are possible without a dedicated backend (which is basically everything except for running a terminal). See #12852 for open tasks and further discussion.

Adds tooling, adapts the current code base and provides an example application for the
new 'browser-only' Theia application target. This target generates a Theia frontend
application which can run without a backend, transforming the Theia application to a
static site.

Adapts tooling to:
- support new 'browser-only' application target
- support new 'frontendOnly' and 'frontendOnlyPreload' module declarations
- use http-server when starting 'browser-only' applications

Replaces backend services with browser-only variants
- implementation of BrowserFS-based filesystem
- implementation of 'ServiceConnectionProvider' which timeouts for all requests,
  enabling loading all Theia packages

Adds a browser-only example application and api-samples showcasing the customization of
the new BrowserFS-based filesystem.

Co-authored-by: Alexandra Buzila <[email protected]>
Co-authored-by: Stefan Dirix <[email protected]>
Co-authored-by: Tobias Ortmayr <[email protected]>
Co-authored-by: Eugen Neufeld <[email protected]>
@sdirix
Copy link
Member Author

sdirix commented Jan 16, 2024

I rebased on latest master to get rid of the conflict in the Changelog. No further changes were done.

@msujew msujew merged commit 6f01be5 into eclipse-theia:master Jan 16, 2024
14 checks passed
@sdirix sdirix deleted the browser-only-theia branch January 16, 2024 14:05
@erlmachinedev
Copy link

erlmachinedev commented Jan 21, 2024

@sdirix Thanks for the valuable contribution 👍 I just tested the feature from 56cf3db but I see no syntax highlighting for Lua, json, etc..

Probably the default language setup should work well (even without extensions). The file icon type is fetched properly and indicated at the explorer tab but the Monaco editor seems doesn't highlight syntax yet.

Screen Shot 2024-01-21 at 10 23 35 PM Screen Shot 2024-01-21 at 10 24 38 PM

The same issue is present on the demo app https://minimal--browseronly-theia.netlify.app/#

P.S. If there is a need to attach dedicated issue (supported by reproduction steps), please let me know. I guess the issue is that syntax highlighting for the most common languages should work "from a box" (see the next screenshot).

Screen Shot 2024-01-21 at 10 30 57 PM

@msujew
Copy link
Member

msujew commented Jan 21, 2024

@erlmachinedev Given that all syntax highlighting is currently exclusively contributed by vscode extensions, this is expected behavior. This will work as usual once extension support will be added. I think we won't support dedicated syntax highlighting for the browser-only mode, as it's just as much work as adding real support for vscode extensions.

@sdirix
Copy link
Member Author

sdirix commented Jan 22, 2024

Hi @erlmachinedev,
Thanks for your interest in "browser-only" Theia. This feature is currently in a MVP state: It can already be used to build applications, however there are many missing features compared to regular Theia. I updated the original issue (#12852) with the current state and a list of missing features.

@jfaltermeier jfaltermeier added this to the 1.46.0 milestone Jan 25, 2024
@robertjndw robertjndw mentioned this pull request Sep 4, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants