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

Add invalidate path hook #144

Closed
wants to merge 0 commits into from
Closed

Conversation

dottodot
Copy link

@dottodot dottodot commented Apr 4, 2022

This adds a hook after successful on-demand revalidation. This is useful if you then need to clear a cache such as cloudfront.

@vercel
Copy link

vercel bot commented Apr 4, 2022

Someone is attempting to deploy a commit to the Chapter Three Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Apr 4, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/chapter-three/next-drupal/FcKTFkRhg2Xt6uvxDEJHS1J6zXvA
✅ Preview: Canceled

@shadcn
Copy link
Collaborator

shadcn commented Apr 4, 2022

I like this. I can definitely see this being useful.

However, since the revalidation API is still experimental in Next.js, I'd like to let this sit for a while and decide on how best to approach this.

Do we want hooks or events? Should we use a plugin system?

<?php

class ArticleRevalidation extends RevalidationBase {

    function preValidation();

    function postValidation();

}

What do you think?

@shadcn shadcn added enhancement New feature or request area: next module labels Apr 4, 2022
@theodorosploumis
Copy link

I think Events is better since we are on Drupal 9.x at the moment.

@dottodot
Copy link
Author

Could this be revisited now that revalidation API is stable?

@shadcn
Copy link
Collaborator

shadcn commented Jul 14, 2022

@dottodot Definitely. Thanks for the ping. I'll start looking into this.

@shadcn shadcn self-assigned this Jul 14, 2022
@dottodot
Copy link
Author

dottodot commented Nov 2, 2022

@shadcn Has there been any progress on this or decision on a route to take. Can always submit a new pr using the preferred approach if not.

@shadcn
Copy link
Collaborator

shadcn commented Nov 3, 2022

@dottodot Yes. I've implemented a plugin + event subscribers for handling revalidation. WIP here: #301

I'll push to a dev release and we can test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: next module enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants