-
Notifications
You must be signed in to change notification settings - Fork 38
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
Feature: Chrome APIs #120
Feature: Chrome APIs #120
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ Following are the different elemental2 modules and their target names: | |
webgl | `@com_google_elemental2//:elemental2-webgl-j2cl` | ||
media | `@com_google_elemental2//:elemental2-media-j2cl` | ||
webstorage | `@com_google_elemental2//:elemental2-webstorage-j2cl` | ||
chrome | `@com_google_elemental2//:elemental2-chrome-j2cl` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. standard |
||
|
||
Maven dependencies | ||
------------------ | ||
|
@@ -76,6 +77,7 @@ If your project use [Maven](https://maven.apache.org), add maven dependencies in | |
webgl | `elemental2-webgl` | ||
media | `elemental2-media` | ||
webstorage | `elemental2-webstorage` | ||
chrome | `elemental2-chrome` | ||
|
||
Download the jar files | ||
---------------------- | ||
|
@@ -91,6 +93,7 @@ You can also download manually the jars files. | |
webgl | [elemental2-webgl.jar](https://oss.sonatype.org/content/repositories/releases/com/google/elemental2/elemental2-webgl/1.0.0-RC1/elemental2-webgl-1.0.0-RC1.jar) | ||
media | [elemental2-media.jar](https://oss.sonatype.org/content/repositories/releases/com/google/elemental2/elemental2-media/1.0.0-RC1/elemental2-media-1.0.0-RC1.jar) | ||
webstorage | [elemental2-webstorage.jar](https://oss.sonatype.org/content/repositories/releases/com/google/elemental2/elemental2-webstorage/1.0.0-RC1/elemental2-webstorage-1.0.0-RC1.jar) | ||
chrome | [elemental2-chrome.jar](https://oss.sonatype.org/content/repositories/releases/com/google/elemental2/elemental2-webstorage/1.0.0-RC1/elemental2-chrome-1.0.0-RC1.jar) | ||
|
||
GWT | ||
--- | ||
|
@@ -106,6 +109,7 @@ If you use Elemental2 with [GWT](http://www.gwtproject.org/), you need to inheri | |
webgl | `elemental2.webgl.WebGl` | ||
media | `elemental2.media.Media` | ||
webstorage | `elemental2.webstorage.WebStorage` | ||
chrome | `elemental2.chrome.Chrome` | ||
|
||
Contributing | ||
------------ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This package contains the build rule to build elemental2-chrome. | ||
|
||
package(default_visibility = [ | ||
"//:__subpackages__", | ||
]) | ||
|
||
# Apache2 | ||
licenses(["notice"]) | ||
|
||
load( | ||
"@com_google_jsinterop_generator//:jsinterop_generator.bzl", | ||
"jsinterop_generator", | ||
) | ||
|
||
load( | ||
"//build_defs/internal_do_not_use:elemental_utils.bzl", | ||
"patch_extern_file", | ||
) | ||
|
||
patch_extern_file( | ||
name = "chrome_patched", | ||
src = "//third_party:chrome.js", | ||
patch_file = "chrome.js.diff", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. simple patch is applied via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note I'm working on elemental now in order to get rif of these patch files. This is a burden in term of extern maintenance and require a continuous sync between elemental2 and closure github repo. |
||
) | ||
|
||
filegroup( | ||
name = "externs", | ||
srcs = [":chrome_patched"], | ||
) | ||
|
||
jsinterop_generator( | ||
name = "chrome", | ||
srcs = [":externs"], | ||
integer_entities_files = ["integer_entities.txt"], | ||
name_mapping_files = ["name_mappings.txt"], | ||
deps = [ | ||
"//java/elemental2/core", | ||
"//java/elemental2/dom", | ||
]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
295c295 | ||
< * @extends {ChromeBaseEvent<function()>} | ||
--- | ||
> * @extends {ChromeBaseEvent<!Function>} | ||
303c303 | ||
< * @extends {ChromeBaseEvent<function(string)>} | ||
--- | ||
> * @extends {ChromeBaseEvent<!Function>} | ||
311c311 | ||
< * @extends {ChromeBaseEvent<function(boolean)>} | ||
--- | ||
> * @extends {ChromeBaseEvent<!Function>} | ||
319c319 | ||
< * @extends {ChromeBaseEvent<function(number)>} | ||
--- | ||
> * @extends {ChromeBaseEvent<!Function>} | ||
327c327 | ||
< * @extends {ChromeBaseEvent<function(!Object)>} | ||
--- | ||
> * @extends {ChromeBaseEvent<!Function>} | ||
335c335 | ||
< * @extends {ChromeBaseEvent<function(!Array<string>)>} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the build was having issues with these signatures, so i've made them generic for now, until they can get better type visibility There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should try to fix that in https://github.com/google/closure-compiler/blob/master/contrib/externs/chrome.js directly. |
||
--- | ||
> * @extends {ChromeBaseEvent<!Function>} | ||
343c343 | ||
< * @extends {ChromeBaseEvent<function(string, string)>} | ||
--- | ||
> * @extends {ChromeBaseEvent<!Function>} | ||
380,382c380,382 | ||
< USER: '', | ||
< CAPTURE: '', | ||
< EXTENSION: '', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. useless diff |
||
--- | ||
> USER: '', | ||
> CAPTURE: '', | ||
> EXTENSION: '', |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
elemental2.chrome.MessageSender.frameId | ||
elemental2.chrome.Tab.id | ||
elemental2.chrome.Tab.index | ||
elemental2.chrome.Tab.windowId | ||
elemental2.chrome.Tab.openerTabId | ||
elemental2.chrome.Tab.width | ||
elemental2.chrome.Tab.height | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are all the simple integer-seeming types i could find in the |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
elemental2.chrome.chrome.Runtime.SendMessageCallbackFn.onInvoke.p0=response |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,3 +258,13 @@ alias( | |
name = "jsinterop-base-j2cl", | ||
actual = "@com_google_jsinterop_base//:jsinterop-base-j2cl", | ||
) | ||
|
||
alias( | ||
name = "chrome.js", | ||
actual = "@com_google_closure_compiler//:contrib/externs/chrome.js", | ||
) | ||
|
||
alias( | ||
name = "chrome_extensions.js", | ||
actual = "@com_google_closure_compiler//:contrib/externs/chrome_extensions.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and, finally, update to |
||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top-level target for
elemental2-chrome