You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a breaking change, but I think this should be handled early in Gren. Urls with non-http(s) protocols are common even in browsers as seen in the elm issue.
Maybe expanding the type Protocol = Https | Http | Scheme String to still support differentiating between http and https and other. But it might be even better to leave this parsing to the consuming code, and just redefine Protocol as Scheme, and do type Scheme = Scheme String
The text was updated successfully, but these errors were encountered:
I think this is valuable. However, it's important to note that most of the fields in the current URL type (host, port, path, fragment) are not general attributes of URLs and the meaning and parsing is defined per scheme. The registry of URL schemes with links to the parsing specification for each is here https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
So imo if this were done, it should be done with consideration to actual use cases, and respect the actual specifications. Personally I'd suggest collecting specific examples of how this would be used. There are probably several common schemes that possibly follow the same structure as the http schemes and are relevant to web app development (file:, ipfs:, ftp:, etc) that I could see as reasonable to add (if all of those do in fact define port, host, path, query, fragment in the same way in their specifications). Beyond that, I'd also be interested to see examples where the app would value out of having URL support more schemes vs simply using the String type for URLs that aren't web URLs.
See: elm/url#10
This is a breaking change, but I think this should be handled early in Gren. Urls with non-http(s) protocols are common even in browsers as seen in the elm issue.
Maybe expanding the
type Protocol = Https | Http | Scheme String
to still support differentiating between http and https and other. But it might be even better to leave this parsing to the consuming code, and just redefine Protocol as Scheme, and dotype Scheme = Scheme String
The text was updated successfully, but these errors were encountered: