lib: make Navigator WPT-compliant - #65119
Conversation
|
Review requested:
|
Signed-off-by: avivkeller <me@aviv.sh>
|
We discussed these before. The legacy properties were proposed in #50521, which was closed because there was no clear Node.js use case or interoperability benefit.
WinterTC55 Navigator Registry also says that non-browser runtimes should not implement these legacy properties. If they do, they should implement the whole compatibility group with a matching browser-style I don't think passing these WPT tests is enough reason to revisit those decisions unless there is new use case or compatibility issue that wasn't considered in #50521 and #50224. |
|
I'm aware that previous attempts to add these properties were rejected, but I still think there is value in supporting them, particularly for Web Platform compatibility. Passing the relevant WPTs means that code relying on We've historically been willing to retain legacy functionality, such as These properties add a small amount of effectively unchanging values. Given the low maintenance cost, I think supporting them for compatibility with widely available Web APIs is something we should be open to. |
|
Even if other runtimes such as Deno and Bun don't support these properties, I don't think that should necessarily prevent us from doing so. There are 450K+ GitHub code results referencing them. While much of that code is undoubtedly intended for browsers, supporting these properties increases the amount of "general-purpose" JavaScript that can run in Node.js. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65119 +/- ##
==========================================
- Coverage 90.31% 90.31% -0.01%
==========================================
Files 759 759
Lines 248290 248342 +52
Branches 46859 46868 +9
==========================================
+ Hits 224241 224280 +39
- Misses 15472 15511 +39
+ Partials 8577 8551 -26
🚀 New features to boost your workflow:
|
Adds
appCodeName,appName,appVersion, andproductto the navigator, so it can pass WPT.onLineis also defined in the spec, so it's added as well.