-
Notifications
You must be signed in to change notification settings - Fork 52
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
Drop CF dependency #10
Comments
This is load-bearing code, therefore we need to fully understand the changes necessary before making the switch. There is an ongoing to effort to reimplement URL in Swift, and this will be one of the top issues to figure out. |
Sure. For creation, we have: NSURL(absoluteURLWithDataRepresentation: Data("https://example.com?q=1|2".utf8), relativeTo: nil) as URL
$R34: Foundation.URL = "https://example.com?q=1|2"
^ The goal of this issue is only to avoid direct uses of CoreFoundation, because it is supposed to be a private implementation detail of Foundation. While some of the earlier supported platforms (Darwin-family, Linux) allow it to be imported anyway, on newer platforms (Windows, Wasi), I haven't found a way to get the path and query exactly as they are in a URL (without running them through another percent-encoding pass) - although, as I mentioned on the forums, other APIs such as As for reimplementing URL in Swift, I believe the goal is to preserve the existing API. I've tried to reach out to the Foundation team regarding URL as I have some expertise in that area but, as with every other time I've tried to reach out over the years, have been completely ignored. I don't see any indication that a major URL rewrite with significant API changes is imminent from Foundation, and in terms of this library I have suggested some more promising, actionable alternatives above. |
I'm not in the position to decide URL behavior. We will raise this issue and your proposal with Foundation team and people responsible for URL, but this package is not the only one depending on a particular URL behavior. An API as old as NSURL has rough edges from the bug fixes and compatibility workarounds gathered over the years so I would understand the hesitancy to change the behavior. Introducing a new WHATWG mode or a new API might be the only viable way forward. In the meantime if Windows support is desired, a possible workaround is to call |
I noticed that this library uses CoreFoundation directly. IIRC that is not portable; CF is available on Darwin platforms and Linux, but is deliberately omitted from other platforms (e.g. Windows).
See discussion on the Swift forums announcement thread. Basically, Foundation doesn't (yet) provide the APIs this library needs. There may be ways around it, but that discussion is probably better to have here than on the forums.
The text was updated successfully, but these errors were encountered: