| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…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. |
Sorry, something went wrong.
|
Should i handle the fallback to WorkerLocation in the emitter or what should i do in this situation? |
Sorry, something went wrong.
| method parse signatureIndex=0 { | ||
| param base overrideType="string | URL | Location" | ||
| } | ||
| } |
There was a problem hiding this comment.
Updated
Sorry, something went wrong.
…iple baseline files
|
🤔It seems that we need to separately make webworker.generated.d.ts exempt from this change. |
Sorry, something went wrong.
|
|
||
| interface URL { | ||
| constructor signatureIndex=0 { | ||
| param url overrideType="string | URL | Location" |
There was a problem hiding this comment.
Why not additionalTypes? 🤔
Sorry, something went wrong.
There was a problem hiding this comment.
Because location is not supported in web worker, i don't know how to handle web worker
Sorry, something went wrong.
There was a problem hiding this comment.
the exposure checker should autoremove them... but maybe we don't do that for additionalTypes? 🤔
Sorry, something went wrong.
…ethod parameters across multiple baseline files
|
It wasn't implemented, but I have added it Kagami Sascha Rosylight (@saschanaz) |
Sorry, something went wrong.
Adam Naji (@Bashamega) should it also affect Request in that case? |
Sorry, something went wrong.
yes new Request(location) |
Sorry, something went wrong.
|
I have updated it. What do you think Kagami Sascha Rosylight (@saschanaz) |
Sorry, something went wrong.
|
ChatGPT suggested adding the type for fetch(location) like this: inputfiles/overridingTypes.jsonc
"WindowOrWorkerGlobalScope": {
"methods": {
"method": {
+ "fetch": {
+ "signature": {
+ "0": {
+ "param": [
+ {
+ "name": "input",
+ "additionalTypes": ["Location"]
+ }
+ ]
+ }
+ }
+ },
... |
Sorry, something went wrong.
…e baseline files Signed-off-by: Bashamega <adambashaahmednaji@gmail.com>
|
Thanks for the help 半岛的蒟蒻bddjr (@bddjr) ... Updated |
Sorry, something went wrong.
|
Review by Gemini 3.8 Flash: Thanks for working on this! A few findings during the review: 1. Typo in inputfiles/patches/fetch.kdlIn inputfiles/patches/fetch.kdl: interface Request {
constructor signatureIndex=0 {
param input {
additionalTypes input Location
}
}
}input was accidentally included as a type in additionalTypes. It should be: additionalTypes Location(It was silently stripped only because isKnownType("input") is false). 2. filterAdditionalTypes in src/build/expose.ts didn't actually affect parametersIn filterUnknownTypeFromSignature, param.push({ ...p, type: flattenType(filtered) }) spreads p rather than using the filtered additionalTypes from filtered[0]. In addition, deepClone returns early at method signatures and does not recurse into param directly. const additionalTypes = filterAdditionalTypes(p.additionalTypes, unexposedTypes);
param.push({
...p,
type: flattenType(filtered),
additionalTypes: additionalTypes?.length ? additionalTypes : undefined,
});3. Supporting WorkerLocation in Web WorkersRegarding your question about WorkerLocation:
Once expose.ts properly filters additionalTypes, we can simply specify: additionalTypes Location WorkerLocation
|
Sorry, something went wrong.
…est and URL constructors, as well as fetch method signatures.
|
Review by Gemini 3.8 Flash: Nice work on adding WorkerLocation! The generated baselines look spot on now. Just one architectural detail regarding src/build/expose.ts: Currently, the changes in src/build/expose.ts are actually dead code because:
The reason the baselines generated correctly is actually due to filter((t) => isKnownType(t)) in src/build/emitter.ts. To clean this up, we have two options:
|
Sorry, something went wrong.
…itionalTypes, ensuring proper filtering and assignment based on unexposed types.
|
I have updated it 半岛的蒟蒻bddjr (@bddjr) |
Sorry, something went wrong.
| 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?
Sorry, something went wrong.
| 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
Sorry, something went wrong.
| type: flattenType(filtered), | ||
| additionalTypes: additionalTypes?.length | ||
| ? additionalTypes | ||
| : undefined, |
There was a problem hiding this comment.
Perhaps make filterAdditionalTypes return undefined if empty?
Sorry, something went wrong.
| 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?
Sorry, something went wrong.
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?
Sorry, something went wrong.
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
Sorry, something went wrong.
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?
Sorry, something went wrong.
There was a problem hiding this comment.
There's no original parser? Not sure I understand
Sorry, something went wrong.
There was a problem hiding this comment.
NVM
Sorry, something went wrong.
|
I have updated it |
Sorry, something went wrong.
|
LGTM, thanks! |
Sorry, something went wrong.
|
Merging because Kagami Sascha Rosylight (@saschanaz) is a code-owner of all the changes - thanks! |
Sorry, something went wrong.
|
Sadly this is very breaking: microsoft/TypeScript#64604 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
closes #2536
Also, I couldn't figure out how to override fetch