-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Moving forward to version 3.0.0 #474
Comments
"I wonder whether it would be bad style to continue working in develop" How about doing it the GCC way: 4.9.x Everything in parallel: Just my own opinion. |
That's a good idea, we should separate branches, since we will surely backports bug fixes from 3.0.0 to previous versions. GCC still releases 4.9.x |
(We have to keep in mind that the GCC project has far more people, and I could live without 2.x.x releases while preparing for 3.0.0.) |
2.x.x: No new feature additions, Only fixes. Define an LTS, few months or years. |
If you need a definition for what it means to have 3.0.0 vs 2.x.x, I suggest you go with semver.org's definition:
As for where you do it, I wouldn't expect anyone to be basing production code on a |
@ibroheem I don't think I have the manpower to support 2.x.x for too long... @gregmarr I like semver - I was just unsure about the actual process and how to implement it with Github. I totally agree that no-one should work trust |
Even if you expect minimal legacy support for 2.x.x., the branching model should still allow for it, in case you need to make a trivial but important fix now and then. |
I created a wiki page https://github.com/nlohmann/json/wiki/Road-toward-3.0.0 to describe the transition toward version 3.0.0. On this page, all API-breaking changes shall be documented.
I added a wiki page with notes on the road toward version 3.0.0. I also linked this page in the README file. You all have been warned ;-) |
Hi, here are some things I had in mind for 3.0.0: Reduce the number of
|
+1 on changing the template to a traits/policy class. I did file an issue on this because I think there's some really cool things you could do with that (#456). |
@theodelrieu I am currently working at the exceptions. I plan to have a class |
I shall have a look at clang-format, but it seems to be a lot of work to make it work like astyle. |
Hi, I've been thinking about something a bit crazy the past few days! One of the problems I also have with I'd like to keep only constructors, query methods, DISCLAIMER What I have in mind: namespace njson {
// this struct exposes each template arg (just like basic_json does: object_t, etc...)
template <...> struct basic_json_traits{/*...*/};
using default_traits = basic_json_traits<>;
template <typename JSONTraits = default_traits>
class basic_value {
public:
// for 2.x.x compat
static basic_value parse(...) [[deprecated]] {
return ::njson::parse<basic_value>(...);
}
// and so on for the other methods
};
using value = basic_value<>;
// default traits: auto val = njson::parse(...);
// custom traits: auto val = njson::parse<my_custom_json_value>(...);
template <typename BasicJsonValue = value>
BasicJsonValue parse(...) {/*...*/}
} // namespace njson
// old code will still compile with this
namespace nlohmann [[deprecated]] {
template <typename T, typename SFINAE>
using adl_serializer = ::njson::adl_serializer<T, SFINAE>;
template <...>
using basic_json = ::njson::basic_value<::njson::basic_json_traits<...>>;
using json = ::njson::value;
} There is a slight change on each method call for custom json values, (e.g. I can start a POC on my fork, I'm quite confident that everything should work as expected. What do you all think about this? I'm waiting for your inputs :) PS: |
@theodelrieu We should discuss this in Slack some time. |
Sure, I will post on slack at what time I'm available this weekend |
Is there a slack team/channel for this project? |
Here it is, however I think I need to invite your email address. We might set up an IRC channel at freenode, it would be easier for everybody to join, ask questions, and participate to discussions. |
Let's please use Slack - opening a second channel would just mean more work... |
That's right, my bad |
This may be on short notice, but I am in Slack (https://nlohmannjson.slack.com/messages/general) now and most likely for the next 3 hours. @theodelrieu @gregmarr and everybody, feel free to join! |
@theodelrieu I thought about your proposal to reorganize the classes; that is, move most of them out of Here is the current structure:
I added the lines of code to support your observation that there is a lot of code that could be moved out of the way. However, I also found some ways to group things along the aspects they address. Furthermore, it would be helpful to also move everything related to CBOR/MessagePack as well as JSON Pointer/Patch out of the way:
I would like to discuss how to restructure this logically. Moving classes into separate files would then be the next step. |
This seems good to me! I will have more time to discuss next week, meanwhile I'll try to work a bit on my fork. |
Perhaps some of the deprecated code could also be moved do a "deprecated" namespace and require an explicit "using" to bring it back. |
FYI: With the latest commit, I merged a feature branch with a manual lexer. That is, the code does not use a state machine generated by re2c, but a hand-written state machine. In addition, I implemented "input adapters" separate the actual input (e.g., stream, string, byte vector) from the lexer. This simplified a the code in a lot of places and avoids error-prone refilling of an intermediate buffer that was required by re2c. |
Nice to hear! Is it a good time to start splitting the |
Opened #623 as place to discuss the structure of the parsing functions. |
Hi, I've been thinking a bit about all the template arguments that The intent was to be "generic", and let users decide which string, object type (and others) they wanted to use. One of the issue is that in the implementation, there's often lots of constraints about the API of those types. Right now, you cannot use something else than Although there are some people that may want to handle floats themselves (e.g. #596) I doubt someone ever specialized Furthermore, IIRC the So, my question is: Which template arguments are really relevant/useful? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
any news on this release? |
I wish... I would like to get this release out this year, but I don't have much time for big changes at the moment. So far, I would rather have something released soon just to have |
Todo:
|
I shall release 3.0.0 tomorrow. |
I kept postponing the step toward version 3.0.0 for quite some time and quite some issues have been piled up. These issues have in common that fixing them will break the public API - be it very obvious such as removing deprecated functions or changing the type of exceptions or rather subtle such as begin able to store a NaN value.
Question is: How to proceed? So far, I worked in the
develop
branch. As soon as I, for instance, remove deprecated functions and push todevelop
, this code may break existing applications. I can live with that - we still havemaster
as a branch containing the code of the last release, yesterday's 2.1.1. Furthermore, OSS-Fuzz for instance, checks thedevelop
branch, so it would be a bit dangerous to only work in a feature branch.I wonder whether it would be bad style to continue working in
develop
. What do you think?The text was updated successfully, but these errors were encountered: