You're in for a treat! 🍦
This release is jam-packed full of goodness, including the long-awaited command palette and bulk editor for params!
We're also going to dive a little deeper this changelog, covering foundational topics like the template engine that powers variables, as well as the plugin system.
Let's kick it off by talking about the new command palette. Almost every modern app has one, and it's for good reason. A command palette makes it easy to access more niche features as well as making other features more discoverable.
The pallet can be triggered from anywhere via CmdOrCtrl+k and currently supports easy switching between requests, environments, and workspaces; plus the ability to trigger common actions (more of these coming soon).
The goal of the command palette is to expose everything Yaak can do in a friendly and accessible way. From a technical standpoint, this the beginning of a codebase restructuring where every action in Yaak will start as a command, which is subsequently exposed to user interface components, hotkey handler, and even the upcoming plugin system!
Fixes Command Palette
For larger edits to query parameters or headers, you often wish that Yaak would just give you a damn text box! Well, now it does!
For most key/value interfaces, you can now switch to a bulk editor that presents you with
a text-editor interface. And, since Yaak uses the same <PairEditor/>
component for many
things, it's been enabled for the following inputs:
application/x-www-form-urlencoded
formsFixes Bulk edit headers and params
I know, I know, we all hate working with PDFs. But they're a necessary evil when when working on payment systems (generating invoices), amongst other things. Now, if a response returns a PDF, Yaak will render a rich preview right in the response pane! Not only that, but text will be selectable and links clickable.
This is all thanks to the amazing pdf.js
project which Yaak is interfacing with through
the react-pdf
library.
Sure, Yaak can now render PDFs, but there are plenty of content types that it has no idea about.
For these occasions, you can now save response bodies to your filesystem for use in other places. This action can be found in the response history menu for all HTTP responses and Yaak will even try to guess the correct file extension based on the returned mimetype.
Oh, and one other thing. Previously, when Yaak encountered a mimetype it couldn't preview, it would simply show... nothing. 🤨 Now, when this happens, you'll be presented with a prompt to save the response somewhere useful.
Fixes Download response to file
Yaak's grand vision is to put as much functionality as possible into plugins. While the plugin system isn't public yet, it is being used internally for things like data importers (Postman, Insomnia, Curl, etc).
Plugins are small JavaScript programs, and were previously executed using the Boa JavaScript engine---a native Rust project. This worked great in theory, but performance was a problem in practice. For example, importing Stripe's Postman collection (~800 requests) took upwards of 5 minutes! This was surprising because the all the importers do is JSON parsing, iteration, and object construction.
To get around this, Yaak now uses
deno_core
---a core component of
the Deno project---to execute plugins. deno_core
provides a thin
wrapper around the v8
APIs (the same engine backing Chrome and
NodeJS) making plugins super fast!
That same Stripe collection now imports in less than a second. Yes, a whopping 100x improvement! 🏎️
The new engine also exposed nicer stack traces as well as access to other Deno features like the ability to execute TypeScript directly.
A new plugin runtime isn't the only major change in this release that you won't notice. Yaak's template parser for rending environment variables was completely rewritten, from scratch! 🤓
You probably won't know this, but Yaak uses a custom syntax to power environment variables
which the UI hides behind pretty-colored decorations. But, under each of those tags is
something like ${[ MY_VAR ]}
.
But why write a new parser? Well, the previous one nothing more than a regular expression that replaced the variable syntax with the value for each variable. However, to support one of the most popular feature requests Request Chaining , We need to be able to invoke asynchronous functions, something like:
${[ responseValue("<ID>", "$.user.id") ]}
This function needs to do a number of things before it can render a value, such as pull responses from the Sqlite database, send requests, and extract a value using a JSONPath query. Sure, it's probably possible to do this with regular expressions, but it wouldn't be easy to understand and definitely wouldn't be fun to implement.
Along with request chaining, these functions will also be able to power other things like:
And, of course, you'll be able to provide your own functions in the future, via plugins.
+json
mimetypes not previewing