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

Port Ajaxifier to modern JavaScript #1337

Merged
merged 3 commits into from
Sep 16, 2022
Merged

Conversation

marschall
Copy link
Contributor

  • Remove dependency on jQuery
  • Remove dedicated code in render phase continuation

@marschall
Copy link
Contributor Author

This PR ports the Ajaxifier to modern JS, this allows us to get rid of the jQuery dependency and the special code in WARenderPhaseContinuation

In more detail:

  • Replace the special X-RedirectedTo header added by WARenderPhaseContinuation with XMLHttpRequest.responseURL.
  • Replace the regex response processing with responseType = "document" and HTMLDocument API.
  • Replace the jQuery ready function window.addEventListener("DOMContentLoaded"
  • Replace other jQuery functions with addEventListener, closest, getAttribute
  • Use FormData API to generate the request body
  • Replace functions with arrow functions.
  • Replace var with let or const where possible
  • Assume window.history.pushState is present.
  • Documentation has been moved to https://github.com/SeasideSt/Seaside/wiki/Ajaxification

I don't actually know what I'm doing, I just copied and pasted stuff from MDN and it seems to work 🤷‍♂️

@marschall marschall force-pushed the ajaxifier branch 2 times, most recently from 1528b08 to d9f6d82 Compare August 25, 2022 14:07
@jbrichau
Copy link
Member

When trying the ajaxified functional tests, I notice that the development toolbar is not properly handled. See screenshot.
This did not occur with the previous version of the ajaxifier, but I have not started investigating why that is.
Screenshot 2022-09-10 at 10 16 22

- Remove dependency on jQuery
- Remove dedicated code in render phase continuation
@marschall
Copy link
Contributor Author

When trying the ajaxified functional tests, I notice that the development toolbar is not properly handled.

Found it. The <head> content was not set properly.

@jbrichau jbrichau merged commit 8e1003c into SeasideSt:master Sep 16, 2022
@jbrichau
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants