Update URL & Request & XMLHttpRequest interface to accept Location - #2552
Conversation
…ds across multiple baselines
|
Thanks for the PR! This section of the codebase is owned by Kagami Sascha Rosylight (@saschanaz) - if they write a comment saying "LGTM" then it will be merged. |
|
Should i handle the fallback to WorkerLocation in the emitter or what should i do in this situation? |
| method parse signatureIndex=0 { | ||
| param base overrideType="string | URL | Location" | ||
| } | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Updated
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
…iple baseline files
|
🤔It seems that we need to separately make |
|
|
||
| interface URL { | ||
| constructor signatureIndex=0 { | ||
| param url overrideType="string | URL | Location" |
There was a problem hiding this comment.
Why not additionalTypes? 🤔
There was a problem hiding this comment.
Because location is not supported in web worker, i don't know how to handle web worker
There was a problem hiding this comment.
the exposure checker should autoremove them... but maybe we don't do that for additionalTypes? 🤔
…ethod parameters across multiple baseline files
|
It wasn't implemented, but I have added it Kagami Sascha Rosylight (@saschanaz) |
Adam Naji (@Bashamega) should it also affect |
yes new Request(location) |
|
I have updated it. What do you think Kagami Sascha Rosylight (@saschanaz) |
|
ChatGPT suggested adding the type for inputfiles/overridingTypes.jsonc
"WindowOrWorkerGlobalScope": {
"methods": {
"method": {
+ "fetch": {
+ "signature": {
+ "0": {
+ "param": [
+ {
+ "name": "input",
+ "additionalTypes": ["Location"]
+ }
+ ]
+ }
+ }
+ },
... |
…e baseline files Signed-off-by: Bashamega <adambashaahmednaji@gmail.com>
|
Thanks for the help 半岛的蒟蒻bddjr (@bddjr) ... Updated |
|
Review by Gemini 3.8 Flash: Thanks for working on this! A few findings during the review: 1. Typo in
|
…est and URL constructors, as well as fetch method signatures.
|
Review by Gemini 3.8 Flash: Nice work on adding Just one architectural detail regarding Currently, the changes in
The reason the baselines generated correctly is actually due to To clean this up, we have two options:
|
…itionalTypes, ensuring proper filtering and assignment based on unexposed types.
|
I have updated it 半岛的蒟蒻bddjr (@bddjr) |
| p.additionalTypes!.push("URL"); | ||
| if (!p.additionalTypes!.includes("URL")) { | ||
| p.additionalTypes!.push("URL"); | ||
| } |
There was a problem hiding this comment.
Why? Just don't add it in patch that case?
| allEnumsMap[type] || | ||
| allTypedefsMap[type] | ||
| ); | ||
| } |
There was a problem hiding this comment.
This is a wrong layer, this filter should belong to expose.ts where things are already happening
| type: flattenType(filtered), | ||
| additionalTypes: additionalTypes?.length | ||
| ? additionalTypes | ||
| : undefined, |
There was a problem hiding this comment.
Perhaps make filterAdditionalTypes return undefined if empty?
| interface Request { | ||
| constructor signatureIndex=0 { | ||
| param input { | ||
| additionalTypes Location WorkerLocation |
There was a problem hiding this comment.
I wonder we could have something like acceptsUrl=#true for type and then the emitter could add Location/WorkerLocation based on the emission target 🤔, at the same line where URL is being added right now. Thoughts?
There was a problem hiding this comment.
We will need to change a lot of other files is it worth it?
Also should this be similar to IDL?
There was a problem hiding this comment.
We are doing this because IDL doesn't say whether URL is expected or not at all. I thought doing it would cause less files, any idea how much changes would be needed?
But we may need the additionalTypes feature in the future after all, so I'm going to accept this as-is
There was a problem hiding this comment.
Will this mean we translate that property to jsonc and support it in the original parser? Or did I misunderstand?
There was a problem hiding this comment.
There's no original parser? Not sure I understand
|
I have updated it |
|
LGTM, thanks! |
|
Merging because Kagami Sascha Rosylight (@saschanaz) is a code-owner of all the changes - thanks! |
closes #2536
Also, I couldn't figure out how to override fetch