1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/cli/js/web
Kitson Kelly fc4819e1e0
refactor: Event and EventTarget implementations (#4707)
Refactors Event and EventTarget so that they better encapsulate their
non-public data as well as are more forward compatible with things like
DOM Nodes.

Moves `dom_types.ts` -> `dom_types.d.ts` which was always the intention,
it was a legacy of when we used to build the types from the code and the
limitations of the compiler.  There was a lot of cruft in `dom_types`
which shouldn't have been there, and mis-alignment to the DOM standards.
This generally has been eliminated, though we still have some minor
differences from the DOM (like the removal of some deprecated
methods/properties).

Adds `DOMException`.  Strictly it shouldn't inherit from `Error`, but
most browsers provide a stack trace when one is thrown, so the behaviour
in Deno actually better matches the browser.

`Event` still doesn't log to console like it does in the browser.  I
 wanted to get this raised and that could be an enhancement later on (it
 currently doesn't either).
2020-04-11 11:42:02 -04:00
..
streams refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
base64.ts move Web APIs to cli/js/web/ 2020-03-05 18:48:55 +01:00
blob.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
body.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
console.ts console: print promise details (#4524) 2020-03-30 19:01:19 -04:00
console_table.ts Update to Prettier 2 and use ES Private Fields (#4498) 2020-03-28 13:03:49 -04:00
custom_event.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
decode_utf8.ts move Web APIs to cli/js/web/ 2020-03-05 18:48:55 +01:00
dom_exception.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
dom_file.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
dom_iterable.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
dom_types.d.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
dom_util.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
event.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
event_target.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
fetch.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
form_data.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
headers.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
location.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
performance.ts Remove doc strings from cli/js TS files (#4329) 2020-03-13 10:22:22 +01:00
promise.ts console: print promise details (#4524) 2020-03-30 19:01:19 -04:00
README.md docs: add README to cli/js/web/ (#4578) 2020-04-06 13:06:11 +02:00
request.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
text_encoding.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
timers.ts Update to Prettier 2 and use ES Private Fields (#4498) 2020-03-28 13:03:49 -04:00
url.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
url_search_params.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
util.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00
workers.ts refactor: Event and EventTarget implementations (#4707) 2020-04-11 11:42:02 -04:00

Deno Web APIs

This directory facilities Web APIs that are available in Deno.

Please note, that some of implementations might not be completely aligned with specification.

Some of the Web APIs are using ops under the hood, eg. console, performance.

Implemented Web APIs

  • Blob: for representing opaque binary data
  • Console: for logging purposes
  • CustomEvent, EventTarget and EventListener: to work with DOM events
    • Implementation notes: There is no DOM hierarchy in Deno, so there is no tree for Events to bubble/capture through.
  • URL and URLSearchParams: to construct and parse URLSs
  • fetch, Request, Response, Body and Headers: modern Promise-based HTTP Request API
  • FormData: access to a multipart/form-data serialization
  • Location: parsing the current script's URL
    • Implementation notes: the globalThis.location object cannot be manipulated using assign(), reload() and replace() methods. They are not implemented.
  • Performance: retrieving current time with a high precision
  • setTimeout, setInterval, clearTimeout: scheduling callbacks in future and clearInterval
  • Worker: executing additional code in a separate thread
    • Implementation notes: Blob URLs are not supported, object ownership cannot be transferred, posted data is serialized to JSON instead of structured cloning.