phulin said:Instead of the existing org.json JSON library, this PR adds com.alibaba.fastjson2, which is the fastest JAVA JSON library per benchmarks. I plan to file a future PR to convert all other uses of org.json over to fastjson2.
fronobulax said:Some philosophy comments - they are not intended to be blocking unless some other dev thinks they should be.
This change seems intrusive. Is that because our JSON support is similarly intrusive or might there be a better way to implement this? My concept of a plan wonders whether a factory pattern might clean things somewhat. That might, of course require reimplementing the existing support and that might be to high a price to pay but I can ask the question.
Is there anything besides speed justifying fastjson2 replacing existing code? Could you share some benchmarks from KoLmafia?
Is there any other use case or benefit from this to a KoLmafia user who is not running scripts from the relay browser? Perhaps your answer is "No" at the moment but will be "Yes, faster JSON" when everything is replaced by fastjson2?
If I am looking at phase 1 of a 2 phase project would it be better or cleaner to just implement phase 2?
I don't think there's any verification needed to state that Alibaba is a Chinese-owned company headquartered in China, and the vast majority of their employees are also based in China.unverified allegations that a somewhat antagonistic, non-US entity was heavily involved in the development
Hi folks - didn't see this thread until now, apologies. For some reason, the pinging feature that is supposed to go to my email is not working. I will figure that out.
I expected both of you would have received an alert when I mentioned both of you directly in #3. https://kolmafia.us/account/preferences has an option for receiving notifications (via the bell icon in the top right) for mentions, but I don't see an obvious way to turn that into an email. I didn't want to believe that both of you were willfully ignoring the thread, but that was how it looked (from my perspective, and possibly that of several others) when the migration then completed the next day without any broader discussion about fronobulax's concerns.I also didn't receive an alert for this thread. I don't get alerts for "GitHub changes" more generally: perhaps I disabled them, or perhaps they're disabled for everyone.
It would be good to have a page on the wiki briefly describing the feature and perhaps providing a few simple usage examples, since we don't expect most users to interact deeply with the source code. There are some of these details in the initial PR description itself, but that requires even more steps to find once you've discovered the feature in the source code.I'm happy to provide any other documentation for this that folks need. There is some in the code, which I can augment if needed. It sounds like the team would like a page on the wiki and what else?
My understanding is that Veracity was initially frustrated with the lack of communication here, but the last straw was the introduction of a couple of bugs as a result of the migration (which only really modified existing tests). Yes, it'd be great if our test coverage were sufficient to catch issues with refactors like this, but we're nowhere near there yet.On the JSON library change: bean has done the majority of the performance PRs, and when I checked my own inventory (very large) it seemed faster, so I figured it was a good change. simd-json looks great, and I'm happy to make an announcement that we're eventually going to require Java 21 to start a timeline for getting ready to put it in.
I ask that we resolve to have a discussion before implementing "policies" in the development of the project, especially ones gatekeeping contribution. I'm not strictly against this one in particular but I am definitely not convinced. I certainly would not follow it for my own feature PRs, so as it stands would rule me out of future contribution to the project.My new policy:
For all new feature request PRs, if there is not a kolmafia.us thread explaining exactly what the desired feature is, how it will be implemented, and providing detailed documentation of the new API (RuntimeLibrary, textui/command/*, whatever), as well as complete tests, I will make a blocking review on the PR until such a thread is created and the expected documentation is provided.
I did not (or I did, but it cleared from my alerts before I noticed it was there). I do have the preference enabled for mentions; I don't know if it works at all. I do get alerts for when people like my posts or quote them (as you have done in this thread).I expected both of you would have received an alert when I mentioned both of you directly in #3
I feel like most of these questions are answered in the JavaDoc for handleJsonApi, which will soon (I expect) be duplicated on the wiki.I at least have some questions about the example provided
Personally I use "go to definition" from an IDE with the library installed, same as I do for most other libraries. javadoc.io is also fine. I can't find a proper site but then I can't find one for org.json either.I am still unsure where to find API documentation for fastjson2
Regarding user visible features, my own practice is:I ask that we resolve to have a discussion before implementing "policies" in the development of the project, especially ones gatekeeping contribution. I'm not strictly against this one in particular but I am definitely not convinced. I certainly would not follow it for my own feature PRs, so as it stands would rule me out of future contribution to the project.
I expect script authors are reading the commit history / release notes for new features (new item support, new quest support, new skills, new commands, new functions). I only post major or breaking changes in Announcements. I don't think this is a major change. I wouldn't have thought to post an announcement for it.script authors were supposed to just magically know about it?
I read the PR comments for this commit.I expect script authors are reading the commit history / release notes for new features.
This PR creates the endpoint that that library will use.
Requests to the endpoint take two parameters, body and pwd. pwd needs to match the password hash. body is a JSON object like the following:
to_json()
to turn objects into JSON representation.visit_url()
- and the responseText is returned as a buffer, as always. Presumably the relay script can use from_json()
to decode that result.I and a few others are working on a library that allows relay scripts to seamlessly call into KoLmafia functions, largely focused on the Guide replacement YORICK. This PR creates the endpoint that that library will use.