Skip to content
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

Stepping back: what are the constraints/requirements? #16

Open
domenic opened this issue Aug 8, 2018 · 9 comments
Open

Stepping back: what are the constraints/requirements? #16

domenic opened this issue Aug 8, 2018 · 9 comments

Comments

@domenic
Copy link
Owner

domenic commented Aug 8, 2018

As previous issues in this tracker plus other offline discussions have revealed, my hypotheses as to what would be implementable are not very good. As such the API currently in the README is not a great representation of what we're trying to accomplish here, as it mixes up the problem space with the solution space.

Here's my first draft of goals and non-goals that should help make things clearer for anyone, like myself, who wants to rethink the solution space.

Goals

  • Work in both window and worker contexts (probably worklet too)
  • Span built-in JS (ECMAScript spec) and web (Web IDL) ecosystems
  • Give the ability to do the original operation for:
    • Static methods (Array.isArray; URL.createObjectURL)
    • "Namespace" methods (JSON.parse; CSS.supports)
    • Prototype getters/setters (ArrayBuffer.prototype.byteLength; DOMTokenList.prototype.value)
    • Prototype methods (Promise.prototype.then; Event.prototype.preventDefault)
    • Global getters/setters (window.opener)
    • Global methods (createImageBitmap; encodeURIComponent)
    • Constructors (Promise; Event)
  • For constructors or other "create a new object" methods, return instances from the correct realm (see current readme's "Same values" section)
  • Usage does not make refactoring prototype chains over time more likely to break the web (see current readme's "Instance based design rationale" section)
  • Be relatively efficient (at least in theory, with sufficiently smart implementations):
    • Invoking original operations should not be much slower than invoking things "normally"
    • Pages that use this API should not be worse in memory usage than pages that don't, ideally, or at least should pay only proportional to their use

Non-goals

It is also a non-goal to support a way of stashing and retrieving the originals for user-supplied objects, although that would be vaguely nice if it falls out naturally from the design we end up with. (Related: drufball/layered-apis#32)

@ljharb

This comment has been minimized.

@domenic

This comment has been minimized.

@ljharb

This comment has been minimized.

@domenic

This comment has been minimized.

@ljharb

This comment has been minimized.

@domenic

This comment has been minimized.

@mikesamuel

This comment has been minimized.

@koto

This comment has been minimized.

@domenic
Copy link
Owner Author

domenic commented Aug 9, 2018

Let me suggest constraining your discussions to other threads, so we can use this for the design goals of the proposal authors. I'll collapse a number of comments here.

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

No branches or pull requests

4 participants