Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Rationale for attaching to document? #23

Closed
marcoscaceres opened this issue Sep 18, 2019 · 8 comments
Closed

Rationale for attaching to document? #23

marcoscaceres opened this issue Sep 18, 2019 · 8 comments

Comments

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Sep 18, 2019

Wondering what the rationale was for attaching monetization to the Document object? It doesn't really feel like the right place to attach this, as monetization doesn't itself affect the document or have anything specifically to do with the document interface. We should consider maybe having monetization either on Navigator or its own Monetization namespace.

@sublimator
Copy link
Collaborator

Yeah, I'm not sure. I wasn't really around for the beginnings of the spec, but I do recall reading some discussion when starting up. Tracked it down to here: interledger/rfcs#500 (comment)

@sublimator
Copy link
Collaborator

And here:
interledger/rfcs#500 (comment)
And:
interledger/rfcs#500 (comment)

To quote @justmoon from comments above:

To give some context: This made more sense to me because Web Monetization is now triggered by a meta-tag and meta-tags describe the document. So whereas previously it was a feature of the JavaScript environment (hence existing on window, it's now a feature of the HTML document.

@adrianhopebailie
Copy link
Owner

The decision about where to put this was not strongly sided either way. If it's better as a stand-alone global then let's make it a global.

@marcoscaceres
Copy link
Contributor Author

Yes, putting something in the global namespace would be my preference.

@sublimator
Copy link
Collaborator

@marcoscaceres
Curious as to why that is.
Is that just the prevailing convention, or you have a rationale? or both?? :)

@marcoscaceres
Copy link
Contributor Author

Is that just the prevailing convention, or you have a rationale? or both?? :)

Bit of both... we generally like to put things on the document that directly affect the Document. You can see what I mean by looking at the interface definition:

https://html.spec.whatwg.org/#the-document-object

In most cases, the methods and attributes affect the Document directly in some meaningful way. Monetization doesn't affect the Document or reflect some sate of the document, so should probably not be hung on that interface.

@sublimator
Copy link
Collaborator

Thanks again for the info :)

@adrianhopebailie
Copy link
Owner

Kamino closed and cloned this issue to interledger/webmonetization.org

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

No branches or pull requests

3 participants