-
Notifications
You must be signed in to change notification settings - Fork 162
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
Diff against modern typescript definitions #486
Comments
Also there is all this code: https://github.com/ScalablyTyped/Distribution/tree/master/s/std/src/main/scala/typings/std everything is there. It has a few scalablytypedisms we may want to change/delete, but it should be a treasure trove for copy/pasting into this repo. |
@oyvindberg see my comment #481 (comment). At the moment, I am feeling confused why that doesn't just become scala-js-dom. |
@armanbilge I see a lot of value in having a stable and conservative version of the DOM, scala-js-dom has seen very little changes over the years and it has absolutely not been a source of problems. Autogenerated is better for many other things, like if you need an up to date and complete version, possibly tailored to your environment/preference by rewriting all So I see two paths going forward regarding this:
2 sounds like less pain to me. edit: less pain for downstream in particular. |
Thank you for this explanation, very helpful :) Regarding 1 vs 2, idk between type aliases and @japgolly magical scalafixes 1 could be less painful that it might seem (but still more than 2 for sure).
The original version here being In fact, as of #471 we are already effectively using a document like that to keep track of the API changes. Is it just me, or does this seem like a lot of duplicated effort? |
@oyvindberg do you still have time to look into this? No worries if not! :) |
No, sorry. I'll contribute this sometime later :) |
I'll leave this open, still a good thing to do! |
Now that we are de-namespacing everything in #545, I think should be much easier? Actually, more than a diff of scala-js-dom against the typescript definitions, I'm curious about a diff against ST's generated source. I am very curious how far away we could be from just "flipping the switch" on automation #487 from a source-compatibility perspective. Btw just jotting this down as it popped into my head, no expectation that anyone does this and certainly not anytime soon :) |
Context: It's a quiet Sunday morning and I'm circling back to dust off & modernize some 7yo code of mine that used Pointer Events .. and that made me ask whether Pointer Events had made it into the facade. Last time I raised it in 2015, they hadn't due to immaturity, but browser support has flipped Red to Green since then. As always, @oyvindberg is all over it, with After some issue reading to understand state of play, I'm left weighing up two options:
Both options have pros & cons. A patch to scala-js-dom might allow using nice OTOH, hand-maintained scala-js-dom feels a little obsolete next to the efficiency of auto-generation from TS interfaces. Overall Im tending towards patch because it's less change & "perfect is enemy of good" etc.. Also, I find generated ScalablyTyped facades often harder to make sense of than I naively expect, eg Im not sure what all these refs to I mention all this here because it hopefully helps inform the future plan and provides one concrete example of a use case. |
Thanks @benhutchison, that was very helpful commentary. I linked to it from #487 since its relevant to that discussion. In the meantime, PRs for Edit: btw, another change since 2015 is we'll now acccept facades for any specced API, regardless of its support in browsers. See: https://github.com/scala-js/scala-js-dom/blob/main/CONTRIBUTING.md#facades |
AFAIU scala-js-dom was originally generated based on some ancient version of typescript, in the 1.x days and manually patched since. In the meantime those definitions have seen considerable expansion and refactoring, as well as being based on the standard web idl.
I have almost all the pieces to diff scala-js-dom with those typescript definitions to generate a report with all missing/different methods, fields and types.
I volunteer to do that next week, so we can get an idea of how much surface we're missing.
The text was updated successfully, but these errors were encountered: