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

chore(url): release url@1.0.0 #4992

Closed
wants to merge 2 commits into from
Closed

chore(url): release url@1.0.0 #4992

wants to merge 2 commits into from

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jun 6, 2024

To be merged July 7.

Closes #4924

@iuioiua iuioiua requested a review from kt3k as a code owner June 6, 2024 21:00
@github-actions github-actions bot added the url label Jun 6, 2024
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.82%. Comparing base (b6906a9) to head (c245151).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4992   +/-   ##
=======================================
  Coverage   95.82%   95.82%           
=======================================
  Files         458      458           
  Lines       37853    37853           
  Branches     5563     5563           
=======================================
  Hits        36272    36272           
  Misses       1541     1541           
  Partials       40       40           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the basename behaviour makes sense - we should not stabilize it.

Namely the fact that it is really

import { basename } from "@std/path/posix";

if (url.path !== "/") {
  return basename(url.path);
} else {
  return url.hostname;
}

Additionally, the connotation that url.* methods operates on a URL is not really correct. It operates on URLs that have posix formatted paths. This is weird, because not all URLs have posix formatted paths. Take for example data URLs:

> new URL("data:application/javascript,1+1;")
URL {
  href: "data:application/javascript,1+1;",
  origin: "null",
  protocol: "data:",
  username: "",
  password: "",
  host: "",
  hostname: "",
  port: "",
  pathname: "application/javascript,1+1;",
  hash: "",
  search: ""
}

This is not a posix formatted path.

Because of this, I think that really we shouldn't be doing this - we should just document that people can use join, basename, and friends from @std/path/posix.

@iuioiua
Copy link
Contributor Author

iuioiua commented Jul 10, 2024

Frankly, the purpose of @std/url has always been a little unclear to me because the APIs are such thin wrappers around @std/path APIs, as you point out. I'll create a PR which aims to improve @std/path documentation by including equivalent examples for @std/url. Then we can see what to do with @std/url 🙂

@iuioiua
Copy link
Contributor Author

iuioiua commented Jul 10, 2024

Perhaps, one of the only things @std/url offers over just using @std/path/posix APIs is that it strips URL.hash and URL.search properties before processing the values. I'm not sure whether that provides sufficient justification for keeping the package...

@iuioiua
Copy link
Contributor Author

iuioiua commented Aug 5, 2024

Closing as we're instead removing @std/url. See #5530 for details.

@iuioiua iuioiua closed this Aug 5, 2024
@iuioiua iuioiua deleted the url-1 branch August 5, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stabilize @std/url
4 participants