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

Refractor all AJAX calls to WP Rest API Calls #886

Open
jakejackson1 opened this issue Mar 3, 2019 · 1 comment · May be fixed by #931
Open

Refractor all AJAX calls to WP Rest API Calls #886

jakejackson1 opened this issue Mar 3, 2019 · 1 comment · May be fixed by #931
Assignees

Comments

@jakejackson1
Copy link
Member

jakejackson1 commented Mar 3, 2019

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 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.

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

@jakejackson1
Copy link
Member Author

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