[{"data":1,"prerenderedAt":577},["ShallowReactive",2],{"article-\u002Fwriting\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124":3,"read-next-\u002Fwriting\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124":147},{"id":4,"title":5,"articleType":6,"categories":7,"date":11,"description":12,"extension":13,"feedImage":14,"hiddenCategories":15,"meta":17,"paragraphs":18,"path":131,"readingTime":132,"related":133,"sitemap":142,"stem":143,"topics":144,"__hash__":146},"articleEntries\u002Farticles-data\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124.json","Druxt 0.25.2; Drupal Canvas sites, no Drupal required","Blog post",[8,9,10],"Drupal","Druxt","Nuxt","2026-11-24T17:00:00+11:00","Druxt 0.25.2 renders Drupal Canvas pages in Fully Decoupled Nuxt sites, keeps signed-in requests out of the server cache, and makes v-model follow forms and filters. Run the demo in your browser, with no Drupal to install.","json",true,[16],"Planet Drupal",{},[19,34,57,65,79,92,104,119],{"type":20,"layout":21,"regions":22},"section","layout_onecol",{"content":23},[24,27,29],{"type":25,"html":26},"text_formatted","\u003Cp>Druxt 0.25.2 renders Drupal Canvas pages in Nuxt, and you can try it in this post without installing anything. Press Run and a Nuxt 2 site boots in your browser. It reads a recording of a Drupal CMS site's API, so no Drupal is running behind it.\u003C\u002Fp>",{"type":25,"html":28},"\u003Cp>Druxt is the Fully Decoupled Drupal framework for Nuxt 2. Canvas is the page builder in Drupal CMS, and sites that have it installed now build. This release also keeps signed-in requests out of the server cache from the first request, makes \u003Ccode>v-model\u003C\u002Fcode> follow forms and filters, and reports why a resource failed to load. Upgrading takes one command and two checks.\u003C\u002Fp>",{"type":30,"title":31,"url":32,"caption":33},"stackblitz","Drupal CMS's Dashi site, rendered by Druxt 0.25.2 and Nuxt 2","https:\u002F\u002Fstackblitz.com\u002Fgithub\u002FDecipher\u002Fdemo-druxt-canvas?file=nuxt.config.js","\u003Cp>A Nuxt 2 site on \u003Ccode>druxt-site\u003C\u002Fcode> 0.15.2 and \u003Ccode>@druxt-contrib\u002Fcanvas\u003C\u002Fcode>, reading the Dashi preset of Decoupled Drupal Mock. \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdemo-druxt-canvas\">The source is on GitHub\u003C\u002Fa>.\u003C\u002Fp>",{"type":20,"layout":21,"regions":35,"title":56},{"content":36},[37,39,45,52,54],{"type":25,"html":38},"\u003Cp>I wanted a demo you could run without setting up Drupal. It runs two things side by side. The first is \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdecoupled-drupal-mock\">Decoupled Drupal Mock\u003C\u002Fa> with its \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdecoupled-drupal-mock\u002Ftree\u002F1.0.x\u002Fpresets\u002Fdashi\">Dashi preset\u003C\u002Fa>, which replays the JSON:API, Decoupled Router and menu responses recorded from a Drupal CMS 2.2.9 site running Canvas 1.12.0. The second is Nuxt, with this configuration:\u003C\u002Fp>",{"type":40,"title":41,"language":42,"code":43,"highlighted":44},"code","nuxt.config.js","javascript","export default {\n  modules: ['druxt-site', '@druxt-contrib\u002Fcanvas'],\n  druxt: {\n    baseUrl: 'http:\u002F\u002Flocalhost:3005',\n    proxy: { api: true },\n  },\n}","\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">modules\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'druxt-site'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'@druxt-contrib\u002Fcanvas'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">druxt\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">baseUrl\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'http:\u002F\u002Flocalhost:3005'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">proxy\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">api\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":46,"src":47,"alt":48,"caption":49,"width":50,"height":51},"media","\u002Fimages\u002Fwriting\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124\u002Fdemo-dashi-front.jpg","The demo's front page in Dashi's theme: the dashi Food Magazine logo, a search box, and Home, Articles and Recipes links. Below them a featured recipe, \"Super easy vegetarian pasta bake\", with its photo and a View recipe button, then cards for an article and two recipes with photos.","Dashi's front page, a Canvas page, rendered by the demo from the recording.",1280,934,{"type":25,"html":53},"\u003Cp>The front page and \u003Ccode>\u002Fcanvas-external\u003C\u002Fcode> are Canvas pages. Druxt resolves them by path, with no Nuxt page files. Follow a link from the front page to a recipe or article, and Vue components read that node's fields to lay it out the way Dashi does.\u003C\u002Fp>",{"type":25,"html":55},"\u003Cp>To serve the same pages from your own Drupal, point \u003Ccode>baseUrl\u003C\u002Fcode> at it. \u003Ccode>@druxt-contrib\u002Fcanvas\u003C\u002Fcode> renders each Canvas component through a Vue wrapper that you write, and the \u003Ca href=\"https:\u002F\u002Fcontrib.druxtjs.org\u002Fdruxt-canvas\u002Ftheming\u002F\">Druxt Canvas docs\u003C\u002Fa> explain how to name them.\u003C\u002Fp>","What's in the demo",{"type":20,"layout":21,"regions":58,"title":64},{"content":59},[60,62],{"type":25,"html":61},"\u003Cp>druxt-schema 0.12.2 builds sites that have Canvas installed (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1022\">#1022\u003C\u002Fa>). Druxt reads every entity view and form display at build time, and Canvas 1.12.0 answers 500 when JSON:API asks for the second page of them. Druxt now requests them in smaller batches, filtered by entity type and bundle. Canvas 1.13.0 still has the bug, and it's \u003Ca href=\"https:\u002F\u002Fgit.drupalcode.org\u002Fproject\u002Fcanvas\u002F-\u002Fwork_items\u002F3592360\">reported against Canvas\u003C\u002Fa>.\u003C\u002Fp>",{"type":25,"html":63},"\u003Cp>If you patched Canvas to get your build through, you can keep the patch or remove it. Keep it if one bundle has more than 50 view or form displays, because the build still fails without it. The demo's recording returns every page, so you'll only see this fix on a live site.\u003C\u002Fp>","Building against Canvas",{"type":20,"layout":21,"regions":66,"title":78},{"content":67},[68,70,72,76],{"type":25,"html":69},"\u003Cp>0.25.0 added a server cache for the JSON:API index and menus. It skips any request that carries credentials, but it only saw a token added by an Axios interceptor once the response came back. Until then, a signed-in visitor could get a response cached for anonymous visitors. 0.25.2 runs your request interceptors on a copy of each request before it checks the cache, so the cache turns off from the first request (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1018\">#1018\u003C\u002Fa>).\u003C\u002Fp>",{"type":25,"html":71},"\u003Cp>Register a plugin like this one under \u003Ccode>plugins\u003C\u002Fcode> in \u003Ccode>nuxt.config.js\u003C\u002Fcode>, reading the token from wherever your site stores it:\u003C\u002Fp>",{"type":40,"title":73,"language":42,"code":74,"highlighted":75},"plugins\u002Fdruxt-token.js","export default ({ $druxt, store }) => {\n  $druxt.axios.interceptors.request.use((config) => {\n    if (store.state.token) {\n      config.headers.Authorization = `Bearer ${store.state.token}`\n    }\n    return config\n  })\n}","\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> $druxt\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> store \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  $druxt\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>axios\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>interceptors\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>request\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">use\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>store\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>state\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>token\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      config\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>headers\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>Authorization \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Bearer \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>store\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>state\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>token\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n    \u003Cspan class=\"token keyword\">return\u003C\u002Fspan> config\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":25,"html":77},"\u003Cp>If an interceptor has side effects, such as logging, it can skip that dry run by checking \u003Ccode>config[Symbol.for('druxt.processCache.probe')]\u003C\u002Fcode>. If an interceptor is an \u003Ccode>async\u003C\u002Fcode> function, the cache skips it and only sees its token when the first response arrives, so set that token on the Axios defaults instead. \u003Ccode>@nuxtjs\u002Fauth-next\u003C\u002Fcode> already does this unless \u003Ccode>token.global\u003C\u002Fcode> is off. Menus work the same way, including when an interceptor adds credentials only to menu requests.\u003C\u002Fp>","Signed-in requests skip the cache",{"type":20,"layout":21,"regions":80,"title":91},{"content":81},[82,84,89],{"type":25,"html":83},"\u003Cp>\u003Ccode>v-model\u003C\u002Fcode> on the \u003Ccode>Druxt\u003C\u002Fcode> component now updates when the module changes its value (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1005\">#1005\u003C\u002Fa>), so an entity form reports each edit to its parent:\u003C\u002Fp>",{"type":40,"title":85,"language":86,"code":87,"highlighted":88},"pages\u002Fedit\u002F_uuid.vue","vue","\u003Ctemplate>\n  \u003Cdiv>\n    \u003CDruxt\n      v-model=\"entity\"\n      module=\"entity-form\"\n      :props-data=\"{ type: 'node--page', uuid }\"\n    \u002F>\n    \u003Cpre>{{ entity }}\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n\n\u003Cscript>\nexport default {\n  asyncData: ({ params }) => ({ uuid: params.uuid }),\n  data: () => ({ entity: undefined }),\n}\n\u003C\u002Fscript>","\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>template\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n  \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>div\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>Druxt\u003C\u002Fspan>\n      \u003Cspan class=\"token attr-name\">v-model\u003C\u002Fspan>\u003Cspan class=\"token attr-value\">\u003Cspan class=\"token punctuation attr-equals\">=\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>entity\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n      \u003Cspan class=\"token attr-name\">module\u003C\u002Fspan>\u003Cspan class=\"token attr-value\">\u003Cspan class=\"token punctuation attr-equals\">=\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>entity-form\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n      \u003Cspan class=\"token attr-name\">:props-data\u003C\u002Fspan>\u003Cspan class=\"token attr-value\">\u003Cspan class=\"token punctuation attr-equals\">=\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>{ type: 'node--page', uuid }\u003Cspan class=\"token punctuation\">\"\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">\u002F>\u003C\u002Fspan>\u003C\u002Fspan>\n    \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>pre\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>{{ entity }}\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>pre\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n  \u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>div\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>template\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\n\n\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u003C\u002Fspan>script\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token script\">\u003Cspan class=\"token language-javascript\">\n\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token function-variable function\">asyncData\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> params \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">uuid\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> params\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>uuid \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token function-variable function\">data\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">entity\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token keyword\">undefined\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token tag\">\u003Cspan class=\"token tag\">\u003Cspan class=\"token punctuation\">&lt;\u002F\u003C\u002Fspan>script\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">>\u003C\u002Fspan>\u003C\u002Fspan>",{"type":25,"html":90},"\u003Cp>A value you set while the entity is loading is now kept when the entity arrives (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1036\">#1036\u003C\u002Fa>). A field rendered in another component's slot reads its own entity's data (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1020\">#1020\u003C\u002Fa>). \u003Ccode>v-model\u003C\u002Fcode> now works on every module alongside druxt-entity, so exposed Views filters apply (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1037\">#1037\u003C\u002Fa>). Changing a filter on page three of a view returns you to page one, as Drupal does (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1032\">#1032\u003C\u002Fa>).\u003C\u002Fp>","v-model that follows the form",{"type":20,"layout":21,"regions":93,"title":103},{"content":94},[95,97,101],{"type":25,"html":96},"\u003Cp>A failed \u003Ccode>druxt\u002FgetResource\u003C\u002Fcode> request now includes its status code, so you can send a 401 to the login page and treat a 404 as missing (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1013\">#1013\u003C\u002Fa>). A request that never reaches Drupal reports 500.\u003C\u002Fp>",{"type":40,"title":98,"language":42,"code":99,"highlighted":100},"Send a 401 to the login page","async asyncData({ store, params, redirect }) {\n  const resource = await store.dispatch('druxt\u002FgetResource', {\n    type: 'node--page',\n    id: params.id,\n  })\n  if (resource.error?.statusCode === 401) {\n    return redirect('\u002Fuser\u002Flogin')\n  }\n  return { resource }\n},","\u003Cspan class=\"token keyword\">async\u003C\u002Fspan> \u003Cspan class=\"token function\">asyncData\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token parameter\">\u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> store\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> params\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> redirect \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">const\u003C\u002Fspan> resource \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">await\u003C\u002Fspan> store\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">dispatch\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token string\">'druxt\u002FgetResource'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">type\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'node--page'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">id\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> params\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>id\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>resource\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>error\u003Cspan class=\"token operator\">?.\u003C\u002Fspan>statusCode \u003Cspan class=\"token operator\">===\u003C\u002Fspan> \u003Cspan class=\"token number\">401\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token keyword\">return\u003C\u002Fspan> \u003Cspan class=\"token function\">redirect\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token string\">'\u002Fuser\u002Flogin'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">return\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> resource \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>",{"type":25,"html":102},"\u003Cp>JSON:API links now reach the browser as paths, even when Drupal builds them with a different scheme or host, such as \u003Ccode>https:\u002F\u002F\u003C\u002Fcode> behind a proxy. Client-side navigation stays on your frontend (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F833\">#833\u003C\u002Fa>). \u003Ccode>DruxtSiteMixin\u003C\u002Fcode> also imports in client-side code without pulling Node's \u003Ccode>fs\u003C\u002Fcode> into the bundle (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F545\">#545\u003C\u002Fa>). Thanks to \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSebastix\">Sebastix\u003C\u002Fa> for reporting that one.\u003C\u002Fp>","When a resource fails",{"type":20,"layout":21,"regions":105,"title":118},{"content":106},[107,109,114,116],{"type":25,"html":108},"\u003Cp>Upgrading druxt-site brings the other six packages with it. Druxt now requires axios 0.35.0 or later, so that the bundle holds one copy (\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fissues\u002F1029\">#1029\u003C\u002Fa>). Install both in one command:\u003C\u002Fp>",{"type":40,"title":110,"language":111,"code":112,"highlighted":113},"Upgrade through druxt-site","bash","npm i druxt-site@0.15.2 axios@0.35.0","\u003Cspan class=\"token function\">npm\u003C\u002Fspan> i druxt-site@0.15.2 axios@0.35.0",{"type":25,"html":115},"\u003Cp>If your \u003Ccode>package.json\u003C\u002Fcode> lists any other Druxt package directly, such as druxt-schema, add it to the command too. Otherwise the older copy stays at the top of \u003Ccode>node_modules\u003C\u002Fcode>, \u003Ccode>nuxt build\u003C\u002Fcode> loads it, and an old druxt-schema still fails on Canvas.\u003C\u002Fp>",{"type":25,"html":117},"\u003Cp>Empty strings behave differently too. The \u003Ccode>value\u003C\u002Fcode> of a module, field or exposed filter now stays \u003Ccode>''\u003C\u002Fcode> instead of Vue reading it as \u003Ccode>true\u003C\u002Fcode>, and a custom field that emits \u003Ccode>''\u003C\u002Fcode> passes it to its parent. If your code checks for \u003Ccode>undefined\u003C\u002Fcode> to detect a cleared field, check for \u003Ccode>''\u003C\u002Fcode> as well.\u003C\u002Fp>","Upgrading",{"type":20,"layout":21,"regions":120},{"content":121},[122,124,126],{"type":25,"html":123},"\u003Cp>Nuxt 2 is end of life. 0.x is for sites already running on it, and I want those sites solid before 1.0.0. New sites should start on Druxt 2. Next is 0.26.0, the multilingual release, due 8 December. It's the last 0.x before the 1.0.0 release candidate. 1.0.0 is due 2 February and Druxt 2 is due 20 April, both on the \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js\u002Fmilestones\">milestones page\u003C\u002Fa>.\u003C\u002Fp>",{"type":25,"html":125},"\u003Cp>Which Canvas components does your site use, and which would you want rendered first?\u003C\u002Fp>",{"type":127,"description":128,"url":129,"gitpod":130},"repository","\u003Cp>Druxt is open source on GitHub. The demo's source is in \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDecipher\u002Fdemo-druxt-canvas\">Decipher\u002Fdemo-druxt-canvas\u003C\u002Fa>, ready to fork and point at your own Drupal site. Sponsorship keeps the 0.x line getting fixes like these while I build Druxt 2.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt.js",false,"\u002Fwriting\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124","4 min",[134,137,139],{"path":135,"source":136},"\u002Fwriting\u002Fdruxt-0250-caching-and-performance-buffs-20261023","picked",{"path":138,"source":136},"\u002Fwriting\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112",{"path":140,"source":141},"\u002Fwriting\u002Fdruxt-drupal-13x-resource-list-yours-20260909","view",{"loc":131},"articles-data\u002Fdruxt-0252-drupal-canvas-sites-no-drupal-required-20261124",[145],"Drupal Canvas","ayngo7_GtYWX3ySenYLBTVxNkifBt0Fq5utgJVEdi6g",[148,296,462],{"id":149,"title":150,"articleType":6,"categories":151,"date":152,"description":153,"extension":13,"feedImage":14,"hiddenCategories":154,"meta":155,"paragraphs":156,"path":138,"readingTime":132,"related":283,"sitemap":289,"stem":290,"topics":291,"__hash__":295},"articleEntries\u002Farticles-data\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112.json","Consumer Node Preview 1.0.0-rc1; preview for Fully Decoupled Drupal sites",[8,9],"2026-11-12T20:00:00+11:00","Consumer Node Preview shows unsaved Drupal edits in your Fully Decoupled frontend, the way readers will see them. Druxt Node Preview 0.1.0 is the Nuxt side.",[16],{},[157,172,193,199,210,224,234,247,257,266,276],{"type":20,"layout":21,"regions":158},{"content":159},[160,162,168,170],{"type":25,"html":161},"\u003Cp>Press Preview on a Fully Decoupled Drupal site, and Consumer Node Preview \u003Ccode>1.0.0-rc1\u003C\u002Fcode> shows the unsaved page in the frontend your readers will see: the title you just changed and the text you just rewrote, rendered by the site that will publish them.\u003C\u002Fp>",{"type":46,"alt":163,"caption":164,"width":165,"height":166,"src":167},"Drupal's preview screen with Frontend, Drupal and JSON:API tabs. The Frontend tab frames the druxtjs.org page Getting started with Druxt inside the site's own header and breadcrumb. A Show changes against the live page toggle is on and reports 2 changes: the title gains the words from zero, and in the first paragraph piece of content is struck through and replaced with page.","\u003Cp>Two unsaved edits, to the title and the first paragraph, rendered by the Druxt site readers see.\u003C\u002Fp>",968,760,"\u002Fimages\u002Fwriting\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112\u002Fpreview-diff.png",{"type":25,"html":169},"\u003Cp>Drupal's own Preview renders the node in Drupal's theme, not your frontend, so editors save a draft to check it. Next.js draft mode smooths that workaround, but still needs a saved revision. Consumer Node Preview works on what's still in the edit form, for the person writing it, before anything is saved.\u003C\u002Fp>",{"type":25,"html":171},"\u003Cp>Anything that reads JSON:API can be on the other end. Druxt Node Preview \u003Ccode>0.1.0\u003C\u002Fcode> is the Nuxt one, already running druxtjs.org's previews.\u003C\u002Fp>",{"type":20,"layout":21,"regions":173,"title":192},{"content":174},[175,177,181,183,185,190],{"type":25,"html":176},"\u003Cp>Consumer Node Preview builds on JSON:API Node Preview, which serves the unsaved node over JSON:API.\u003C\u002Fp>",{"type":40,"title":178,"language":111,"code":179,"highlighted":180},"Install both","composer require drupal\u002Fjsonapi_node_preview:^1.0@beta drupal\u002Fconsumer_node_preview:^1.0@RC\ndrush en consumer_node_preview","\u003Cspan class=\"token function\">composer\u003C\u002Fspan> require drupal\u002Fjsonapi_node_preview:^1.0@beta drupal\u002Fconsumer_node_preview:^1.0@RC\ndrush en consumer_node_preview",{"type":25,"html":182},"\u003Cp>It stays a release candidate while JSON:API Node Preview is in beta.\u003C\u002Fp>",{"type":25,"html":184},"\u003Cp>Each app that reads your API is a consumer, and each gets its own preview targets, so a Next site and an Astro build can preview the same draft. A target is a label and a URL template. Add it on the consumer's form under \u003Cem>Configuration &gt; Web services &gt; Consumers\u003C\u002Fem>, or in \u003Ccode>settings.php\u003C\u002Fcode> when the URL changes per environment:\u003C\u002Fp>",{"type":40,"title":186,"language":187,"code":188,"highlighted":189},"settings.php","php","$settings['consumer_node_preview'] = [\n  'targets' => [\n    'frontend' => [\n      'label' => 'Frontend',\n      'url' => 'https:\u002F\u002Fwww.example.com\u002Fdruxt\u002Fnode\u002Fpreview?vm=[view_mode]&layout=[layout]#[jsonapi_node_preview]',\n      'layouts' => ['default', 'preview'],\n    ],\n  ],\n];","\u003Cspan class=\"token variable\">$settings\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'consumer_node_preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n  \u003Cspan class=\"token string single-quoted-string\">'targets'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n    \u003Cspan class=\"token string single-quoted-string\">'frontend'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\n      \u003Cspan class=\"token string single-quoted-string\">'label'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'Frontend'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token string single-quoted-string\">'url'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'https:\u002F\u002Fwww.example.com\u002Fdruxt\u002Fnode\u002Fpreview?vm=[view_mode]&amp;layout=[layout]#[jsonapi_node_preview]'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token string single-quoted-string\">'layouts'\u003C\u002Fspan> \u003Cspan class=\"token operator\">=>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'default'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string single-quoted-string\">'preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>",{"type":25,"html":191},"\u003Cp>Press Preview, and the module fills in the template's tokens and frames the page on the \u003Cem>Frontend\u003C\u002Fem> tab, so the page has to allow that: no \u003Ccode>X-Frame-Options\u003C\u002Fcode>, and Drupal's origin in any \u003Ccode>frame-ancestors\u003C\u002Fcode> rule. Beside it, \u003Cem>Drupal\u003C\u002Fem> is core's own preview, for anything Drupal renders itself, and \u003Cem>JSON:API\u003C\u002Fem> is the raw document: the tab I open first when a field doesn't turn up.\u003C\u002Fp>","Pointing Drupal at your frontend",{"type":20,"layout":21,"regions":194,"title":198},{"content":195},[196],{"type":25,"html":197},"\u003Cp>A preview URL includes the address of an unsaved draft. In a path or query string, it would end up in the frontend's access logs, any CDN in front of it, and the \u003Ccode>Referer\u003C\u002Fcode> of everything the page loads. So \u003Ccode>[jsonapi_node_preview]\u003C\u002Fcode> goes after the \u003Ccode>#\u003C\u002Fcode>: browsers never send the fragment to a server. Scripts on the page can still read it, so keep analytics, error tracking and session replay off the preview route.\u003C\u002Fp>","Keeping the draft out of the logs",{"type":20,"layout":21,"regions":200,"title":209},{"content":201},[202,204],{"type":25,"html":203},"\u003Cp>If Drupal and your frontend share a domain, like \u003Ccode>cms.example.com\u003C\u002Fcode> and \u003Ccode>www.example.com\u003C\u002Fcode>, the preview page can read with the editor's session cookie, once Drupal's CORS config names the frontend and allows credentials:\u003C\u002Fp>",{"type":40,"title":205,"language":206,"code":207,"highlighted":208},"services.yml, same site","yaml","parameters:\n  cors.config:\n    enabled: true\n    allowedHeaders: ['*']\n    allowedMethods: ['GET']\n    allowedOrigins: ['https:\u002F\u002Fwww.example.com']\n    supportsCredentials: true","\u003Cspan class=\"token key atrule\">parameters\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan>\n  \u003Cspan class=\"token key atrule\">cors.config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">enabled\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean important\">true\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">allowedHeaders\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'*'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">allowedMethods\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'GET'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">allowedOrigins\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'https:\u002F\u002Fwww.example.com'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n    \u003Cspan class=\"token key atrule\">supportsCredentials\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean important\">true\u003C\u002Fspan>","Sharing a domain: the editor's session",{"type":20,"layout":21,"regions":211,"title":223},{"content":212},[213,215,221],{"type":25,"html":214},"\u003Cp>Browsers won't send that cookie to a frontend on another domain, such as \u003Ccode>example.vercel.app\u003C\u002Fcode>, so the preview reads with a token instead. Install Simple OAuth, then on the consumer's form turn on the Authorization Code grant, and give its \u003Cem>Authorization Code settings\u003C\u002Fem> a scope for a role made for previews, rather than your editors' own. A scope under \u003Cem>Default scopes\u003C\u002Fem> alone gets the preview a 403.\u003C\u002Fp>",{"type":46,"alt":216,"caption":217,"width":218,"height":219,"src":220},"The consumer form's Grant types, with Authorization Code and Client Credentials ticked, and the Authorization Code settings, with the editor scope ticked.","\u003Cp>The consumer's Authorization Code grant, with a scope for the editor role. The preview token needs both.\u003C\u002Fp>",918,474,"\u002Fimages\u002Fwriting\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112\u002Fconsumer-token-grant.png",{"type":25,"html":222},"\u003Cp>End the target with \u003Ccode>;token=[preview_token]\u003C\u002Fcode>, and in \u003Ccode>settings.php\u003C\u002Fcode> name its consumer with \u003Ccode>'consumer' =&gt; 'my-frontend'\u003C\u002Fcode>. Each Preview then adds a token to the fragment. It acts as the editor, limited to that role, for 15 minutes by default. It travels without a cookie, so CORS can allow any origin: without credentials, another site reads only what an anonymous visitor could. In \u003Ccode>services.yml\u003C\u002Fcode>, set \u003Ccode>allowedOrigins\u003C\u002Fcode> to \u003Ccode>['*']\u003C\u002Fcode> and \u003Ccode>supportsCredentials\u003C\u002Fcode> to \u003Ccode>false\u003C\u002Fcode>.\u003C\u002Fp>","On another domain: a preview token",{"type":20,"layout":225,"regions":226,"title":233},"layout_twocol",{"first":227,"second":230},[228],{"type":25,"html":229},"\u003Cp>\u003Cstrong>View modes, for Nuxt developers.\u003C\u002Fstrong> Drupal's displays of the same content, such as Full or Teaser, each with its own fields. The editor's pick arrives as \u003Ccode>vm\u003C\u002Fcode>, and Druxt renders the node in that mode.\u003C\u002Fp>",[231],{"type":25,"html":232},"\u003Cp>\u003Cstrong>Layouts, for Drupal developers.\u003C\u002Fstrong> Nuxt's page wrappers, the components in \u003Ccode>layouts\u002F\u003C\u002Fcode> that put the site around a page. The editor's pick arrives as \u003Ccode>layout\u003C\u002Fcode>, so one node can be checked inside the full site or on a bare page.\u003C\u002Fp>","View modes and layouts",{"type":20,"layout":21,"regions":235,"title":246},{"content":236},[237,239,242,244],{"type":25,"html":238},"\u003Cp>On a Druxt site, the preview page is a Nuxt module that can register its own target:\u003C\u002Fp>",{"type":40,"title":41,"language":42,"code":240,"highlighted":241},"\u002F\u002F npm install druxt-site @druxt-contrib\u002Fnode-preview\nexport default {\n  modules: ['@druxt-contrib\u002Fnode-preview', 'druxt-site'],\n  druxt: {\n    baseUrl: 'https:\u002F\u002Fcms.example.com',\n    proxy: { api: true },\n    nodePreview: {\n      layouts: ['default', 'preview'],\n      register: {\n        url: 'https:\u002F\u002Fexample.vercel.app',\n        consumer: 'my-frontend', \u002F\u002F The consumer's client ID.\n        token: true,\n      },\n    },\n  },\n}","\u003Cspan class=\"token comment\">\u002F\u002F npm install druxt-site @druxt-contrib\u002Fnode-preview\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">modules\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'@druxt-contrib\u002Fnode-preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'druxt-site'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">druxt\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">baseUrl\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'https:\u002F\u002Fcms.example.com'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">proxy\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">api\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">nodePreview\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n      \u003Cspan class=\"token literal-property property\">layouts\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'default'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'preview'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token literal-property property\">register\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n        \u003Cspan class=\"token literal-property property\">url\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'https:\u002F\u002Fexample.vercel.app'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n        \u003Cspan class=\"token literal-property property\">consumer\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'my-frontend'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token comment\">\u002F\u002F The consumer's client ID.\u003C\u002Fspan>\n        \u003Cspan class=\"token literal-property property\">token\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n      \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":25,"html":243},"\u003Cp>With the secret of a consumer \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdruxt-contrib\u002Fdruxt-node-preview\u002Fblob\u002F0.x\u002Fdocs\u002Fregistration-drupal-setup.md\">set up for Simple OAuth\u003C\u002Fa> in \u003Ccode>DRUXT_NODE_PREVIEW_CLIENT_SECRET\u003C\u002Fcode>, Nuxt adds its target to Drupal when it starts and every six hours, and removes it on a clean shutdown. A target that stops registering goes inactive after a day, so a crashed server cleans up after itself. With \u003Ccode>token\u003C\u002Fcode> on and Druxt's API proxy, the read never leaves the frontend's origin, and Drupal's CORS stays as it is.\u003C\u002Fp>",{"type":25,"html":245},"\u003Cp>The preview goes in the Druxt store before \u003Ccode>DruxtEntity\u003C\u002Fcode> resolves, so it renders through the same components as the live page, and the token comes off the address on load. It only fetches from its own origin, its Drupal site, or origins you list, so a crafted link can't point the preview, or the editor's token, at somebody else's server.\u003C\u002Fp>","Druxt renders it like any other page",{"type":20,"layout":21,"regions":248,"title":256},{"content":249},[250,252],{"type":25,"html":251},"\u003Cp>Nothing in the URL template is Druxt-specific. Druxt Node Preview is for Nuxt 2 and Node 16, and stays \u003Ccode>0.x\u003C\u002Fcode> until Druxt reaches \u003Ccode>1.0.0\u003C\u002Fcode>. In Nuxt 3, Next or Astro, this is the core of a preview page:\u003C\u002Fp>",{"type":40,"title":253,"language":42,"code":254,"highlighted":255},"A preview page for any other frontend","\u002F\u002F Target URL: https:\u002F\u002Fwww.example.com\u002Fpreview#[jsonapi_node_preview];token=[preview_token]\n\u002F\u002F Runs in the browser, in a module script: the fragment never reaches a server.\n\u002F\u002F The origins this page may fetch a preview from.\nconst allowed = ['https:\u002F\u002Fcms.example.com']\n\n\u002F\u002F Some routers turn https:\u002F\u002F into https:\u002F inside a hash.\nconst hash = decodeURIComponent(location.hash.slice(1))\nconst [address, token] = hash\n  .replace(\u002F^(https?):\\\u002F(?!\\\u002F)\u002F, '$1:\u002F\u002F')\n  .split(';token=')\nconst endpoint = new URL(address)\n\u002F\u002F Take the token back out of the address bar.\nhistory.replaceState(null, '', location.pathname + location.search)\n\nif (!allowed.includes(endpoint.origin)) {\n  throw new Error(`Refusing a preview from ${endpoint.origin}`)\n}\n\nconst response = await fetch(endpoint, {\n  \u002F\u002F A token target reads without the cookie.\n  credentials: token ? 'omit' : 'include',\n  headers: {\n    Accept: 'application\u002Fvnd.api+json',\n    ...(token && { Authorization: `Bearer ${token}` }),\n  },\n})\nif (!response.ok) throw new Error(`Preview failed: HTTP ${response.status}`)\nconst { data, included } = await response.json()\n\u002F\u002F Render data and included with the components a live page uses.","\u003Cspan class=\"token comment\">\u002F\u002F Target URL: https:\u002F\u002Fwww.example.com\u002Fpreview#[jsonapi_node_preview];token=[preview_token]\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F Runs in the browser, in a module script: the fragment never reaches a server.\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F The origins this page may fetch a preview from.\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> allowed \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'https:\u002F\u002Fcms.example.com'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n\n\u003Cspan class=\"token comment\">\u002F\u002F Some routers turn https:\u002F\u002F into https:\u002F inside a hash.\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> hash \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token function\">decodeURIComponent\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>location\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>hash\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">slice\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token number\">1\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>address\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> token\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> hash\n  \u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">replace\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token regex\">\u003Cspan class=\"token regex-delimiter\">\u002F\u003C\u002Fspan>\u003Cspan class=\"token regex-source language-regex\">^(https?):\\\u002F(?!\\\u002F)\u003C\u002Fspan>\u003Cspan class=\"token regex-delimiter\">\u002F\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">'$1:\u002F\u002F'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">split\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token string\">';token='\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> endpoint \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">new\u003C\u002Fspan> \u003Cspan class=\"token class-name\">URL\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>address\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F Take the token back out of the address bar.\u003C\u002Fspan>\nhistory\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">replaceState\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token keyword\">null\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token string\">''\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> location\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>pathname \u003Cspan class=\"token operator\">+\u003C\u002Fspan> location\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>search\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\n\u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token operator\">!\u003C\u002Fspan>allowed\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">includes\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>endpoint\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>origin\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">throw\u003C\u002Fspan> \u003Cspan class=\"token keyword\">new\u003C\u002Fspan> \u003Cspan class=\"token class-name\">Error\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Refusing a preview from \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>endpoint\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>origin\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\n\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> response \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">await\u003C\u002Fspan> \u003Cspan class=\"token function\">fetch\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>endpoint\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token comment\">\u002F\u002F A token target reads without the cookie.\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">credentials\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> token \u003Cspan class=\"token operator\">?\u003C\u002Fspan> \u003Cspan class=\"token string\">'omit'\u003C\u002Fspan> \u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'include'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">headers\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">Accept\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token string\">'application\u002Fvnd.api+json'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token operator\">...\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>token \u003Cspan class=\"token operator\">&amp;&amp;\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">Authorization\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Bearer \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>token\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">if\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token operator\">!\u003C\u002Fspan>response\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>ok\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token keyword\">throw\u003C\u002Fspan> \u003Cspan class=\"token keyword\">new\u003C\u002Fspan> \u003Cspan class=\"token class-name\">Error\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token template-string\">\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003Cspan class=\"token string\">Preview failed: HTTP \u003C\u002Fspan>\u003Cspan class=\"token interpolation\">\u003Cspan class=\"token interpolation-punctuation punctuation\">${\u003C\u002Fspan>response\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>status\u003Cspan class=\"token interpolation-punctuation punctuation\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token template-punctuation string\">`\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">const\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> data\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> included \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">await\u003C\u002Fspan> response\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">json\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n\u003Cspan class=\"token comment\">\u002F\u002F Render data and included with the components a live page uses.\u003C\u002Fspan>","A preview page for Next, Astro or Nuxt 3",{"type":20,"layout":21,"regions":258},{"content":259},[260],{"type":261,"title":262,"content":263},"jumbotron","Help paragraph preview land",[264],{"type":25,"html":265},"\u003Cp>Unsaved paragraphs come through with the patch on \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fi\u002F3367724\">#3367724\u003C\u002Fa>, which druxtjs.org runs as a Composer patch. If you preview paragraphs, test it on your site and leave a review. It needs a tested review to land.\u003C\u002Fp>",{"type":20,"layout":21,"regions":267},{"content":268},[269,273],{"type":127,"description":270,"url":271,"gitpod":130,"drupalUrl":272},"\u003Cp>Consumer Node Preview's code is on GitHub, and its releases and issue queue are on Drupal.org. If your editors work on a Fully Decoupled site, sponsorship is what moves the diff work up the list.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002FDecipher\u002Fconsumer_node_preview","https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fconsumer_node_preview",{"type":127,"description":274,"url":275,"gitpod":130},"\u003Cp>Druxt Node Preview is on GitHub. Its end-to-end suite builds a Drupal site with both modules and previews through a real Druxt frontend.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002Fdruxt-contrib\u002Fdruxt-node-preview",{"type":20,"layout":21,"regions":277},{"content":278},[279,281],{"type":25,"html":280},"\u003Cp>Diffs are next: the changes toggle in the screenshot is druxtjs.org's early look at them.\u003C\u002Fp>",{"type":25,"html":282},"\u003Cp>If your frontend sits on a different domain to Drupal, is a 15-minute token long enough for the way your editors preview?\u003C\u002Fp>",[284,286,288],{"path":285,"source":136},"\u002Fwriting\u002Fdrupal-site-settings-over-jsonapi-consumer-20260826",{"path":287,"source":141},"\u002Fwriting\u002Fvale-100-prose-linting-drupal-20261028",{"path":135,"source":141},{"loc":138},"articles-data\u002Fconsumer-node-preview-100-rc1-preview-fully-decoupled-drupal-sites-20261112",[292,293,294],"editing","JSON:API","paragraphs","9TYXa50brm4Ye65PDvlSMOEPOBf2VaXdwlB7LO2bS6c",{"id":297,"title":298,"articleType":6,"categories":299,"date":300,"description":301,"extension":13,"feedImage":14,"hiddenCategories":302,"meta":303,"paragraphs":304,"path":135,"readingTime":450,"related":451,"sitemap":457,"stem":458,"topics":459,"__hash__":461},"articleEntries\u002Farticles-data\u002Fdruxt-0250-caching-and-performance-buffs-20261023.json","Druxt 0.25.0; caching and performance buffs",[8,9],"2026-10-23T18:00:00+11:00","Druxt 0.25.0 takes a Nuxt server from 17 requests to Drupal a page to 11, and to none with content caching on, with Drupal's own Cache-Control deciding how long and a webhook to clear it. Plus Manage display changes without a rebuild.",[16],{},[305,319,329,347,362,389,401,409,415,426,434,444],{"type":20,"layout":21,"regions":306},{"content":307},[308,310,312,314],{"type":25,"html":309},"\u003Cp>Druxt is the Fully Decoupled Drupal framework for Nuxt 2, and 0.25.0, the first Druxt release since 2023, makes it ask Drupal a lot less.\u003C\u002Fp>",{"type":25,"html":311},"\u003Cp>On druxtjs.org, the Druxt docs site, a page render made 17 requests to Drupal. On 0.25.0 it makes 11, and with content caching on it makes none, until Drupal's lifetime for the page runs out. The Nuxt server keeps what Drupal sends for as long as Drupal's \u003Ccode>Cache-Control\u003C\u002Fcode> allows, and a webhook clears it when content changes.\u003C\u002Fp>",{"type":25,"html":313},"\u003Cp>Separately, the first-load flicker is gone, and with \u003Ccode>schema.refresh\u003C\u002Fcode> on, a change in Drupal's Manage display shows up without a rebuild, which is the part I have wanted for years. The upgrade command is near the end.\u003C\u002Fp>",{"type":46,"src":315,"alt":316,"caption":317,"width":50,"height":318},"\u002Fimages\u002Fwriting\u002Fdruxt-0250-caching-and-performance-buffs-20261023\u002Fdruxt-0-25-0-content-cache-grid.png","Three dot grids, one dot per request to Drupal, one column per page of a 24-page warm crawl. Druxt 0.24.0 makes 17 on most pages and 29 and 35 on the two section pages, 438 in all. Druxt 0.25.0 with cache.content off makes 11 on most pages, 294 in all. Druxt 0.25.0 with cache.content on makes none on any page. Counted at a proxy in front of Drupal answering max-age 300.","Requests to Drupal per page over a 24-page warm crawl: 17 a page on Druxt 0.24.0, 11 on 0.25.0, and 0 on 0.25.0 with cache.content on. Counted at a proxy, Drupal answering max-age 300; each process also reads the index and the decoupled settings once at start.",640,{"type":20,"layout":21,"regions":320,"title":328},{"content":321},[322,324,326],{"type":25,"html":323},"\u003Cp>0.24.0 made 17 calls a page, and six of them were the JSON:API index and the menus, asked again on every page. The index is Drupal's map of its API, and Druxt reads it to find everything else. Two of the six were duplicates within one render, and they go the moment you upgrade: identical requests now share one fetch, and the menu cache keys on the query it sends.\u003C\u002Fp>",{"type":25,"html":325},"\u003Cp>The other four are kept on the Nuxt server between requests. Drupal's \u003Ccode>Cache-Control\u003C\u002Fcode> decides how long, \u003Ccode>ttl\u003C\u002Fcode> can only shorten it, and when in doubt nothing is kept. The \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\u002Fhow-to\u002Fcaching#how-long-it-lasts\">caching guide\u003C\u002Fa> has the full rules. Across a 24-page crawl, that is 144 index and menu requests down to none once the first page has been rendered.\u003C\u002Fp>",{"type":25,"html":327},"\u003Cp>A signed-in request never fills it: an \u003Ccode>Authorization\u003C\u002Fcode> header, basic auth or a Drupal session cookie skips it, and an analytics cookie doesn't count.\u003C\u002Fp>","Asking Drupal once",{"type":20,"layout":21,"regions":330,"title":346},{"content":331},[332,334,340,344],{"type":25,"html":333},"\u003Cp>Index and menu caching is on by default in production builds. Drupal needs one setting, the page cache max-age, which ships at 0. It applies to anonymous responses across the site, so browsers and CDNs will hold pages for five minutes too. Check Drupal itself rather than a CDN in front of it:\u003C\u002Fp>",{"type":46,"src":335,"alt":336,"caption":337,"width":338,"height":339},"\u002Fimages\u002Fwriting\u002Fdruxt-0250-caching-and-performance-buffs-20261023\u002Fdrupal-performance-max-age.png","Drupal 11's Performance page under Administration, Configuration, Development, with the Caching section open and Browser and proxy cache maximum age set to 5 min, above Drupal's note that the value is used as max-age in Cache-Control headers.","Administration > Configuration > Development > Performance, with the page cache maximum age at 5 minutes.",788,551,{"type":40,"title":341,"code":342,"language":111,"highlighted":343},"Five minutes, then check the header","drush -y config:set system.performance cache.page.max_age 300\ndrush -y config:export\ncurl -sI https:\u002F\u002Fcms.example.com\u002Fjsonapi | grep -i cache-control\n# cache-control: max-age=300, public","drush \u003Cspan class=\"token parameter variable\">-y\u003C\u002Fspan> config:set system.performance cache.page.max_age \u003Cspan class=\"token number\">300\u003C\u002Fspan>\ndrush \u003Cspan class=\"token parameter variable\">-y\u003C\u002Fspan> config:export\n\u003Cspan class=\"token function\">curl\u003C\u002Fspan> \u003Cspan class=\"token parameter variable\">-sI\u003C\u002Fspan> https:\u002F\u002Fcms.example.com\u002Fjsonapi \u003Cspan class=\"token operator\">|\u003C\u002Fspan> \u003Cspan class=\"token function\">grep\u003C\u002Fspan> \u003Cspan class=\"token parameter variable\">-i\u003C\u002Fspan> cache-control\n\u003Cspan class=\"token comment\"># cache-control: max-age=300, public\u003C\u002Fspan>",{"type":25,"html":345},"\u003Cp>If you have turned CORS on in Drupal's \u003Ccode>services.yml\u003C\u002Fcode>, allow one origin, or \u003Ccode>*\u003C\u002Fcode> without credentials. Two or more origins, or an origin pattern, add \u003Ccode>Vary: Origin\u003C\u002Fcode> to every response, and nothing gets cached. Credentials are fine with one origin, so a preview setup like \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fconsumer_node_preview\">Consumer Node Preview\u003C\u002Fa>'s keeps caching, and an editor's signed-in preview skips the cache anyway.\u003C\u002Fp>","Turning it on",{"type":20,"layout":21,"title":348,"regions":349},"Caching content",{"content":350},[351,353,358,360],{"type":25,"html":352},"\u003Cp>The index and menus are cached by default. Set \u003Ccode>cache.content\u003C\u002Fcode> and the same cache keeps everything else Druxt fetches from Drupal: entities, collections, views and route lookups.\u003C\u002Fp>",{"type":40,"title":354,"code":355,"language":356,"highlighted":357},"nuxt.config.js, with content caching","export default {\n  druxt: {\n    cache: { content: true, secret: process.env.DRUXT_CACHE_SECRET },\n  },\n}","js","\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">druxt\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">cache\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">content\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">secret\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> process\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>env\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token constant\">DRUXT_CACHE_SECRET\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":25,"html":359},"\u003Cp>On a local copy of druxtjs.org, a warm docs page went from 11 calls to Drupal to none. A cold crawl, every page visited once, went from 438 calls on 0.24.0 to 157, a third of them on the first page, where schema refresh reads Drupal's displays. Only successful anonymous responses are kept, so a signed-in visitor still reaches Drupal, and a page published after someone saw its 404 shows straight away.\u003C\u002Fp>",{"type":25,"html":361},"\u003Cp>Content changes far more often than menus, so pair it with the clear from Drupal, below. Each cache area holds at most 50 MB of stored JSON per consumer by default, set by \u003Ccode>cache.maxSize\u003C\u002Fcode>, and can take about three times that in memory, so size it against your Nuxt process.\u003C\u002Fp>",{"type":20,"layout":21,"regions":363,"title":388},{"content":364},[365,367,370,372,374,378,382,386],{"type":25,"html":366},"\u003Cp>Five minutes is a long time to wait for a menu edit, so Drupal can clear the cache the moment content changes. Give Druxt a secret:\u003C\u002Fp>",{"type":40,"title":41,"code":368,"language":356,"highlighted":369},"export default {\n  druxt: {\n    cache: { secret: process.env.DRUXT_CACHE_SECRET },\n  },\n}","\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">druxt\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">cache\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">secret\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> process\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>env\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token constant\">DRUXT_CACHE_SECRET\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":25,"html":371},"\u003Cp>A server-rendered production build then has a clear endpoint, \u003Ccode>POST \u002F_druxt\u002Fcache\u002Fclear\u003C\u002Fcode>, locked to the secret in an \u003Ccode>X-Druxt-Secret\u003C\u002Fcode> header. Each Nuxt process keeps its own cache, so a site running several clears each one. List Druxt, or a module that adds it such as \u003Ccode>druxt-site\u003C\u002Fcode>, under \u003Ccode>modules\u003C\u002Fcode> rather than \u003Ccode>buildModules\u003C\u002Fcode>, or the endpoint answers 404 under \u003Ccode>nuxt start\u003C\u002Fcode>.\u003C\u002Fp>",{"type":25,"html":373},"\u003Cp>On druxtjs.org, Drupal's Purge module sends that POST whenever a cache tag is invalidated, so a saved menu link reaches the frontend on the next request. It clears Druxt's cache only, so a CDN in front of Drupal needs its own purger, and a \u003Ccode>drush cr\u003C\u002Fcode> doesn't send it.\u003C\u002Fp>",{"type":40,"title":375,"code":376,"language":111,"highlighted":377},"Purge, sending the clear to Nuxt","drush -y pm:install purge purge_ui purge_purger_http \\\n  purge_queuer_coretags purge_processor_lateruntime\ndrush p:purger-add httpbundled   # note the purger ID it prints\n# At Configuration > Development > Performance > Purge, set the purger to\n# Nuxt's host and port, path \u002F_druxt\u002Fcache\u002Fclear, method POST,\n# invalidation type tag, and a header X-Druxt-Secret.","drush \u003Cspan class=\"token parameter variable\">-y\u003C\u002Fspan> pm:install purge purge_ui purge_purger_http \u003Cspan class=\"token punctuation\">\\\u003C\u002Fspan>\n  purge_queuer_coretags purge_processor_lateruntime\ndrush p:purger-add httpbundled   \u003Cspan class=\"token comment\"># note the purger ID it prints\u003C\u002Fspan>\n\u003Cspan class=\"token comment\"># At Configuration > Development > Performance > Purge, set the purger to\u003C\u002Fspan>\n\u003Cspan class=\"token comment\"># Nuxt's host and port, path \u002F_druxt\u002Fcache\u002Fclear, method POST,\u003C\u002Fspan>\n\u003Cspan class=\"token comment\"># invalidation type tag, and a header X-Druxt-Secret.\u003C\u002Fspan>",{"type":40,"title":379,"code":380,"language":187,"highlighted":381},"settings.php, keeping the secret out of exported config","$config['purge_purger_http.settings.PURGER_ID']['headers'][0]['value'] = getenv('DRUXT_CACHE_SECRET');","\u003Cspan class=\"token variable\">$config\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'purge_purger_http.settings.PURGER_ID'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'headers'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token number\">0\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'value'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token function\">getenv\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token string single-quoted-string\">'DRUXT_CACHE_SECRET'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">;\u003C\u002Fspan>",{"type":40,"title":383,"code":384,"language":111,"highlighted":385},"Check the endpoint, expecting 204","curl -s -o \u002Fdev\u002Fnull -w '%{http_code}\\n' -X POST \\\n  -H \"X-Druxt-Secret: your-secret\" http:\u002F\u002Fnuxt:3000\u002F_druxt\u002Fcache\u002Fclear","\u003Cspan class=\"token function\">curl\u003C\u002Fspan> \u003Cspan class=\"token parameter variable\">-s\u003C\u002Fspan> \u003Cspan class=\"token parameter variable\">-o\u003C\u002Fspan> \u002Fdev\u002Fnull \u003Cspan class=\"token parameter variable\">-w\u003C\u002Fspan> \u003Cspan class=\"token string\">'%{http_code}\\n'\u003C\u002Fspan> \u003Cspan class=\"token parameter variable\">-X\u003C\u002Fspan> POST \u003Cspan class=\"token punctuation\">\\\u003C\u002Fspan>\n  \u003Cspan class=\"token parameter variable\">-H\u003C\u002Fspan> \u003Cspan class=\"token string\">\"X-Druxt-Secret: your-secret\"\u003C\u002Fspan> http:\u002F\u002Fnuxt:3000\u002F_druxt\u002Fcache\u002Fclear",{"type":25,"html":387},"\u003Cp>Every tag invalidation clears the whole cache, which is blunt but cheap. The \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\u002Fhow-to\u002Fcaching#clear-on-save-with-purge\">caching guide\u003C\u002Fa> has the details.\u003C\u002Fp>","Clearing it from Drupal",{"type":20,"layout":21,"regions":390,"title":400},{"content":391},[392,394,398],{"type":25,"html":393},"\u003Cp>Druxt builds its schemas, which fields a component renders and in what order, from Manage display at build time, so moving a field meant a rebuild. With \u003Ccode>schema.refresh\u003C\u002Fcode> on, the server regenerates them after each clear: move a field, save, and the next page has it.\u003C\u002Fp>",{"type":40,"title":395,"code":396,"language":356,"highlighted":397},"nuxt.config.js, with schema refresh","export default {\n  modules: ['druxt-site'], \u002F\u002F or druxt-schema, not buildModules\n  druxt: {\n    cache: { secret: process.env.DRUXT_CACHE_SECRET },\n    schema: { refresh: true },\n  },\n}","\u003Cspan class=\"token keyword\">export\u003C\u002Fspan> \u003Cspan class=\"token keyword\">default\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">modules\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token string\">'druxt-site'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan> \u003Cspan class=\"token comment\">\u002F\u002F or druxt-schema, not buildModules\u003C\u002Fspan>\n  \u003Cspan class=\"token literal-property property\">druxt\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">cache\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">secret\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> process\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>env\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token constant\">DRUXT_CACHE_SECRET\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token literal-property property\">schema\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> \u003Cspan class=\"token literal-property property\">refresh\u003C\u002Fspan>\u003Cspan class=\"token operator\">:\u003C\u002Fspan> \u003Cspan class=\"token boolean\">true\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":25,"html":399},"\u003Cp>The first page after a clear pays for it, with about two dozen configuration reads on druxtjs.org, and every page after that is back to normal. The server generates with the build's access to Drupal, so those credentials need to be in production too. A static site can run the same refresh from its own Node server with \u003Ccode>createSchemaRefresh\u003C\u002Fcode>, which the \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\u002Fhow-to\u002Fcaching#schemas-after-a-display-change\">caching guide\u003C\u002Fa> covers.\u003C\u002Fp>","Display changes without a rebuild",{"type":20,"layout":21,"regions":402,"title":408},{"content":403},[404,406],{"type":25,"html":405},"\u003Cp>Over a network that adds up. On a local copy of druxtjs.org, alternating the versions page by page, 0.25.0 rendered warm pages nearly a third faster than 0.24.0 in all 66 paired visits, and in about a sixth of 0.24.0's time with content caching on. Inside a hosting cluster, where Drupal is a couple of milliseconds away, the time saved is small, and the win is Drupal answering fewer requests. Put a proxy in front of your own Drupal and count: how many times does your site ask the same question?\u003C\u002Fp>",{"type":25,"html":407},"\u003Cp>Drupal is getting quicker too. ptmkenny's core patch in \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fdrupal\u002Fissues\u002F3626255\">#3626255\u003C\u002Fa> reads JSON:API's cached normalizations in bulk. On the docs collection behind druxtjs.org's sitemap, with normalizations warm, it took 1301 database queries down to 77 with identical responses. It needs reviews, and the issue covers running it on 11.x.\u003C\u002Fp>","What it saves",{"type":20,"layout":21,"regions":410,"title":414},{"content":411},[412],{"type":25,"html":413},"\u003Cul>\u003Cli>No more first-load flicker. Druxt components no longer fetch their data again when a production build hydrates, so any \u003Ccode>components:extend\u003C\u002Fcode> hook you added to hide it can go.\u003C\u002Fli>\u003Cli>Pages don't jump on a refetch, because components keep their content while they fetch.\u003C\u002Fli>\u003Cli>Views follow the language you asked for, not the site default.\u003C\u002Fli>\u003Cli>A 403 or 404 from a route renders through Nuxt's own error page.\u003C\u002Fli>\u003Cli>Vue and Vuex are peer dependencies, so a site uses its own copy, and a mismatched second copy can't stop Nuxt at startup.\u003C\u002Fli>\u003C\u002Ful>","Also in 0.25.0",{"type":20,"layout":21,"regions":416,"title":118},{"content":417},[418,420,424],{"type":25,"html":419},"\u003Cp>The packages version together, so move them in one go:\u003C\u002Fp>",{"type":40,"title":421,"code":422,"language":111,"highlighted":423},"Upgrade the set together","# Drop any druxt package your site doesn't use\nnpm install druxt@^0.25.0 druxt-site@^0.15.0 druxt-router@^0.32.0 \\\n  druxt-entity@^0.29.0 druxt-menu@^0.22.0 druxt-blocks@^0.18.0 \\\n  druxt-views@^0.23.0 druxt-breadcrumb@^0.18.0 druxt-schema@^0.12.0 \\\n  axios@^0.34.0\n# Still on Vue 2.6? Add vue@^2.7.14 vuex@^3.6.2\n# Using druxt-auth? Take it to 0.5.1 in the same install.","\u003Cspan class=\"token comment\"># Drop any druxt package your site doesn't use\u003C\u002Fspan>\n\u003Cspan class=\"token function\">npm\u003C\u002Fspan> \u003Cspan class=\"token function\">install\u003C\u002Fspan> druxt@^0.25.0 druxt-site@^0.15.0 druxt-router@^0.32.0 \u003Cspan class=\"token punctuation\">\\\u003C\u002Fspan>\n  druxt-entity@^0.29.0 druxt-menu@^0.22.0 druxt-blocks@^0.18.0 \u003Cspan class=\"token punctuation\">\\\u003C\u002Fspan>\n  druxt-views@^0.23.0 druxt-breadcrumb@^0.18.0 druxt-schema@^0.12.0 \u003Cspan class=\"token punctuation\">\\\u003C\u002Fspan>\n  axios@^0.34.0\n\u003Cspan class=\"token comment\"># Still on Vue 2.6? Add vue@^2.7.14 vuex@^3.6.2\u003C\u002Fspan>\n\u003Cspan class=\"token comment\"># Using druxt-auth? Take it to 0.5.1 in the same install.\u003C\u002Fspan>",{"type":25,"html":425},"\u003Cp>The deprecated \u003Ccode>DruxtField\u003C\u002Fcode> components are off unless you set \u003Ccode>druxt.entity.components.fields: true\u003C\u002Fcode>, and a \u003Ccode>consola\u003C\u002Fcode> 2.15.3 pin can go. Wrapper components no longer render module data as HTML attributes, so \u003Ccode>entity=\"[object Object]\"\u003C\u002Fcode> is gone from your markup. Wrappers still read it from \u003Ccode>$attrs\u003C\u002Fcode>. The rest is in the \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\u002Fapi\u002Fpackages\u002Fdruxt\u002FCHANGELOG\">changelog on druxtjs.org\u003C\u002Fa>.\u003C\u002Fp>",{"type":20,"layout":21,"title":427,"regions":428},"Why 0.25.0, and not Nuxt 4?",{"content":429},[430,432],{"type":25,"html":431},"\u003Cp>Nuxt 2 is end of life, so it is a fair question. Druxt had years of improvements and fixes sitting unreleased, and I would rather finish them than carry them across half done. 0.25.0 gets that work out, and gives the 2.0.0 port a stable, fast baseline to start from. Get it right on the stack it runs on today, then upgrade, then add new features, then polish.\u003C\u002Fp>",{"type":25,"html":433},"\u003Cp>There is one more 0.x release planned before 1.0.0. 0.26.0 is mostly waiting on a \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fdecoupled_router\u002Fissues\u002F3111456\">decoupled router patch\u003C\u002Fa>, so a site whose default language has no URL prefix stops redirecting its front page to \u003Ccode>\u002Fen\u003C\u002Fcode>, plus whatever other multilingual fixes turn up before then. Then 1.0.0, the last Druxt on Nuxt 2, with Druxt 2.0.0, the Nuxt 4 rewrite under \u003Ccode>@druxt\u003C\u002Fcode>, on track for a first beta alongside it, building on the caching model 0.25.0 settled on.\u003C\u002Fp>",{"type":20,"layout":21,"title":435,"regions":436},"Experimenting with WebSockets",{"content":437},[438,440],{"type":25,"html":439},"\u003Cp>Something to play with while you wait. \u003Ca href=\"https:\u002F\u002Fumami.demo.druxtjs.org\u002Fplay\">Umami Go\u003C\u002Fa> is a multiplayer card game on the Umami demo, dealt from the magazine's recipes and rendered by Druxt. It is also where you can try the upcoming Druxt WebSockets module, still in development: edit a recipe in Drupal, and it changes in every hand holding it.\u003C\u002Fp>",{"type":46,"src":441,"alt":442,"caption":443,"width":50,"height":318},"\u002Fimages\u002Fwriting\u002Fdruxt-0250-caching-and-performance-buffs-20261023\u002Fumami-go.jpg","The Umami Go page: the title Umami Go in white italic serif on a dark brown lattice, the line 'A card game for two to five, dealt from this magazine's recipes', a Start a table button with a box to join by code, a fan of five recipe cards, and a 'Built on Druxt' badge with the Druxt icon.","Umami Go, a card game dealt from Drupal's Umami recipes, with a live table over the upcoming Druxt WebSockets module.",{"type":20,"layout":21,"regions":445},{"content":446},[447],{"type":127,"description":448,"url":129,"gitpod":130,"drupalUrl":449},"\u003Cp>Druxt 1.0.0 and 2.x move as fast as sponsorship lets them.\u003C\u002Fp>","https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fdruxt","7 min",[452,453,455],{"path":140,"source":136},{"path":454,"source":141},"\u002Fwriting\u002Fjsonapi-views-120-20260812",{"path":456,"source":141},"\u002Fwriting\u002Fdruxt-auth-050-two-ways-to-sign-in-20260926",{"loc":135},"articles-data\u002Fdruxt-0250-caching-and-performance-buffs-20261023",[460,293,10],"caching","edV1vBUxLvz0cphWthoinHz6wGs9sGxURbqR767Wg8k",{"id":463,"title":464,"articleType":6,"categories":465,"date":466,"description":467,"extension":13,"feedImage":130,"hiddenCategories":468,"meta":469,"paragraphs":470,"path":140,"readingTime":567,"related":568,"sitemap":572,"stem":573,"topics":574,"__hash__":576},"articleEntries\u002Farticles-data\u002Fdruxt-drupal-13x-resource-list-yours-20260909.json","Druxt (for Drupal) 1.3.x; the resource list is yours",[8,9],"2026-09-09T19:30:00+10:00","Druxt's Drupal module answers for twelve JSON:API resources, hardcoded, all of them describing structure. 1.3.0 makes that list yours, and here's what I'd add to mine. Any JSON:API client benefits, not only Druxt.",[16],{},[471,480,492,520,528,543,553,561],{"type":20,"layout":21,"regions":472},{"content":473},[474,476,478],{"type":25,"html":475},"\u003Cp>Druxt's Drupal module carries a list of twelve JSON:API resources it answers for. It's been the same twelve since 2021, hardcoded in a PHP array, and changing it has meant carrying a patch.\u003C\u002Fp>",{"type":25,"html":477},"\u003Cp>1.3.0, tagged today, makes that list yours. The twelve stay exactly as they are, so nothing a site exposes changes when it updates. What is new is being able to choose, and the first thing I would choose is the one my frontend has always had to guess at: the toolbar an administrator configured for a text format.\u003C\u002Fp>\u003Cp>A CORS default ships in the same release. If you keep a proxy rule in front of your frontend so that authenticated calls succeed, this is the release where you delete it.\u003C\u002Fp>",{"type":25,"html":479},"\u003Cp>The module name suggests otherwise, but this is a Drupal-side change. Any client holding the right permission gets the same reads.\u003C\u002Fp>",{"type":20,"title":481,"layout":21,"regions":482},"What it answers today",{"content":483},[484,486,490],{"type":25,"html":485},"\u003Cp>Anyone holding the \u003Ccode>access druxt resources\u003C\u002Fcode> permission can read these, whatever access control would otherwise have said:\u003C\u002Fp>",{"type":40,"title":487,"code":488,"language":489},"The list, as it stands","block--block\nconfigurable_language--configurable_language\nentity_form_display--entity_form_display\nentity_form_mode--entity_form_mode\nentity_view_display--entity_view_display\nentity_view_mode--entity_view_mode\nfield_config--field_config\nfield_storage_config--field_storage_config\njsonapi_resource_config--jsonapi_resource_config\nmenu--menu\nmenu_link_content--menu_link_content\nview--view","text",{"type":25,"html":491},"\u003Cp>Every one describes structure, and all of it is configuration, with one exception: \u003Ccode>menu_link_content\u003C\u002Fcode> is content, and we will come back to it. None of them describes how the site prefers things to look or behave, and with the list compiled in, nobody could add one that did.\u003C\u002Fp>",{"type":20,"title":493,"layout":21,"regions":494},"Starting with rich text",{"content":495},[496,498,500,502,508,510,512,516,518],{"type":25,"html":497},"\u003Cp>A frontend offering an editing experience has no way to read the toolbar an administrator configured, so it ships whatever buttons its developer chose and hopes they match.\u003C\u002Fp>",{"type":25,"html":499},"\u003Cp>The reason it cannot read it is the interesting part. The only core permission that grants access to a text format's configuration is \u003Cstrong>administer filters\u003C\u002Fstrong>, which core itself flags \u003Ccode>restrict access\u003C\u002Fcode>. Hand it to an author and they can rewrite the text format, one of the shorter routes to an XSS. So the choice has been between a permission you cannot give them and a frontend guessing at a toolbar.\u003C\u002Fp>",{"type":25,"html":501},"\u003Cp>A checkbox is the third option, on a new settings form at \u003Cem>Configuration &gt; Web services &gt; Druxt\u003C\u002Fem>. It grants read where \u003Cstrong>administer filters\u003C\u002Fstrong> grants write, and it grants it to everyone holding \u003Ccode>access druxt resources\u003C\u002Fcode> instead of to one trusted account. List \u003Ccode>editor--editor\u003C\u002Fcode> and the frontend reads the toolbar and builds from it; change the toolbar in Drupal and the editor changes, with no rebuild: 10 buttons for \u003Ccode>basic_html\u003C\u002Fcode>, 16 for \u003Ccode>full_html\u003C\u002Fcode>.\u003C\u002Fp>",{"type":46,"src":503,"alt":504,"caption":505,"width":506,"height":507},"\u002Fimages\u002Fwriting\u002Fdruxt-130-toolbars.png","Two toolbars stacked, each labelled with one word. Above, labelled Drupal: the buttons sit in grey tiles and the separators are tiles of their own. Below, labelled Frontend: the same buttons in the same order in a plain row with thin dividers. In both, reading left to right: bold, italic, strikethrough, superscript, subscript, code, remove format, link, bulleted list, numbered list, block quote, image, table, horizontal line, a heading dropdown, code block and source editing.","\u003Cp>The same toolbar, twice. Drupal draws the separators as draggable tiles because that screen is for editing the toolbar; the frontend draws them as dividers.\u003C\u002Fp>",2560,744,{"type":25,"html":509},"\u003Cp>Which filters run is a second tick, on \u003Ccode>filter_format--filter_format\u003C\u002Fcode>. It tells a frontend whether a caption arrives in a \u003Ccode>data-caption\u003C\u002Fcode> attribute or in the markup. Fetch it once first: JSON:API hands over whole entities, so that is every format on the site and each one's filter settings, an open blob contrib modules fill with their own keys.\u003C\u002Fp>",{"type":25,"html":511},"\u003Cp>What comes back is Drupal's vocabulary, not CKEditor's. \u003Ccode>drupalInsertImage\u003C\u002Fcode> is Drupal's name for \u003Ccode>uploadImage\u003C\u002Fcode>, and an item your build has not loaded is dropped with a console warning rather than an error, so the editor comes up fine, quietly missing buttons the format says it has.\u003C\u002Fp>",{"type":40,"title":513,"code":514,"language":356,"highlighted":515},"Reading the toolbar, server side","\u002F\u002F Nuxt 2. fetch() runs on the server; druxt-site injects $druxt.\nasync fetch() {\n  \u002F\u002F A string: an object does not survive the query serialiser, and 400s.\n  const { data } = await this.$druxt.getCollection(\n    'editor--editor',\n    'filter[drupal_internal__format]=basic_html',\n  )\n  this.items = ((data[0] || {}).attributes || {}).settings.toolbar.items || []\n}","\u003Cspan class=\"token comment\">\u002F\u002F Nuxt 2. fetch() runs on the server; druxt-site injects $druxt.\u003C\u002Fspan>\n\u003Cspan class=\"token keyword\">async\u003C\u002Fspan> \u003Cspan class=\"token function\">fetch\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\n  \u003Cspan class=\"token comment\">\u002F\u002F A string: an object does not survive the query serialiser, and 400s.\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">const\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan> data \u003Cspan class=\"token punctuation\">}\u003C\u002Fspan> \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token keyword\">await\u003C\u002Fspan> \u003Cspan class=\"token keyword\">this\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>$druxt\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>\u003Cspan class=\"token function\">getCollection\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\n    \u003Cspan class=\"token string\">'editor--editor'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n    \u003Cspan class=\"token string\">'filter[drupal_internal__format]=basic_html'\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">,\u003C\u002Fspan>\n  \u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\n  \u003Cspan class=\"token keyword\">this\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>items \u003Cspan class=\"token operator\">=\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">(\u003C\u002Fspan>data\u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token number\">0\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan> \u003Cspan class=\"token operator\">||\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>attributes \u003Cspan class=\"token operator\">||\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">{\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">)\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>settings\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>toolbar\u003Cspan class=\"token punctuation\">.\u003C\u002Fspan>items \u003Cspan class=\"token operator\">||\u003C\u002Fspan> \u003Cspan class=\"token punctuation\">[\u003C\u002Fspan>\u003Cspan class=\"token punctuation\">]\u003C\u002Fspan>\n\u003Cspan class=\"token punctuation\">}\u003C\u002Fspan>",{"type":25,"html":517},"\u003Cp>All of which is me saying: expect a Druxt CKEditor module in the future. Mounting the editor is where the work actually is. CKEditor 5 uses static class blocks, which the bundler Nuxt 2 ships cannot parse, so today you load it from a script tag and match the version Drupal ships rather than the one npm defaults to. That is exactly the sort of thing a module should absorb so nobody else meets it.\u003C\u002Fp>",{"type":25,"html":519},"\u003Cp>Neither is ticked by default. Updating writes the same twelve into configuration and stops there, and nothing on the list is readable by anyone until \u003Ccode>access druxt resources\u003C\u002Fcode> is granted, which installing grants to nobody. Changing the list needs \u003Ccode>administer druxt\u003C\u002Fcode>, which ships restricted.\u003C\u002Fp>",{"type":20,"title":521,"layout":21,"regions":522},"Then everything else",{"content":523},[524,526],{"type":25,"html":525},"\u003Cp>What else is a frontend inventing? All three of these are configuration entities, so they are already in that checkbox list, unticked:\u003C\u002Fp>",{"type":25,"html":527},"\u003Cul>\u003Cli>\u003Cstrong>Image styles.\u003C\u002Fstrong> Effects carry the dimensions a \u003Ccode>srcset\u003C\u002Fcode> needs. The derivative URLs are solved already, by \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fjsonapi_image_styles\">JSON:API Image Styles\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fconsumer_image_styles\">Consumer Image Styles\u003C\u002Fa>, after \u003Ca href=\"https:\u002F\u002Fwww.lullabot.com\u002Farticles\u002Fdecoupled-drupal-hard-problems-image-styles\">Lullabot named it in 2018\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Editorial workflow.\u003C\u002Fstrong> Content moderation's states and transitions would let an editing interface show where a document sits and which moves are legal, instead of a hardcoded draft-and-published pair\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Bulk actions.\u003C\u002Fstrong> \u003Ccode>action--action\u003C\u002Fcode> carries every action a site has configured, so a decoupled content list could offer exactly those\u003C\u002Fli>\n\u003C\u002Ful>",{"type":20,"title":529,"layout":21,"regions":530},"What it will not answer for",{"content":531},[532,534,536,538],{"type":25,"html":533},"\u003Cp>Druxt answers Drupal's entity access check with a yes for any listed route, and lifts JSON:API's limit on filtering by fields the requester could not otherwise see. A listed resource is readable by anyone holding \u003Ccode>access druxt resources\u003C\u002Fcode>, whatever the site would otherwise have said, and on a decoupled site that permission often goes to anonymous.\u003C\u002Fp>",{"type":25,"html":535},"\u003Cp>The list has one axis. It says what, never who: the same yes, site-wide, for everyone holding the permission. That suits configuration, which answers the same whoever is asking. Content varies per entity by published state, owner and field access, so one yes is never right for it. \u003Ccode>user--user\u003C\u002Fcode> would hand over every account, blocked ones included, and enough filtering to enumerate them.\u003C\u002Fp>",{"type":25,"html":537},"\u003Cp>\u003Ccode>menu_link_content\u003C\u002Fcode> is the exception, and it is content, grandfathered because it shipped in the hardcoded list. It is also the resource that gives a frontend the least, so I maintain \u003Ca href=\"https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fjsonapi_menu_items\">JSON:API Menu Items\u003C\u002Fa> to cover the gap.\u003C\u002Fp>",{"type":46,"src":539,"alt":540,"caption":541,"width":50,"height":542},"\u002Fimages\u002Fwriting\u002Fdruxt-130-settings-form.png","The Druxt settings form at Configuration, Web services, Druxt. A list headed Exposed resources with a checkbox per configuration entity type. Ticked: block, editor, entity_form_display, entity_form_mode, entity_view_display, entity_view_mode, field_config, field_storage_config, menu, menu_link_content, view. Unticked: action, base_field_override, block_content_type, date_format, filter_format, image_style, media_type, node_type, oauth2_scope, oauth2_token_type, taxonomy_vocabulary, user_role. No content entity types are offered. Help text below reads that a checked resource is readable by anyone with the access druxt resources permission, whatever the site would otherwise allow.","\u003Cp>Configuration entity types only, and no content ones offered at all. \u003Ccode>editor--editor\u003C\u002Fcode> and \u003Ccode>filter_format--filter_format\u003C\u002Fcode> are separate ticks, and the help text under the list says outright that a ticked resource is readable by anyone holding the permission.\u003C\u002Fp>",900,{"type":20,"title":544,"layout":21,"regions":545},"CORS, and the proxy rule you can delete",{"content":546},[547,549,551],{"type":25,"html":548},"\u003Cp>One more thing, and it takes a step out of everyone's setup. On a site that has not configured CORS itself, Druxt turns it on and allows every header, and now sets \u003Ccode>allowedMethods\u003C\u002Fcode> too. That list is what the library underneath advertises methods from, and core ships it empty, so the browser refused the preflight and the request never left.\u003C\u002Fp>",{"type":25,"html":550},"\u003Cp>Anonymous \u003Ccode>GET\u003C\u002Fcode> was never affected, since a simple request is not preflighted. What changes is everything else: writes, and reads that set an \u003Ccode>Authorization\u003C\u002Fcode> header. If you keep a proxy rule or a middleware in front of your frontend so that authenticated calls succeed, this is the release where you delete it. Worth checking rather than assuming, because a refused preflight answers 204 with a clean log, and \u003Ccode>curl\u003C\u002Fcode> never reproduces it: only a browser enforces the response.\u003C\u002Fp>",{"type":25,"html":552},"\u003Cp>A site that configured \u003Ccode>cors.config\u003C\u002Fcode> itself is untouched, and credentials stay off, so cookies and sessions still do not travel cross-origin. An \u003Ccode>Authorization\u003C\u002Fcode> header does. The \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\u002F\">documentation site\u003C\u002Fa> was rebuilt around \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\u002Ftutorials\">tutorials\u003C\u002Fa> last week, and the \u003Ca href=\"https:\u002F\u002Fdruxtjs.org\u002Ftutorials\u002Fauthentication\">login flow\u003C\u002Fa> is the one to start with if authenticated requests are what you have been putting off.\u003C\u002Fp>",{"type":20,"title":554,"layout":21,"regions":555},"What are you working around?",{"content":556},[557,559],{"type":25,"html":558},"\u003Cp>Enough about what I would tick. What I want to know is what you are already working around. Anyone building against Drupal from outside it has written something that guesses at a value Drupal already holds. Mine was a toolbar. It is a checkbox now.\u003C\u002Fp>",{"type":25,"html":560},"\u003Cp>So what is yours, and what would you build if you could simply read it?\u003C\u002Fp>",{"type":20,"layout":21,"regions":562},{"content":563},[564],{"type":127,"description":565,"url":566,"gitpod":130,"drupalUrl":449},"\u003Cp>The Drupal module this ships in. If your projects lean on modules like it, sponsoring is what keeps them maintained.\u003C\u002Fp>","https:\u002F\u002Fgithub.com\u002Fdruxt\u002Fdruxt_drupal","6 min",[569,570,571],{"path":456,"source":136},{"path":135,"source":141},{"path":285,"source":141},{"loc":140},"articles-data\u002Fdruxt-drupal-13x-resource-list-yours-20260909",[293,575,292],"CORS","j5piJweww6k6XDGTQFGRpVVfRUnE42-b8j1t3UIpO5A",1795501491031]