Advent of cats-parse
See original GitHub issueThese files have parboiled imports that need to go. We are moving them to cats-parse. Some of these files are related. Some are enormous and can be broken down. They could be tasked better, but this is a start.
All work should target the series-0.22 branch, but all of this will get it closer.
Basic steps:
-
We are putting parsers on the companion objects of the type they parse, as
private[http4s]
. By being on the companion, they can invoke private constructors with validated values. Commenting on the RFC rules each parser implements is nice, as it makes it easier to trace back to the spec. -
Replace the
.fromString
or.parse
method on the companion with code like this. -
Delete any parboiled parsers left behind.
-
Run
core/mimaReportBinaryIssues
and add MiMa exclusions. They were all private, so it’s safe. -
If you find common rules, we are putting some RFC objects in an internal package to share.
-
Some of these are trivial and some are very hard. If you get in over your head, we’re on Gitter or we’re here.
If you’re interested in one, please comment:
- ./core/src/main/scala/org/http4s/ContentCoding.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/MediaType.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/QValue.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/Query.scala (@rossabaker)
- ./core/src/main/scala/org/http4s/TransferCoding.scala (#4023)
- ./core/src/main/scala/org/http4s/Uri.scala (@rossabaker)
- ./core/src/main/scala/org/http4s/parser/AcceptCharsetHeader.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/parser/AcceptEncodingHeader.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/parser/AcceptHeader.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/parser/AcceptLanguageHeader.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/parser/AdditionalRules.scala
- ./core/src/main/scala/org/http4s/parser/AuthorizationHeader.scala (@hamnis)
- ./core/src/main/scala/org/http4s/parser/CacheControlHeader.scala (@deniszo)
- ./core/src/main/scala/org/http4s/parser/ChallengeParser.scala (@hamnis)
- ./core/src/main/scala/org/http4s/parser/ContentTypeHeader.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/parser/CookieHeader.scala (@rossabaker)
- ./core/src/main/scala/org/http4s/parser/ForwardedHeader.scala (@fredshonorio)
- ./core/src/main/scala/org/http4s/parser/ForwardedModelParsing.scala (@fredshonorio)
- ./core/src/main/scala/org/http4s/parser/Http4sHeaderParser.scala
- ./core/src/main/scala/org/http4s/parser/Http4sParser.scala
- ./core/src/main/scala/org/http4s/parser/IpParser.scala (#4004)
- ./core/src/main/scala/org/http4s/parser/LinkHeader.scala (@novakov-alexey)
- ./core/src/main/scala/org/http4s/parser/OriginHeader.scala (@lewisjkl)
- ./core/src/main/scala/org/http4s/parser/ProxyAuthenticateHeader.scala (@hamnis)
- ./core/src/main/scala/org/http4s/parser/RangeParser.scala (@fredshonorio)
- ./core/src/main/scala/org/http4s/parser/RequestUriParser.scala (@rossabaker)
- ./core/src/main/scala/org/http4s/parser/Rfc2616BasicRules.scala
- ./core/src/main/scala/org/http4s/parser/Rfc3986Parser.scala (@rossabaker)
- ./core/src/main/scala/org/http4s/parser/SimpleHeaders.scala
- ./core/src/main/scala/org/http4s/parser/StrictTransportSecurityParser.scala
- ./core/src/main/scala/org/http4s/parser/UriHeaderParser.scala
- ./core/src/main/scala/org/http4s/parser/WwwAuthenticateHeader.scala (@hamnis)
- ./core/src/main/scala/org/http4s/parser/ZipkinHeader.scala (@m-sp)
- ./core/src/main/scala/org/http4s/util/UrlCoding.scala (@rossabaker)
Inspired by this Twitter thread.
Issue Analytics
- State:
- Created 3 years ago
- Comments:27 (26 by maintainers)
Top GitHub Comments
🎉 This was a massive effort. Thanks to all who participated!
I’ll also take ./core/src/main/scala/org/http4s/parser/ForwardedHeader.scala ./core/src/main/scala/org/http4s/parser/ForwardedModelParsing.scala