Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

PRJ-285 JCEF support #130

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

PRJ-285 JCEF support #130

wants to merge 12 commits into from

Conversation

ARTI1208
Copy link
Contributor

@ARTI1208 ARTI1208 commented Feb 9, 2022

@ARTI1208 ARTI1208 force-pushed the jcef branch 2 times, most recently from 1178d53 to 2a6ef9c Compare February 15, 2022 15:25
@ARTI1208 ARTI1208 marked this pull request as ready for review February 15, 2022 15:26
@codecov-commenter
Copy link

Codecov Report

Merging #130 (268caff) into master (a390d2b) will decrease coverage by 2.89%.
The diff coverage is 1.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #130      +/-   ##
============================================
- Coverage     25.17%   22.28%   -2.90%     
  Complexity       63       63              
============================================
  Files           132      141       +9     
  Lines          3893     4434     +541     
  Branches        407      470      +63     
============================================
+ Hits            980      988       +8     
- Misses         2892     3425     +533     
  Partials         21       21              
Impacted Files Coverage Δ
...otlin/org/jetbrains/projector/agent/common/Misc.kt 0.00% <0.00%> (ø)
...ector/agent/ijInjector/IjBrowserUtilTransformer.kt 0.00% <ø> (ø)
...jetbrains/projector/agent/ijInjector/IjInjector.kt 0.00% <0.00%> (ø)
...ns/projector/agent/ijInjector/IjJcefTransformer.kt 0.00% <0.00%> (ø)
...ains/projector/agent/ijInjector/IjMdTransformer.kt 0.00% <0.00%> (ø)
.../jetbrains/projector/common/protocol/data/Point.kt 0.00% <0.00%> (-14.29%) ⬇️
...tlin/org/jetbrains/projector/common/EventSender.kt 0.00% <0.00%> (ø)
...etbrains/projector/common/event/ServerEventPart.kt 0.00% <0.00%> (ø)
...tbrains/projector/common/intellij/Compatibility.kt 0.00% <0.00%> (ø)
...in/org/jetbrains/projector/ij/jcef/BrowserState.kt 0.00% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9067ed...268caff. Read the comment docs.

@ARTI1208 ARTI1208 requested a review from SerVB February 16, 2022 06:29
@YunaiV
Copy link

YunaiV commented Feb 18, 2022

nice!

@ARTI1208 ARTI1208 marked this pull request as draft March 2, 2022 12:09
@SerVB SerVB removed their request for review March 4, 2022 10:32
@ARTI1208 ARTI1208 marked this pull request as ready for review March 22, 2022 15:31
@ARTI1208 ARTI1208 requested a review from SerVB March 22, 2022 15:31
Copy link
Member

@SerVB SerVB left a comment

Choose a reason for hiding this comment

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

Wow, that was big and I expect this will be difficult to support... Probably we could make the logic much concise if there was a JCEF factory that we can just inject? We could ask for that the platform team to simplify our code in the future...

* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.jetbrains.projector.common
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is no a right place to add these 3 files. projector-common is meant for code that is shared between the server and the client.

@UseProjectorLoader
public object CefHandlers {

@JvmStatic
Copy link
Member

Choose a reason for hiding this comment

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

Why do we use JvmStatic for private members of this class?

And for public ones?

We should add a comment on that.

@@ -239,3 +241,12 @@ data class ClientNotificationEvent(
val message: String,
val notificationType: ClientNotificationType,
) : ClientEvent()

@OptIn(ExperimentalJsExport::class)
@JsExport
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@JsExport
@JsExport // used from JS code

Copy link
Member

Choose a reason for hiding this comment

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

However, fmpov, it's pretty scary dependency. Commented suggestions in ProjectorJcefBrowser.kt.

const prjWebPackage = prjWebModule.org.jetbrains.projector.client.web;
const addEvent = prjWebPackage.state.ClientAction.AddEvent;
const jcefEvent = prjWebModule.${ClientJcefEvent::class.java.name};
prjWebPackage.Application.fireAction(new addEvent(new jcefEvent($id, '$jsQueryFunctionName', obj.request)));
Copy link
Member

Choose a reason for hiding this comment

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

So because of that, we:

  1. Make Application singleton;
  2. Add JsExport to AddEvent and ClientJcefEvent?

It's quite a scary dependency to me. Moreover, there is still many hard code like packages that isn't checked at compile time.

Can we somehow apply these changes just from the web client side? That could be cleaner...

)
) {

constructor(x: Int, y: Int) : this(x.toDouble(), y.toDouble())
Copy link
Member

Choose a reason for hiding this comment

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

In many other places we do Point(x.toDouble(), y.toDouble()), so probably we should adjust those places as well or avoid adding one more constructor...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants