Closed noook closed 4 months ago
Tested and looks great to me <3
Thanks for working on this @noook looks amazing ❤️
I haven't gone through your changes but please consider to make sure this tab and feature is ONLY visible if nitro.tasks: true
option is set. As you you depending on an experimental API and the route/response can be changes.
I didn't find the proper way to conditionally show the page given the nitro config, could anyone give me hints to have it ? My best lead is to have some kind of setup like you do for setup**RPC. I could hook to nitro:init
and set a key in a storage to determine whether it's enabled or not
Thanks for working on it!
This PR introduces a new tab in the devtools to run Nitro tasks.
It heavily relies on the same mechanism as the server routes as Nitro provides endpoints to run the tasks, so running a task in the devtools equals to doing an HTTP request.
Except that some features of an HTTP request are not available.
json
and payload is initialized with{ "payload": {} }
as only this key is ready by Nitro.Content-Type: application/json
set as default.GET
if no key is present under"payload"
,POST
otherwise (should we default toPOST
or not show it at all ?)Preview:![image](https://github.com/nuxt/devtools/assets/19751938/d0e7fc72-1c67-4ce8-b377-fd3d9c202e72)