@uniweb/core 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/detail-url.js +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
package/src/detail-url.js CHANGED
@@ -108,6 +108,24 @@ export function buildDetailConfig(collectionConfig, dynamicContext) {
108
108
  }
109
109
 
110
110
  // String-form: URL-based conventions.
111
+ //
112
+ // ⭐ `rest` and `query` BUILD FROM THE LIST URL, so its query string survives onto
113
+ // the detail request. That is deliberate and it is the safe default: the params
114
+ // that matter most to a single-record read are exactly the ones a list carries —
115
+ // `?lang=`, an API key, a tenancy id. Dropping them would 401 the detail request
116
+ // or return the wrong language, on every detail page.
117
+ //
118
+ // ⚠️ The cost is real and lands on ONE category: a PROJECTION param (`?fields=`,
119
+ // `?select=`) asks the API for a summary, and carrying it truncates the very
120
+ // record the detail fetch exists to get in full. The request still succeeds and
121
+ // only some fields are missing, so it reads as a component or API fault rather
122
+ // than a URL one.
123
+ //
124
+ // ⛔ Framework cannot tell the categories apart — they are the host's vocabulary,
125
+ // not ours. So the default keeps everything and the CUSTOM PATTERN form is the
126
+ // way out: it is used verbatim, so nothing carries over unless the author writes
127
+ // it. Documented for authors in `docs/reference/dynamic-routes.md` § *The list's
128
+ // query string carries over*.
111
129
  let detailUrl
112
130
  if (detail === 'rest') {
113
131
  const [basePath, queryString] = baseUrl.split('?')