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

Transpile Theia to ES6 #18

Closed
wants to merge 36 commits into from
Closed

Transpile Theia to ES6 #18

wants to merge 36 commits into from

Conversation

sgraband
Copy link

@sgraband sgraband commented Apr 27, 2021

What it does

This is is a work-in-progress PR for transpiling Theia to es6. To continue supporting es5 based VSCode extensions, the @es5ClassCompat tag was used.

The tag was also applied to be used with Theia es5 plugins. This is however yet to be tested.

We would like to gather feedback while tackling the remaining issues, so feel free to comment on this PR!

Open issues:

  • The @es5ClassCompat tag is not working for all of the classes in types-impl.ts
    The tag is failing on Location and DiagnosticRelatedInformation because of an Cannot access Location before its initialization error
    Applying the tag to CodeLens, TreeItem, ProgressExecution, ShellExecution and DebugAdapterExecutable will result in a Can't resolve @theia/plugin ERROR.
  • In targeting es6 as a base (without transpiling to es5) eclipse-theia/theia#5902 it was mentioned that there could be issues with phosphorjs and inversifyjs, however we could not find any regressions while testing. This may need some further research.
  • Test support for es5 Theia plugins.

Contributed on behalf of STMicroelectronics
Signed-off-by: Simon Graband [email protected]

How to test

To test the support for es5 VSCode extensions, you can try out one of the extensions described here: microsoft/vscode#68698.

Review checklist

Reminder for reviewers

@sdirix sdirix requested a review from tortmayr April 28, 2021 11:55
Copy link

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

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

Changes look good to me and everything seems to work as expected after the update to es6.
I have only have a few minor suggestions. Regarding the usage, or rather avoidance of the !-operator

@tortmayr tortmayr self-requested a review April 30, 2021 10:44
@sdirix sdirix changed the title Transpile theia to ES6 Transpile Theia to ES6 May 4, 2021
@sgraband sgraband force-pushed the es6-migration branch 4 times, most recently from c79a1f6 to e2bf52d Compare May 11, 2021 07:56
@sgraband sgraband force-pushed the es6-migration branch 3 times, most recently from bede031 to 286ee01 Compare June 22, 2021 10:14
@sgraband sgraband force-pushed the es6-migration branch 6 times, most recently from 5e5f6e1 to f7b2b4c Compare July 8, 2021 06:39
@sgraband sgraband force-pushed the es6-migration branch 2 times, most recently from e6f4f4a to 105146d Compare July 23, 2021 07:27
@sgraband sgraband force-pushed the es6-migration branch 5 times, most recently from 4d283b8 to d036518 Compare August 9, 2021 11:14
EstherPerelman and others added 3 commits August 10, 2021 11:01
The CLI parsing logic is broken in `@theia/cli`. The help doesn't show
the right information.

The issue comes from using `yargs` at the script level in some places,
leading to corrupt global `yargs` state.

This commit refactors code around so that `--help` works as expected.

`theia start --help` now display's the target application's CLI help
rather than `theia`'s help.
The commit updates the following dependencies:
- `@electron/get`: updates the outdated `electron-download` dependency
  to the newer `@electron/get` dependency, and adjust the code to
perform the `ffmpeg` replacement.
- `css-loader`: updated to newest version which supports webpack 5, and
  includes security updates.

Signed-off-by: vince-fugnitto <[email protected]>
AirSeeker and others added 27 commits August 16, 2021 11:57
The commit updates `menus` to not fail the layout when there are no
commands attached to them, and instead log the error. Previously, if a
command was unregistered and a command referenced it the layout would
fail, and possibly also fail to start the application.

The change also includes:
- a bogus menu registration in `api-samples` to verify the feature in the future.
- an api test to verify that registration does not fail for menus with invalid commands.

Signed-off-by: vince-fugnitto <[email protected]>
…ia#9727)

Refactor to hide VS Code interfaces behind core services

Signed-off-by: Thomas Mäder <[email protected]>
The commit fixes the `quick-command` behavior which would not display
the list of recently used commands properly when users would use the
`quick-command` + type the prefix value, instead of triggering the
command directly. The change refactors the code to perform the `reset`
when we trigger the picks so we pick up the latest commands available.

Signed-off-by: vince-fugnitto <[email protected]>
Due to incorrect `scm` tree view after executing file actions (like `stage`/`unstage`),
Added `onDidChangeResources` listener to the `scm` provider which recreates `scm` tree on every resource change.

Signed-off-by: Esther Perelman <[email protected]>
Fixes: eclipse-theia#9927

The commit fixes a broken link in the `@theia/keymaps` readme.
The fix includes updating the link to point to our documentation site which is not subject to change as frequently as referencing code directly.

Signed-off-by: Jonas Helming <[email protected]>
The commit refactors the binding of preference schemas so they can be
easily rebinding by downstream extenders and applications if necessary.

Signed-off-by: vince-fugnitto <[email protected]>
The commit updates the `file-search` api-tests (integration) by testing the following:

- verify `fileAndRange` property by default, and once a search is performed.
- verify that `splitFilterAndRange` successfully handles different input value combinations.
The commit updates the font-family for both the input and result label
in the `find-widget` (embedded file-search) in the monaco editor. The
change updates the font-family like the rest of the application for
consistency (and aligns with vscode) rather than using the default
monospaced font.

Signed-off-by: vince-fugnitto <[email protected]>
The commit updates the styling of the `quick-input` to restore the
drop-shadow which was previously present (and present in vscode)
following the monaco upgrade.

Signed-off-by: vince-fugnitto <[email protected]>
Signed-off-by: Rohan Sharma <[email protected]>
The commit includes updates to both `filterItems` and `findMatches` in
order to make them both `fuzzy` supported.

The method `filterItems` which is used to filter a list of
quick-pick-items based on a filter is now responsible for filtering
items based on `fuzzy` by an item's `label`, `description` or `detail`
(previously only substring `label` matches). The method will now also
properly reset highlights on subsequent filtering, and will apply the
proper highlighting based on which item property it matched against.

The method `findMatches` was also updated in order to support fuzzy, and
it will now properly compute highlights and no longer compute them only
if they are substring matches.

The commit also includes test-cases to verify the behavior of both
methods under different conditions and edge-cases.

Signed-off-by: vince-fugnitto <[email protected]>
Using Node's builtin require function to dynamically import scripts
makes bundling Node apps difficult when using tools like Webpack.

Add a new package `@theia/dynamic-require`: This is a minimal package
that re-export a function wrapping Node's require. The purpose of this
is to factorize dynamic requires into a single package to make bundling
easier.

Remove as many occurences of Node require and replace the few required
ones with `@theia/dynamic-require`.

Add a new eslint rule `import/no-dynamic-require` to help detect places
that would benefit from `@theia/dynamic-require`.
Refactor the code to upload files via HTTP rather than WS. This
simplifies the code by removing the ad-hoc WS upload protocol and should
make it easier to configure proxies as it will be using good ol' HTTP.

Note 1: The file upload is done over HTTP POST `multipart/form-data`.

Note 2: I had to use the older XMLHttpRequest (XHR/AJAX) API in order to
monitor the upload progress. The Fetch API is not there yet.

Add new preference `files.maxConcurrentUploads` that defaults to 1 as it
seems to the be fastest on my test environment. Can be user-customized.

Use `async-mutex` semaphores in order to throttle uploads. `p-queue`
doesn't work in the browser.
The commit fixes the paths which are displayed during the
`quick-file-search`:

- direct child resources of a root should not have a description
- fixes root-name for multi-root workspaces
- fixes label for multi-root workspaces when they are direct child
  resources of the given root.

Signed-off-by: vince-fugnitto <[email protected]>
Transpiles theia to ES2017. To keep support of es5 based vscode extensions, the @es5ClassCompat tag was used. The tag was also applied to be used with theia es5 plugins.

Contributed on behalf of STMicroelectronics
Signed-off-by: Simon Graband <[email protected]>

Co-authored-by: Paul Maréchal <[email protected]>
@sdirix
Copy link
Member

sdirix commented Nov 16, 2022

Merged upstream with eclipse-theia#9436

@sdirix sdirix closed this Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.