elemental2 icon indicating copy to clipboard operation
elemental2 copied to clipboard

Add gecko_dom.js to elemental2-dom

Open jDramaix opened this issue 5 years ago • 13 comments

google/closure-compiler/blob/master/externs/browser/gecko_dom.js contains standard api defintion that are missing in elemental2-dom.

Contribution is welcome here.

This can be fixed by

jDramaix avatar Mar 12 '19 00:03 jDramaix

Rather than including gecko_dom.js, a better option may be to re-arrange the closure externs so that the non-browser specific are in w3c_*.js or whatwg_*.js files. For example once google/closure-compiler#3275 lands we could create a new extern such as whatwg_dom_ls.js that includes apis defined in the whatwg "Living Spec" such as Element.prototype.children. Then each API we care about we could migrate to the appropriate place

realityforge avatar Mar 19 '19 23:03 realityforge

I tried to do that and that breaks several (old) app internally. So if we want to move forward the best is to include gecko_dom.js and deprecate non standard api

jDramaix avatar Mar 29 '19 06:03 jDramaix

I'll do the work

jDramaix avatar Mar 29 '19 06:03 jDramaix

If you touch this in the near future, just be aware I may be trying to migrate the standardized part of the Selection interface to a separate extern :)

realityforge avatar Apr 22 '19 06:04 realityforge

I'm not really working on that right now so it's ok.

jDramaix avatar Apr 22 '19 17:04 jDramaix

Any news on that one? Missing Element.children is kinda painful...

vasvir avatar Jan 29 '21 14:01 vasvir

I believe nobody is working on this so anybody can feel free to pick it up.

gkdn avatar Jan 29 '21 21:01 gkdn

Looking around this bug and others that block it looks like a difficult one (with repercussions in other codebases). I may misread it though. Do you think it is something simple?

BTW do you know why it is called gecko_dom.js? Chrome has support for node.children from version 1 according to MDN https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/children

On Fri, Jan 29, 2021 at 11:06 PM Goktug Gokdogan [email protected] wrote:

I believe nobody is working on this so anybody can feel free to pick it up.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/elemental2/issues/86#issuecomment-770050269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7BCOCIF2GLSBQWCVD2N4LS4MPO5ANCNFSM4G5HGG3A .

-- Vassilis Virvilis

vasvir avatar Jan 29 '21 21:01 vasvir

I guess somebody with past experience on this could have easier time but I don't believe it is a super difficult problem.

AFAIK, these externs predates Chrome so the naming is mostly due to historical reasons.

gkdn avatar Jan 29 '21 21:01 gkdn

I took the liberty to try to build elemental2. I followed the instructions that they looked more relevant to my use case: Build GWT compatible maven jar files but it failed with the error below. So I am suspecting that this will be a bumpy ride.

If you think I should create a new issue for this failure just let me know.

bill@beyonder:~/Download/elemental2$ ./maven/release_elemental.sh --version local --no-deploy
INFO: Repository com_google_j2cl instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
  /home/bill/.cache/bazel/_bazel_bill/93bca72cba003badb7d1cabe556e46f7/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
WARNING: Download from https://github.com/google/j2cl/archive/master.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 401 Unauthorized
ERROR: An error occurred during the fetch of repository 'com_google_j2cl':
   java.io.IOException: Error downloading [https://github.com/google/j2cl/archive/master.zip] to /home/bill/.cache/bazel/_bazel_bill/93bca72cba003badb7d1cabe556e46f7/external/com_google_j2cl/master.zip: GET returned 401 Unauthorized
ERROR: no such package '@com_google_j2cl//build_defs': java.io.IOException: Error downloading [https://github.com/google/j2cl/archive/master.zip] to /home/bill/.cache/bazel/_bazel_bill/93bca72cba003badb7d1cabe556e46f7/external/com_google_j2cl/master.zip: GET returned 401 Unauthorized
INFO: Elapsed time: 0.413s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

vasvir avatar Feb 01 '21 14:02 vasvir

@vasvir my experience with elemental2 is limited to submitting one minor PR, but building worked fine for me... It seems you're getting a 401 error for https://github.com/google/j2cl/archive/master.zip which could be a network issue on GitHub side or some problem in your network. Does wget https://github.com/google/j2cl/archive/master.zip do anything on your machine?

zbynek avatar Feb 01 '21 15:02 zbynek

It's a funny thing really. I even tried the master.zip url in firefox and it worked so I believed it was a build error.

Now I tried it on another machine and I found the culprit. I had .netrc file with my github credentials.

Now I am past this point but it fails due to missing jsinterop-annotations. Weird...

Constructing Javadoc information...
/tmp/tmp.G7V4StBZoc/elemental2/core/AsyncIterator.java:18: error: package elemental2.promise does not exist
import elemental2.promise.Promise;
                         ^
/tmp/tmp.G7V4StBZoc/elemental2/core/AsyncIterator.java:19: error: package jsinterop.annotations does not exist
import jsinterop.annotations.JsPackage;
                            ^
/tmp/tmp.G7V4StBZoc/elemental2/core/AsyncIterator.java:20: error: package jsinterop.annotations does not exist
import jsinterop.annotations.JsType;
                            ^
/tmp/tmp.G7V4StBZoc/elemental2/core/AsyncIterator.java:22: error: cannot find symbol
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
 ^
  symbol: class JsType
/tmp/tmp.G7V4StBZoc/elemental2/core/AsyncIterator.java:24: error: cannot find symbol
  Promise<JsIIterableResult<VALUE>> next();

vasvir avatar Feb 01 '21 18:02 vasvir

Not sure why you are seeing these problems but try using bazelisk which will ensure using correct version of Bazel and avoid any potential problems around that:

    $ npm install -g @bazel/bazelisk
    $ alias bazel=bazelisk

gkdn avatar Feb 01 '21 19:02 gkdn

Half of gecko_dom was moved to html5, the other half is deprecated and/or Gecko-specific, so I think this can be closed (but an elemental2 release is needed).

zbynek avatar Feb 20 '24 20:02 zbynek

Thanks. I'm closing the issue and will try to do a new release asap.

jDramaix avatar Feb 27 '24 06:02 jDramaix