Skip to content

What is the expose format? #58

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

Closed
domenic opened this issue Aug 19, 2017 · 5 comments
Closed

What is the expose format? #58

domenic opened this issue Aug 19, 2017 · 5 comments
Assignees

Comments

@domenic
Copy link
Member

domenic commented Aug 19, 2017

That is, why is it

expose: {
  Window: { Node: Node }
}

instead of

expose: ["Window"]

and then we know the thing to expose is the interface export, and then name to expose is interface.name?

@Sebmaster
Copy link
Member

This is intended for stuff like ImageHTMLElement, which is also exposed as Image.

@domenic
Copy link
Member Author

domenic commented Aug 19, 2017

It's not though. window.HTMLImageElement !== window.Image. window.Image is a useful factory function, whereas window.HTMLImageElement throws.

@Sebmaster
Copy link
Member

Right, I had hoped that this would be somehow possible, maybe my having an expose prop on the impl export which can add more stuff to the global?

@domenic
Copy link
Member Author

domenic commented Aug 19, 2017

Hmm, I see, that makes sense. So in the future we'll do something like

expose: {
  Window: {
    HTMLImageElement: HTMLImageElement,
    Image: Image
  }
}

where Image is a generated wrapper that calls into something like implModule.namedConstructor_Image or similar.

@domenic
Copy link
Member Author

domenic commented Aug 19, 2017

Well, I'm not sure about the generated wrapper part (seems like a recipe for circular dependencies, since namedConstructor_Image would need to use one of the create functions from the generated wrapper). But the general idea makes sense. So let me close this and update #60.

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

2 participants