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

feat: move to jq #6539

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

feat: move to jq #6539

wants to merge 16 commits into from

Conversation

kobenguyent
Copy link
Contributor

@kobenguyent kobenguyent commented Sep 20, 2023

Motivation: jq, while being more powerful than JSONPath, nevertheless enables one to write queries that are usually as simple as, and sometimes even simpler than, the corresponding JSONPath queries.

resolves #777
resolves #3258
resolves #2342
resolves #3155

Screen.Recording.2023-09-21.at.09.20.48.mov

@bbbco
Copy link
Contributor

bbbco commented Sep 20, 2023

Considering jq uses a downloaded executable, you might want to consider something more integrated to Javascript like JSONata

@kobenguyent
Copy link
Contributor Author

Thanks. I'll check it out. 😄

@kobenguyent
Copy link
Contributor Author

I think we would still use node-jq instead of using another as jq is quite popular and its simplicity as well as performance.

For this PR, I guess we should have backwards compatibility with users are using JSONPath in their collections. As we drop the JSONPath, it would ruin the chain requests where the JSONPath is used to query.

@kobenguyent
Copy link
Contributor Author

Well, I think I'll try with this approach then. Copying the node-jq lib along with the binaries and minimizing the lib source code inside insomnia. That would somehow be a better way. Love to hear the feedbacks.

@gatzjames
Copy link
Contributor

@kobenguyent thanks for the pr 👍. Adding extra binaries makes the build process highly dependent on them (currently we use node-libcurl) and makes testing and deploying to different platforms more difficult. So we avoid adding them unless the benefits are worth it. It will be helpful if you explain the pros/cons of jq and what are your motivations/features this will support

@kobenguyent
Copy link
Contributor Author

thanks @gatzjames for looking into this. So yeah, maybe this explains better than myself
https://github.com/stedolan/jq/wiki/For-JSONPath-users

IMHO, jq resolves many issues as we are currently having with JSONPath also its simplicity and performance are two pros worth mentioning 😄

@smartrejames
Copy link

Ping, I'm really excited about this feature and can’t wait to see it in action!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants