Skip to content
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

Introduce @siteimprove/alfa-url package #421

Merged
merged 8 commits into from
Oct 2, 2020
Merged

Introduce @siteimprove/alfa-url package #421

merged 8 commits into from
Oct 2, 2020

Conversation

kasperisager
Copy link
Contributor

@kasperisager kasperisager commented Sep 30, 2020

This pull request introduces a new @siteimprove/alfa-url package with an implementation of an immutable URL class modelled on the WHATWG URL specification. An obvious question might be "why not just use the WHATWG URL DOM API?" to which the obvious answer is "well, it kinda does". That is, URL.parse() relies on the WHATWG URL DOM API for parsing URL strings and extracting URL records. From there, the URL class also adds some convenience like implementations of Equatable, Hashable, and Serializable, making it easy to use URL instances in the various data structures Alfa provides.

The caveat to this approach is of course that we now rely on the WHATWG URL specification being implemented by whatever runtime Alfa is used in, which shouldn't really be a problem. It's of course readily available in browsers and is also supported in Node.js 10+ as well as Deno.

@kasperisager kasperisager added the major Backwards-incompatible change that touches public API label Sep 30, 2020
@kasperisager kasperisager self-assigned this Sep 30, 2020
@kasperisager kasperisager requested a review from Jym77 October 2, 2020 07:53
@kasperisager kasperisager marked this pull request as ready for review October 2, 2020 08:01
packages/alfa-url/src/url.ts Show resolved Hide resolved
@kasperisager kasperisager merged commit c42906f into master Oct 2, 2020
@kasperisager kasperisager deleted the alfa-url branch October 2, 2020 09:52
kasperisager added a commit that referenced this pull request Oct 5, 2020
* master:
  Update changelog
  Introduce `@siteimprove/alfa-url` package (#421)
  Mark `Property` as internal
  Default `Import` condition to `None`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Backwards-incompatible change that touches public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants