-
Couldn't load subscription status.
- Fork 1.7k
Description
Using any of Uri.directory, Uri.file, and uri.toFilePath without explicitly specifying windows: false every time results in all of the Uri code for handling Windows file paths being included due to special handling added for Node in 5a74d8a. This technically also results in an extra check that will always evaluate to false.
Usages of these constructors and functions are often indirect, such as through other packages, making this quite hard to avoid.
I feel this cost is likely not worth it for handling the node case, and my initial feeling is that it would actually be quite surprising for my Dart compiled to JS to behave differently on Node than in the browser. When I compile to JS (or Wasm) I
personally expect I'm opting in to consistent behavior in respect to my code no matter the platform.
Anyone requiring platform specific Uri file behavior on Node (or any other non-browser JS runtime) should probably explicitly give a value to the windows parameter or use Node's https://nodejs.org/api/url.html#urlpathtofileurlpath and https://nodejs.org/api/url.html#urlfileurltopathurl functions.