-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Publish the web-sys crate #613
Comments
Namespaces and inheritance have been on the top of my todo list when I get a moment. Inheritance is needed for many useful bindings (my plan for the moment was to basically treat them like mixins until we decide on how we want to expose the hierarchy). |
@ohanar good call! Added an item about implementing inheritance from the RFC. I think we should hold off on mixins or traits for base methods until we have another accepted RFC, since we definitely don't want to ship something as big as that until we are fairly sure it will be stable and not undergo a bunch of churn. That means that if we want to include something like that for the initial web-sys release, we should be starting design work / writing a draft of that RFC now. |
Another checklist item (which I don't think we have a tracking issue for yet) is a lack of constructors, for example |
One last thing I think we'll want to do is to set up headless testing for Chrome as well on CI to ensure that we don't get things that are too Firefox-specific |
@fitzgen I would definitely say the inheritance RFC needs to happen then. The most popular proposal of using traits (like stdweb), doesn't match the current API, since all methods would be on traits rather than directly on the types, so implementing such a proposal would require comparable churn. |
One last thing that I just thought of, is that typedefs should be removed. The spec makes it clear that these should not be exposed in language bindings. With the first pass in the webidl frontend, it should be quite straightforward to process them there. |
Do we want to specifically call out #248 as a checklist item? It is blocking generation of methods for certain structs - e.g., the Storage struct, which has a getter and setter defined in the WebIDL. |
I've updated the OP and filed dedicated issues for the items mentioned here! |
Couple things:
|
I would be happy to write up a draft RFC, although I'm super swamped at the moment and likely won't have much time to do anything real for at least a week. The main complaint that I have with a non-breaking traits based thing is that it feels super weird to me for instance for a MouseEvent to have have a |
If nobody else wants to, I can write up a trait-inheritance RFC.
I can sympathize with that, but I think that will be the least of concerns for a JavaScript user trying to learn Rust (they will struggle much more with other stuff). Especially since it's as easy as just slapping |
Currently the crate doesn't support the
So my priorities would be:
|
@jonathanKingston ah excellent points! The
would become
we already have code to handle overloads and such, so that way we wouldn't have to deal with unions and we'd just export a function-per-element of the union. AFAIK unions can't be nested as well, so this should be a semi-local pass. |
Yes, but what to do with unions in other positions (for example, return types)? Looks like supporting it would require expressing them as Rust enums. |
Ah I didnt know they showed up in return positions! For that we probably have no choice but and enum or custom struct |
We could punt in that case and do |
Good call! I'll file an issue and make it a blocker.
I think exposing And it saves us from having to special case every single global property. What do y'all think?
Yep, this is part of implementing RFC #2.
Something like the eventual example for #446? |
That would be awesome! |
@fitzgen Done: rustwasm/rfcs#3 |
Incredible! Thanks @Pauan ! |
It would be nice if there were a way to clone the Element interfaces or the methods accept references instead.
Yeah this is fine, I forgot about
It looks like that is implemented but I can only upcast to
Yeah :) |
You can use |
Also added #257 as a blocker -- not being able to register event listeners and all that is a deal breaker. |
@alexcrichton and I also talked about One idea was to add a cargo feature for every interface, and only generate code for the enabled interfaces. We should decide (1) if compilation times should be a blocker (and what kind of time is Good Enough to unblock), and (2) if so, what strategy to pursue. |
If we do the feature-per-interface thing, then we need to ensure that docs are generated with everything enabled. Ideally, each method's doc comment would also list the features required to enable it. |
If we did the interface filtering in the compiler choosing what |
I've posted #790 to help bring compile times under control for |
Just a note: we probably want to publish a blog post when at the same time that we publish web-sys. |
A couple final things we talked about in todays WG meeting:
|
@fitzgen how does i.e. does it need to be as polished before it starts getting published? Full transparency mostly asking because I've been running into issues with depending on Not trying to say that publishing now is the best thing to do, but more so just trying to understand what the new timetable is and if the checklist should still be the same. Thank you so much!! |
@chinedufn nothing has changed, we're on the same schedule and have the same goals we've always had. Looking to publish this week! Understand the pain |
Did another audit of unsupported logs, and there are almost none left:
|
To expand on that list:
In that sense we're definitely looking quite good! I don't think we're missing out on any crucial functionality with the above missing apis |
And we're done here ;) https://rustwasm.github.io/2018/09/26/announcing-web-sys.html |
As discussed in today's WG meeting, we are aiming for publishing an initial release of the
web-sys
crate for the Rust 2018 Release Candidate milestone. That's 6 weeks from now: 2018-09-13.What needs to be done before we ship an initial release of
web-sys
?Goals
HTMLConstructor
attribute: WebIDL: Support the HTMLConstructor attribute #621Option<scalar>
: WebIDL: enable bindings that takeOption<scalar>
#624document.createElement
: Generate bindings fordocument.createElement
#658web-sys
APIs on activated features #790moz
-prefixed APIs that shouldn't be included inweb-sys
Stretch
web-sys
: Add a DOM manipulation with web-sys example toexamples/
and the guide #446What else should we make sure is done for an initial release? For reference, here are all the "frontend:webidl" issues and here are all the "web-sys" issues
+cc @ohanar @alexcrichton @twilco @Dodj @jonathanKingston
The text was updated successfully, but these errors were encountered: