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

Use @webref/idl #66

Closed
foolip opened this issue Feb 25, 2021 · 4 comments
Closed

Use @webref/idl #66

foolip opened this issue Feb 25, 2021 · 4 comments

Comments

@foolip
Copy link

foolip commented Feb 25, 2021

https://www.npmjs.com/package/@webref/idl

This package has fixed IDL files with certain guarantees, which I suspect could make it easier to maintain this package.

If this repo also contains code to apply partials and mixins, then maybe we should put that in the package too.

@saschanaz
Copy link
Owner

Currently this repo also uses CSS part, which I believe is not covered yet:

const webrefCssDir = new URL(
"../../node_modules/webref/ed/css/",
import.meta.url
);

If this repo also contains code to apply partials and mixins, then maybe we should put that in the package too.

Wait, does the package exclude them? Didn't know that 🤔

@foolip
Copy link
Author

foolip commented Feb 25, 2021

I've sent w3c/webref#111 for publishing CSS. I don't know which bits you use, but I guess if we publish everything in ed/css/ it will work for you?

Wait, does the package exclude them? Didn't know that 🤔

No, all the IDL is included as-is from specs with only the minimal fixes needed. But to actually interpret it, one has to apply partials and mixins, code which I've now written in multiple places. Here's the best I have:
https://github.com/foolip/mdn-bcd-collector/blob/c0a50a1fbd5ce5195c918aee360c7ec4edf84a02/build.js#L222

Have you also written this kind of code? If so, adding it to @webref/idl might make sense.

@saschanaz
Copy link
Owner

#10 is about mixins, but since the code needs not to flatten mixins, the patch tries to resolve the mixin support data from base interface support data. I think being able to access the new jsons for mixin in BCD could simplify the patch.

@foolip
Copy link
Author

foolip commented Feb 25, 2021

Ah, I see. BCD does have some mixins now, but also lots of things that are flattened, so it's really not straightforward to interpret it alongside IDL definitions, one would have to try matching both the mixin names and the real interface names I guess.

Waiting until BCD has no mixins sounds smart :)

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