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

Ydoc library #11615

Merged
merged 6 commits into from
Nov 25, 2024
Merged

Ydoc library #11615

merged 6 commits into from
Nov 25, 2024

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Nov 21, 2024

Pull Request Description

ydoc-server compilation requires generation of ydoc.cjs resource that can take time and slow down the libraries development (building the enso distribution). This PR splits Ydoc into a library and the server part to avoid JS resources generation during the compilation of the language server.

Changelog:

  • refactor: Ydoc into ydoc ydoc-polyglot library and ydoc-server server parts
  • update: language server to depend on the ydoc ydoc-polyglot library

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Nov 21, 2024
@4e6 4e6 self-assigned this Nov 21, 2024
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

I would really like to see #11477 addressed in this PR. There is one essential and one verification step:

  1. modify ContextInsightSetup to enable ydoc polyfills that are provided by the newly defined ydoc (as named currently) library
  2. verify (maybe just manually) that the generated ydoc.cjs can be specified by -Denso.dev.insight property, loads correctly and runs the way Ydoc is supposed to run

Can we move forward with #11477, please?

build.sbt Outdated
@@ -1885,13 +1886,49 @@ lazy val searcher = project
.dependsOn(testkit % Test)
.dependsOn(`polyglot-api`)

lazy val ydoc = project
.in(file("lib/java/ydoc"))
Copy link
Member

@JaroslavTulach JaroslavTulach Nov 22, 2024

Choose a reason for hiding this comment

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

Why it is called ydoc? The library itself has nothing to do with ydoc, it is websocket and other node.js APIs polyfill necessary to execute ydoc on JVM.

Maybe ydoc-polyfill? Or polyfills4ydoc? Or graal-js-polyfills?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ydoc-polyfill it is

import org.enso.ydoc.jsonrpc.model.result.FileListResult;
import org.enso.ydoc.jsonrpc.model.result.InitProtocolConnectionResult;
import org.enso.ydoc.jsonrpc.model.result.TextOpenFileResult;
import org.enso.ydoc.server.jsonrpc.JsonRpcRequest;
Copy link
Member

Choose a reason for hiding this comment

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

Wow: So many jsonrpc classes just for testing purposes!

I wasn't aware we have so many classes related to mock communication with language server. Do they mock the communication? What do they actually test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They need to emulate initialization message exchange with the language server

@4e6 4e6 requested a review from JaroslavTulach November 25, 2024 14:19
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

The description of the PR still contains:

Ydoc into ydoc library and ydoc-server server parts

Otherwise I think this is good.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Nov 25, 2024
@mergify mergify bot merged commit 3d6ca03 into develop Nov 25, 2024
45 of 46 checks passed
@mergify mergify bot deleted the wip/db/ydoc-lib branch November 25, 2024 17:54
hubertp added a commit that referenced this pull request Nov 26, 2024
`ydoc-server` compilation requires generation of `ydoc.cjs` resource that can take time and slow down the libraries development (building the enso distribution). This PR splits Ydoc into a library and the server part to avoid JS resources generation during the compilation of the language server.

Changelog:
- refactor: Ydoc into ~~`ydoc`~~ `ydoc-polyglot` library and  `ydoc-server` server parts
- update: language server to depend on the ~~`ydoc`~~ `ydoc-polyglot` library
mergify bot pushed a commit that referenced this pull request Nov 27, 2024
Fixes the `sbt std-benchmarks/run` runtime module path. Before #11615 the `std-benchmarks` had `logging-service-logback` as a [transitive dependency of the `ydoc-server`](https://github.com/enso-org/enso/pull/11615/files#diff-5634c415cd8c8504fdb973a3ed092300b43c4b8fc1e184f7249eb29a55511f91L4052). Now is should be provided explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants