-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
proposal: encoding/json/v2: add new JSON API behind a GOEXPERIMENT=jsonv2 guard #71845
Comments
Worth noting that one alternative would be to publish the entire code under e.g. I see a few advantages to that mechanism:
|
given it's already in an external module, I'm not sure what another copy in x/exp would gain us? |
x/exp is part of the Go project, which brings many benefits - Gerrit, CI, the rest of the reviewers and approvers. Plus, the import path blesses it as official to users, whereas https://github.com/go-json-experiment is pretty much just a third party org. |
an external module wouldn't benefit any existing users of encoding/json (which right now is ~all of them), without rewriting their imports, and reverting when it's released. |
The primary purpose of this proposal is to make it easier to test the proposed new implementation of the |
This seems reasonable. @ianlancetaylor and I would like to at least look over #71497 because we start moving this forward. We plan to do that in the next week. Assuming it passes our sniff test, I think we can proceed with the GOEXPERIMENT=jsonv2 proposal. |
This comment has been minimized.
This comment has been minimized.
This proposal has been added to the active column of the proposals project |
This is an adjunct proposal to #71497.
#71497 proposes adding a new JSON API, consisting of
encoding/json/v2
andencoding/json/jsontext
packages. The existingencoding/json
package is modified to use the new v2 implementation internally. Several new functions are added toencoding/json
. See that proposal for details.The proposed new API is implemented in
github.com/go-json-experiment/json
.I propose that we merge the implementation in github.com/go-json-experiment/json into std immediately, enabled only when the GOEXPERIMENT=jsonv2 experiment flag is set.
When the jsonv2 experiment flag is not enabled, there will be no user-visible changes to std. The
encoding/json
package will exist exactly as it is now, and the proposed new packages will not exist.When GOEXPERIMENT=jsonv2 is set:
encoding/json/v2
andencoding/json/jsontext
packages will exist.encoding/json
package will be implemented in terms ofencoding/json/v2
.encoding/json
package will include the new APIs proposed in proposal: encoding/json/v2: new API for encoding/json #71497.The experimental API will not be bound by the Go compatibility promise and will evolve as updates are made to #71497.
If #71497 isn't approved in time for Go 1.25, we can either ship 1.25 with the GOEXPERIMENT guard or revert the experimental API in the 1.25 release. If #71497 is rejected, we'll remove the experimental package.
This proposal presumes that while there are still details being resolved, #71497 is on track for acceptance and we're happy with the general structure of the proposed API. Merging it into the main go repository prior to acceptance will make it easier for users to test out the new implementation.
The text was updated successfully, but these errors were encountered: