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

Add metadata to getMacroProps function #873

Merged
merged 3 commits into from
Nov 8, 2019

Conversation

JamzTheMan
Copy link
Member

@JamzTheMan JamzTheMan commented Nov 8, 2019

Fixes #872

Also changed json to build from LinkedHashMap instead of HashMap so json output now matches the insert order of the objects for a cleaner output that can be controlled.


This change is Reviewable

Signed-off-by: JamzTheMan <JamzTheMan@gmail.com>
@JamzTheMan JamzTheMan added feature Adding functionality that adds value macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) S Small impact. T-shirt style story pointing/scope labels Nov 8, 2019
@JamzTheMan JamzTheMan self-assigned this Nov 8, 2019
@JamzTheMan JamzTheMan requested a review from Phergus November 8, 2019 00:26
@cwisniew
Copy link
Member

cwisniew commented Nov 8, 2019

Fixes #872

Also changed json to build from LinkedHashMap instead of HashMap so json output now matches the insert order of the objects for a cleaner output that can be controlled.

This change is Reviewable

After the JSON update in progress there is no guarantee this will continue to be the case. GSON is less featured than the current json library and there is no way to control this (plus you shouldnt rely on ordering of fields in json objects)

cwisniew
cwisniew previously approved these changes Nov 8, 2019
Copy link
Member

@cwisniew cwisniew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Phergus)

@JamzTheMan JamzTheMan removed the request for review from Phergus November 8, 2019 00:41
Signed-off-by: JamzTheMan <JamzTheMan@gmail.com>
Signed-off-by: JamzTheMan <JamzTheMan@gmail.com>
@JamzTheMan
Copy link
Member Author

I swore I ran spotlessApply... ug...

Also, not sure why IntelliJ is saving in a different format when I imported the Java Google code specs...

@JamzTheMan JamzTheMan requested a review from Phergus November 8, 2019 00:53
@JamzTheMan
Copy link
Member Author

Fixes #872
Also changed json to build from LinkedHashMap instead of HashMap so json output now matches the insert order of the objects for a cleaner output that can be controlled.
This change is Reviewable

After the JSON update in progress there is no guarantee this will continue to be the case. GSON is less featured than the current json library and there is no way to control this (plus you shouldnt rely on ordering of fields in json objects)

If it sticks it sticks, if not, no big deal. There's no "reliance" needed, it's simply makes for a nicer output in chat using json.ident. 😄
It would be nice if GSON followed the Collections list order but I wouldn't worry about it in the least.

@Merudo
Copy link
Member

Merudo commented Nov 8, 2019

If GSON is less featured than our JSON, why not keep the current library?

We can use our existing functions to convert the output of json.path into JSON elements if need be.

By converting to GSON, we may be doing a needless downgrade. Unless there is some performance gain from using GSON?

@cwisniew
Copy link
Member

cwisniew commented Nov 8, 2019

If GSON is less featured than our JSON, why not keep the current library?

We can use our existing functions to convert the output of json.path into JSON elements if need be.

By converting to GSON, we may be performing a needless downgrade. Unless there is some performance gain from using GSON?

At the moment the json.path functions are converting JSON objects to strings, then parsing the strings to GSONs representation which is quite bad performance wise. Then making the change to convert that back to the JSON representation we are using isn't straight forward. So moving to GSON is the easiest way to fix the problems.

Copy link
Member

@cwisniew cwisniew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Phergus)

@cwisniew cwisniew merged commit 741ee47 into RPTools:develop Nov 8, 2019
@Merudo
Copy link
Member

Merudo commented Nov 8, 2019

At the moment the json.path functions are converting JSON objects to strings, then parsing the strings to GSONs representation which is quite bad performance wise. Then making the change to convert that back to the JSON representation we are using isn't straight forward. So moving to GSON is the easiest way to fix the problems.

I was planning on converting GSON to strings, then parsing the strings to JSON objects. Easy enough considering we already have these parsing functions.

But, staying with GSON all the way through will improve the performance.

@JamzTheMan
Copy link
Member Author

I may be wrong but GSON has better class -> JSON serialization as well. So it may have less functionality in some places but more/better in others.

My "not totally researched but from memory" answer so take that as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding functionality that adds value macro changes This issue adds or changes macro functions. Extra work is required (testing, wiki, code editor) S Small impact. T-shirt style story pointing/scope
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants