The REST API will need to be carefully planned, and should get its own namespace / folder structure under /src/Api/. The root Gravity PDF API endpoint should be gravity-pdf/v1. Before you write any code, I'd like to see a report / plan of all the current AJAX functionality in Gravity PDF / what it's used for, as well as the proposed REST API endpoints (url and method - GET/POST/PUT/DELETE) and folder structure.
When it comes time to upgrade the existing JS, you can get @debbieellis7 to assist.
Besides being less overhead per AJAX call, there's less overhead unit testing REST API requests than there is testing AJAX requests, which will speed up the time it takes our automated tests to run.
I recommend first familiarising yourself with the WordPress REST API as well as the WordPress AJAX API.
The REST API will need to be carefully planned, and should get its own namespace / folder structure under
/src/Api/
. The root Gravity PDF API endpoint should begravity-pdf/v1
. Before you write any code, I'd like to see a report / plan of all the current AJAX functionality in Gravity PDF / what it's used for, as well as the proposed REST API endpoints (url and method - GET/POST/PUT/DELETE) and folder structure.When it comes time to upgrade the existing JS, you can get @debbieellis7 to assist.
If you'd like further inspiration on how I've built our REST API components in the past, see the files in https://github.com/GravityPDF/gravity-pdf-previewer/tree/development/src/API