Monkey patch partial interface definitions
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- tooling
Research direction
Read lib/transformer.js, especially the Transformer._parse path shown in the error, and compare it with the partial Navigator example. Done means webidl2js can generate the requested monkey patch for a partial interface while accounting for a dependency that may be provided natively without an interface attribute.
Written by the indexing model from the issue text.
Description
When a spec defines a partial addition to an existing interface, it will be useful if webidl2js can generate the monkey patch required to implement the addition.
For example, from the Credential Management Level 1 spec:
partial interface Navigator {
[SecureContext, SameObject] readonly attribute CredentialsContainer credentials;
};
Currently webild2js assumes that Navigator is defined somewhere else in the provided webidl and errors out in parsing as it's not found:
TypeError: Cannot read property 'idl' of undefined
at Transformer._parse (/Users/danyao/sandbox/webidl2js/e2e/node_modules/webidl2js/lib/transformer.js:143:58)
at Transformer.<anonymous> (/Users/danyao/sandbox/webidl2js/e2e/node_modules/webidl2js/lib/transformer.js:250:12)
at Generator.next (<anonymous>)
at onFulfilled (/Users/danyao/sandbox/webidl2js/e2e/node_modules/co/index.js:65:19)
at <anonymous>
What we need is probably something like this:
const CredentialsContainer = require("./CredentialsContainer");
navigator.credentials = Object.create(CredentialsContainer.interface.prototype);
We might need to also account for the fact that CredentialsContainer may be provided natively by the UA, so may not have the interface attribute (see https://github.com/jsdom/webidl2js/issues/81).
- Dominant language
- JavaScript
- Stars
- 98
- Forks
- 35
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jsdom/webidl2js
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 35/100
jsdom/webidl2js#257 · 6 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
jsdom/webidl2js#188 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
jsdom/webidl2js#160 · 3 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Wrapper lazy instantiationPossibly taken @pmdartus claimed this 2487 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
jsdom/webidl2js#157 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
SACGF/variantgrid#2791 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zilliztech/memsearch#853 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
MadiroGlobalHealth/UVL-EMR#580 ·
Maintainers usually reply within 1 day
-
ci enhancement need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
[BUG] Mobile menu doesn't work on the Rabbit Behaviour pagePossibly taken @Aryamuh-ynah claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Riya-Kharade/PetSathi#110 · 1 comment ·
Maintainers usually reply within 1 day