-
Notifications
You must be signed in to change notification settings - Fork 425
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
lib from W3C/WHATWG #227
lib from W3C/WHATWG #227
Conversation
This PR contains several types from Working Draft and Editor's Draft to be compatible with current lib.d.ts where pre-CR specs e.g. Web Audio, Touch Events Level 2, and Intersection Observer are already included. |
@saschanaz sorry for the delay. i am not sure what is the best way to move on this. it is a bit hard to see the impact of the change due to the size of the change. i wounder if there is a way we make this more managable.. for instance, can we change the current generated file to first have the same order as the new file, the do the change, at least we can limit the diff noise.. |
I'm not sure there is a good way to reorder current generated file to match this PR, since there is no rule for the order. Instead I can reorder new file by sorting them alphabetically. (If we don't want the sorting then we can open a new PR to undo it) |
I just need a way to see the changes and asses the differences. We can do changes to the existing repo to reorder first, then you can use the same order well, this way we can compare. |
Yes, I mean the existing one is already sorted (though callback-functions are not) so better to fix this PR to match it. The last commit is not sufficient, currently I'm testing locally to make seeing diff easy. |
Not true, some are sorted and others are not. Will push another PR to sort them. |
777b388
to
b7731e8
Compare
61a13ff
to
f06d702
Compare
I think now it's ready to get some review as I don't see any major/minor problems on code diff itself. If you see some problems please tell me 😉 |
ping @mhegazy |
12e1e8f
to
c17b984
Compare
@mhegazy Are you reviewing this now??? |
It seems reviewing this PR is too time-consuming because of the diff size. A progressive approach would be great but I'm not sure how as of now. |
c17b984
to
ac2d242
Compare
My current thought: Do not replace XML side, instead add an addedTypes.json-like progressive data. |
I've looked at the dom.generated.d.ts... the order is nearly the same, but some things seem to have moved, e.g. ScrollOptions has moved up 11k lines. An issue is that the spec source doesn't seem to be quite as detailed in some respects. For example, the static members on WebGlContext are missing. (tbh, I didn't find them in the spec, but all the browsers have them...). Also, some constructors are missing, e.g. for SpeechSynthesisEvent A lot of interfaces are missing, but it looks like they are mostly Microsoft specific things. Maybe a first step would be to add those types to the removedTypes.json to see if it breaks anything. Note that some types have just been renamed slightly, so it may be necessary to check if the type is being used elsewhere in the file before removing it. |
@NaridaL Thank you for your review 👍
Yeah, addedTypes.json adds its types on different position, so this movement occurs.
I'm not sure what you mean, I couldn't find an interface named WebGlContext.
You're right, this is basically because the spec (which hasn't been updated for years) doesn't have it :( Someone filed a bug about this.
Yes, probably a separate PR to remove the MS-specific things is the right way to do, and then the next thing is moving them to DefinitelyTyped 😄 |
@saschanaz WebGLRenderingContext, sorry. All the constants are available on the global |
Ah, now I understand. They are defined in |
@saschanaz The interface is fine, but they're missing on the declared variable. https://github.com/Microsoft/TSJS-lib-generator/pull/227/files#diff-a97a9d0dbf71ec2f96be57f7fb9f70c9L12517 |
Hmm, it seems that's because (Probably iNameToEhParents-like mapping will be required) |
Superceded by #300. |
Fixes #101.
The input XML in this PR is generated by webidl-serializer.
The changes in TS.fsx are to:
namespace
types (67bcdd6)someMethod(args: ...(Node | string)[])
(e105830)
Current remaining problems: