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

is-reachable is huge since v2.2.0 #37

Closed
nikku opened this issue Aug 27, 2019 · 5 comments · Fixed by #38
Closed

is-reachable is huge since v2.2.0 #37

nikku opened this issue Aug 27, 2019 · 5 comments · Fixed by #38

Comments

@nikku
Copy link

nikku commented Aug 27, 2019

image

I had to pin my npx installable script to version 2.1.0 to not download two megabytes of utility.

Looks like port-numbers makes the bundle size explode. Is this dependency really necessary?

Cf. v2.1.0...v2.2.0.

@sindresorhus
Copy link
Owner

// @silverwind

@silverwind
Copy link
Collaborator

port-numbers is for:

Well-known protocols are supported (for example: ftp://, mysql://, redis:// and more).

It does include two huge JSON files to support thousands of protocols, but I'm happy if you want to remove the dependency to reduce size in a semver-major. It's rather unnecessary and not many people are probably using those protocol prefixes.

silverwind added a commit that referenced this issue Aug 28, 2019
Now, only http: and https: are supported for port-less URLs. Also improved the redirect check.
silverwind added a commit that referenced this issue Aug 28, 2019
Now, only http: and https: are supported for port-less URLs. Also improved the redirect check.
silverwind added a commit that referenced this issue Aug 28, 2019
Now, only http: and https: are supported for port-less URLs. Also improved the redirect check.
@nikku
Copy link
Author

nikku commented Aug 28, 2019

@silverwind Thanks for clarifying.

For me this depends on where you'd see this library: Should it be focused and micro or should it support an extensive set of features.

I personally check for reach-ability of HTTP(S) URLs only so for me that additional feature has (and had) no value.

@silverwind
Copy link
Collaborator

silverwind commented Aug 28, 2019

postgresql://host is also a URL and the module would need to know that that means port 6379. I'm thinking the primary use of the module should be host:port, with port being a number, but we do have a special exception for HTTP/HTTPS protocol in there because it's so common, but I don't like the ambiguity.

@nikku
Copy link
Author

nikku commented Aug 28, 2019

Yea, sorry. When writing URL I actually meant HTTP(S) URLs. Makes perfect sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants