-
Notifications
You must be signed in to change notification settings - Fork 184
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
Lib: Add support for 'addEventListener' with options object #807
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hhugo
force-pushed
the
addeventlistener-options
branch
from
July 7, 2019 12:38
84658fa
to
147c075
Compare
Sorry for the delay on the review. I've made some changes to your PR (hope you don't mind) |
I don't mind. This is a cleaner interface. |
Thanks a lot for your contribution. |
hhugo
added a commit
to hhugo/opam-repository
that referenced
this pull request
Nov 10, 2019
…riving_json, js_of_ocaml-tyxml, js_of_ocaml-ppx, js_of_ocaml-lwt, js_of_ocaml-compiler and js_of_ocaml-toplevel (3.5.0) CHANGES: ## Features/Changes * Compiler: Improve testing of the compiler (Ty Overby) * Compiler: Add several macros for making the runtime easier to maintain (ocsigen/js_of_ocaml#771) (Ty Overby) * Compiler: Allow to emit one javascript per compilation unit (ocsigen/js_of_ocaml#783) * Compiler: refactoring (ocsigen/js_of_ocaml#781, ocsigen/js_of_ocaml#782, ocsigen/js_of_ocaml#787, ocsigen/js_of_ocaml#795, ocsigen/js_of_ocaml#802) * Compiler: more source map location for the javascript runtime (ocsigen/js_of_ocaml#795) * Compiler: tune variable naming (ocsigen/js_of_ocaml#838) * Compiler: Work around num lib incompatibility * Compiler: escape '</' in strings (ocsigen/js_of_ocaml#899) * Compiler: speedup toplevel creation * Runtime: support sharing when marshaling (ocsigen/js_of_ocaml#814) * Runtime: add caml_obj_with_tag * Runtime: support marshaling custom block * Runtime: complete rewrite of bigarray * Runtime: complete num implementation * Runtime: add caml_ba_hash * Runtime: rewrite polymorphic compare * Ppx: switch ppx rewriter to the OCaml 4.08 ast * Misc: Improve CI speed * Misc: remove ppx_deriving dependency * Misc: remove cppo dependency * Misc: remove ppx_tools_versioned dependency in ppx_deriving_json * Misc: support for ocaml 4.09 * Misc: switch to ocamlformat.0.12 * Misc: many more tests * Misc: new jsoo_fs tool to embed files in a jsoo pseudo fs. * Lib: Use expect tests * Lib: Add support for 'addEventListener' with options (ocsigen/js_of_ocaml#807) * Lib: Change api of [Lwt_js_events.async] (ocsigen/js_of_ocaml#862) * Lib: Change api of responseText in xmlhttprequest (ocsigen/js_of_ocaml#863) * Lib: add resizeObserver bindings * Lib: Added support for custom events (ocsigen/js_of_ocaml#877) * Lib: Added support for focus events (ocsigen/js_of_ocaml#885) * Lib: Added `passive` option support for `Lwt_js_events` module * Lib: Added bindings for pointer events (ocsigen/js_of_ocaml#894) ## Bug fixes * Compiler: don't generate source if no-source-map passed (ocsigen/js_of_ocaml#780) * Compiler: Fix compilation of [Array.set] to return [unit]/0 (ocsigen/js_of_ocaml#792) * Compiler: Fix assertion failure (ocsigen/js_of_ocaml#828) * Compiler: Fix compilation of exception handlers (ocsigen/js_of_ocaml#830) * Compiler: Fix static evaluation of caml_equal (ocsigen/js_of_ocaml#906) * Misc: Fix install on windows (ocsigen/js_of_ocaml#794) * Lib: Fix Dom_svg.createForeignObject (ocsigen/js_of_ocaml#756) * Runtime: Fix caml_obj_tag, causing miscompilation with lazy value (ocsigen/js_of_ocaml#772) * Runtime: Fix caml_ml_seek_out, caml_ml_pos_out (ocsigen/js_of_ocaml#779) (Shachar Itzhaky) * Runtime: caml_parse_sign_and_base to support unsigned syntax (ocsigen/js_of_ocaml#792) (Shachar Itzhaky) * Runtime: fix encoding when printing to stdout (ocsigen/js_of_ocaml#800) * Runtime: Handle browserfs in fs_node detection logic (ocsigen/js_of_ocaml#831) * Runtime: fix Obj.tag (ocsigen/js_of_ocaml#832) * Runtime: fix marshalling of custom blocks (ocsigen/js_of_ocaml#861) * Runtime: fix frexp * Runtime: fix float printing with "%f" and large floats
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The library seemed to be missing an accessible interface to give options to
addEventListener
as described in the specifications ( https://dom.spec.whatwg.org/#interface-eventtarget , https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Syntax , ... )I added a function to do that.
Maybe the new class type will need to be moved, maybe some compatibility issues rise from the way I implemented this (some old browsers don't support the object variant. Maybe add a check for that ?)
Note: most times, users would need to pass only one option and keep the others at default. I don't know which is better between helper functions that take one argument and build the appropriate object, and additional class types with fewer methods.