Hyeseong Kim
Hyeseong Kim
Ok, this is actually ambiguous. ```res switch n { | n => n | 1 // ^ Is this an or-pattern or binary expression? ``` This is tricky because we...
Maybe reviving local open syntax would help to deal with this kind of ambiguity
The problem is not because of `@scope`, but the module name.
I see. It should be something like: ```js let URL$1 = {}; URL.revokeObjectURL("some url"); export { URL$1 as URL, } ```
Workaround (IMO the correct resolution): ```res module URL = { @val @scope("globalThis.URL") external revokeObjectURL: string => unit = "revokeObjectURL" } URL.revokeObjectURL("some url") ```
`globalThis` should be mangled by default. The output in v12 is: ```js let URL = {}; globalThis.URL.revokeObjectURL("some url"); let $$globalThis = 0; export { URL, $$globalThis, } /* Not a...
Maybe we can make it as a standard like `@globalScope(..)` ?
Ahh I totally forgot. I will work on it this weekend
The downside is as mentioned in https://github.com/rescript-lang/rescript-compiler/issues/6738#issuecomment-2075174646 Using this feature can reduce interoperability with other ser/de libraries.
As mentioned in the text, we already have some internal fields to protect. It will be useful when the ReScript user wants to hide such fields or protect records from...