chapter-three / next-drupal

Next.js for Drupal has everything you need to build a next-generation front-end for your Drupal site: SSG, SSR, and ISR, Multi-site, Authentication, Webforms, Search API, I18n and Preview mode (works with JSON:API and GraphQL).
https://next-drupal.org
MIT License
639 stars 178 forks source link

Add Support for App Router Invalidation by Tag in Drupal Module #812

Open backlineint opened 1 month ago

backlineint commented 1 month ago

Package

next (Drupal module)

Describe the feature request

This is a follow up to the discussion in https://github.com/chapter-three/next-drupal/issues/763 and https://github.com/chapter-three/next-drupal/pull/797

Similar to the module's path based revalidation, we should update the module to call our revalidation endpoint for the app router's revalidation by tag.

Describe the solution you'd like

Describe alternatives you've considered

A page router based approach was implemented here: https://github.com/chapter-three/next-drupal/pull/797

backlineint commented 6 days ago

@minnur we merged the updates to API routes that this will depend on. As outlined here, the tags param is comma separated. I tested that it will work if either encoded or not encoded. As you dig in, curious if you think comma separated makes the most sense here. Would be a pretty easier change if another delimiter makes more sense.