tinacms 0.68.11 → 0.68.14

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.
package/CHANGELOG.md DELETED
@@ -1,1594 +0,0 @@
1
- # tinacms
2
-
3
- ## 0.68.11
4
-
5
- ### Patch Changes
6
-
7
- - 42af73648: Adds more useful error messages from internalClient
8
- - Updated dependencies [ea9c190e8]
9
- - @tinacms/toolkit@0.56.34
10
-
11
- ## 0.68.10
12
-
13
- ### Patch Changes
14
-
15
- - d95b73974: Fix collection list page delete modal
16
- - 7b77fe1b5: Add a default TinaMediaStore for repo-based media
17
- - Updated dependencies [2ef5a1f33]
18
- - Updated dependencies [fb73fb355]
19
- - Updated dependencies [7b77fe1b5]
20
- - Updated dependencies [99a13024d]
21
- - @tinacms/toolkit@0.56.33
22
- - @tinacms/schema-tools@0.0.6
23
- - @tinacms/sharedctx@0.1.1
24
-
25
- All notable changes to `tinacms/packages/tinacms` will be documented in this file.
26
-
27
- Note: For root tinacms changes, please refer to the [CHANGELOG.md](https://github.com/tinacms/tinacms/CHANGELOG.md) specific to root `tinacms`.
28
-
29
- ## 0.68.9
30
-
31
- ### Patch Changes
32
-
33
- - 1f7d3ca3d: Use custom wrapper class for tailwind type plugin
34
- - cceef726e: Fix login ui issue
35
- - Updated dependencies [1f7d3ca3d]
36
- - Updated dependencies [f6cb634c2]
37
- - Updated dependencies [6c17f0160]
38
- - Updated dependencies [cceef726e]
39
- - @tinacms/toolkit@0.56.32
40
- - @tinacms/schema-tools@0.0.5
41
- - @tinacms/sharedctx@0.1.1
42
-
43
- ## 0.68.8
44
-
45
- ### Patch Changes
46
-
47
- - 999f0895a: Set font family on heading elements
48
- - 41be5e7fc: Fixes subitem links to use breadcrumbs
49
- - Updated dependencies [999f0895a]
50
- - @tinacms/toolkit@0.56.31
51
-
52
- ## 0.68.7
53
-
54
- ### Patch Changes
55
-
56
- - aaaa5bb09: Added pagination to the CMS
57
- - e06dbb3ca: Adds `waitForDB` cmd to cli
58
- - Updated dependencies [aaaa5bb09]
59
- - @tinacms/toolkit@0.56.30
60
-
61
- ## 0.68.6
62
-
63
- ### Patch Changes
64
-
65
- - 2cc206b1a: Improve mobile nav behaviour
66
- - 8998df207: fix: update tina client with the current branch from local storage
67
- - Updated dependencies [58a7a00f7]
68
- - Updated dependencies [2cc206b1a]
69
- - Updated dependencies [aaadefd2d]
70
- - @tinacms/toolkit@0.56.29
71
-
72
- ## 0.68.5
73
-
74
- ### Patch Changes
75
-
76
- - 646cad8da: Adds support for using the generated client on the frontend
77
- - f857616f6: Rename sdk to queries
78
- - 6e2ed31a2: Added `isTitle` property to the schema that allows the title to be displayed in the CMS
79
- - Updated dependencies [a196198bd]
80
- - Updated dependencies [57a4a3789]
81
- - Updated dependencies [6e2ed31a2]
82
- - Updated dependencies [ba1499029]
83
- - @tinacms/toolkit@0.56.28
84
- - @tinacms/schema-tools@0.0.4
85
-
86
- ## 0.68.4
87
-
88
- ### Patch Changes
89
-
90
- - 7372f90ca: Adds a new client that can be used on the backend and frontend.
91
- - Updated dependencies [d4f98d0fc]
92
- - Updated dependencies [7e2272442]
93
- - @tinacms/toolkit@0.56.27
94
-
95
- ## 0.68.3
96
-
97
- ### Patch Changes
98
-
99
- - 8b7ee346a: - Display label instead of name for mdx dropdown af306fa
100
- - Fix issue where reset triggered chagnes to the wrong rich-text field 03f6191
101
- - Fix issue where null children in a code block threw an error e454bce
102
- - Updated dependencies [f6f56bcc0]
103
- - Updated dependencies [59d33a74a]
104
- - Updated dependencies [8b7ee346a]
105
- - Updated dependencies [acb38bf9f]
106
- - @tinacms/toolkit@0.56.26
107
-
108
- ## 0.68.2
109
-
110
- ### Patch Changes
111
-
112
- - Updated dependencies [e90647da3]
113
- - @tinacms/toolkit@0.56.25
114
-
115
- ## 0.68.1
116
-
117
- ### Patch Changes
118
-
119
- - 41d666f9a: Styles list page overflow menu, removes unused prop
120
- - e5a1152f2: Fix issue where pages that didnt use `useTina` would get a loading spinner that hangs
121
- - Updated dependencies [41d666f9a]
122
- - @tinacms/toolkit@0.56.24
123
-
124
- ## 0.68.0
125
-
126
- ### Minor Changes
127
-
128
- - 6a6f137ae: # Simplify GraphQL API
129
-
130
- ## `schema` must be supplied to the `<TinaCMS>` component
131
-
132
- Previously the `.tina/schema.ts` was only used by the Tina CLI to generate the GraphQL API. However it's now required as a prop to `<TinaCMS>`. This allows you to provide runtime logic in the `ui` property of field definitions. See the documentation on "Extending Tina" for examples.
133
-
134
- ## The GraphQL API has been simplified
135
-
136
- ### `get<collection name>` is now just the collection name
137
-
138
- ```graphql
139
- # old
140
- {
141
- getPostDocument(relativePath: $relativePath) { ... }
142
- }
143
-
144
- # new
145
- {
146
- post(relativePath: $relativePath) { ... }
147
- }
148
- ```
149
-
150
- ### `get<collection name>List` is now `<collection name>Connection`
151
-
152
- The use of the term `connection` is due to our adherence the the [relay cursor spec](https://relay.dev/graphql/connections.htm). We may offer a simplified list field in a future release
153
-
154
- ```graphql
155
- # old
156
- {
157
- getPostList { ... }
158
- }
159
-
160
- # new
161
- {
162
- postConnection { ... }
163
- }
164
- ```
165
-
166
- ### `getCollection` and `getCollections` are now `collection` and `collections`
167
-
168
- ```graphql
169
- # old
170
- {
171
- getCollection(collection: "post") {...}
172
- }
173
- {
174
- getCollections {...}
175
- }
176
-
177
- # new
178
- {
179
- collection(collection: "post") {...}
180
- }
181
- {
182
- collections {...}
183
- }
184
- ```
185
-
186
- ### No more `data` property
187
-
188
- The `data` property was previously where all field definitions could be found. This has been moved on level up:
189
-
190
- ```graphql
191
- # old
192
- {
193
- getPostDocument(relativePath: $relativePath) {
194
- data {
195
- title
196
- }
197
- }
198
- }
199
-
200
- # new
201
- {
202
- post(relativePath: $relativePath) {
203
- title
204
- }
205
- }
206
- ```
207
-
208
- #### The type for documents no longer includes "Document" at the end
209
-
210
- ```graphql
211
- # old
212
- {
213
- getPostDocument(relativePath: $relativePath) {
214
- data {
215
- author {
216
- ... on AuthorDocument {
217
- data {
218
- name
219
- }
220
- }
221
- }
222
- }
223
- }
224
- }
225
-
226
- # new
227
- {
228
- post(relativePath: $relativePath) {
229
- author {
230
- ... on Author {
231
- name
232
- }
233
- }
234
- }
235
- }
236
- ```
237
-
238
- ### Meta fields are now underscored
239
-
240
- Aside from `id`, other metadata is now underscored:
241
-
242
- ```graphql
243
- # old
244
- {
245
- getPostDocument(relativePath: $relativePath) {
246
- sys {
247
- relativePath
248
- }
249
- values
250
- }
251
- }
252
-
253
- # new
254
- {
255
- post(relativePath: $relativePath) {
256
- _sys {
257
- relativePath
258
- }
259
- _values
260
- }
261
- }
262
- ```
263
-
264
- ### `dataJSON` is gone
265
-
266
- This is identical to `_values`
267
-
268
- ### `form` is gone
269
-
270
- `form` was used internally to generate forms for the given document, however that's now handled by providing your `schema` to `<TinaCMS>`.
271
-
272
- ### `getDocumentList` is gone
273
-
274
- It's no longer possible to query all documents at once, you can query for collection documents via the `collection` query:
275
-
276
- ```graphql
277
- {
278
- collection {
279
- documents {
280
- edges {
281
- node {...}
282
- }
283
- }
284
- }
285
- }
286
- ```
287
-
288
- ### Patch Changes
289
-
290
- - Updated dependencies [6a6f137ae]
291
- - @tinacms/toolkit@0.56.23
292
-
293
- ## 0.67.4
294
-
295
- ### Patch Changes
296
-
297
- - 168f6cc6e: Update delete modal header
298
- - 2a6060138: Fix url parsing issue when a branch name contained a `/`
299
- - 3af3d6787: Fix issues with finding the template for multitemplate collections
300
- - Updated dependencies [bf5fe0074]
301
- - @tinacms/toolkit@0.56.22
302
-
303
- ## 0.67.3
304
-
305
- ### Patch Changes
306
-
307
- - Updated dependencies [d37562999]
308
- - @tinacms/toolkit@0.56.21
309
-
310
- ## 0.67.2
311
-
312
- ### Patch Changes
313
-
314
- - 40afac061: updated @headlessui/react
315
- - Updated dependencies [40afac061]
316
- - @tinacms/toolkit@0.56.20
317
-
318
- ## 0.67.1
319
-
320
- ### Patch Changes
321
-
322
- - 921709a7e: Adds validation to the schema instead of only using typescript types
323
- - 3e2d9e43a: Adds new GraphQL `deleteDocument` mutation and logic
324
- - Updated dependencies [921709a7e]
325
- - @tinacms/schema-tools@0.0.3
326
-
327
- ## 0.67.0
328
-
329
- ### Minor Changes
330
-
331
- - 86651039b: Updates to the way forms are generated in contextual editing. This lays the groundwork for
332
- future updates but doesn't offer new behavior yet. It does come with a small breaking change:
333
-
334
- [BREAKING]: The `id` of forms is now the actual document `path`. Previously this was the name of the GraphQL query node (eg. `getPostDocument`).
335
- If you're using the [`formifyCallback`](https://tina.io/docs/advanced/customizing-forms/#customizing-a-form) prop to create global forms, you'll probably need to update the callback to check for the appropriate id.
336
-
337
- Eg. `formConfig.id === 'getSiteNavsDocument'` should be something like `formConfig.id === 'content/navs/mynav.md'`
338
-
339
- If you're experiencing any issues with contextual editing, you can disable this flag for now by specifying `cms.flags.set('use-unstable-formify', false)`.
340
-
341
- ## 0.66.10
342
-
343
- ### Patch Changes
344
-
345
- - 39a8c4f7d: Fix issue with unstableFormify where `Document` interface fields were not being formified properly
346
- - ec28a129b: Update to tina admin to use the frontend schema
347
- - a28b787c5: With the rich-text editor, inserting a soft-break (`shift+enter`), this will now result in a `<br>` tag being inserted. Note that this will save the markdown with a backslash to indicate line break (instead of multiple empty spaces):
348
-
349
- ```markdown
350
- 123 Abc St\
351
- Charlottetown, PEI
352
- ```
353
-
354
- - 93363dfc2: Prevent error on reset when nested blocks have changed in unstable formify hook
355
- - abf25c673: The schema can now to used on the frontend (optional for now but will be the main path moving forward).
356
-
357
- ### How to migrate.
358
-
359
- If you gone though the `tinacms init` process there should be a file called `.tina/components/TinaProvider`. In that file you can import the schema from `schema.ts` and add it to the TinaCMS wrapper component.
360
-
361
- ```tsx
362
- import TinaCMS from 'tinacms'
363
- import schema, { tinaConfig } from '../schema.ts'
364
-
365
- // Importing the TinaProvider directly into your page will cause Tina to be added to the production bundle.
366
- // Instead, import the tina/provider/index default export to have it dynamially imported in edit-moode
367
- /**
368
- *
369
- * @private Do not import this directly, please import the dynamic provider instead
370
- */
371
- const TinaProvider = ({ children }) => {
372
- return (
373
- <TinaCMS {...tinaConfig} schema={schema}>
374
- {children}
375
- </TinaCMS>
376
- )
377
- }
378
-
379
- export default TinaProvider
380
- ```
381
-
382
- - 591640db0: Fixes a bug with `breadcrumbs` to account for subfolders (instead of just the `filename`) and allows Documents to be created and updated within subfolders.
383
-
384
- Before this fix, `breadcrumbs` was only the `basename` of the file minus the `extension`. So `my-folder-a/my-folder-b/my-file.md` would have `breadcrumbs` of `['my-file']`. With this change, `breadcrumbs` will be `['my-folder-a','my-folder-b','my-file']` (leaving out the `content/<collection>`).
385
-
386
- - 875779ac6: Don't attempt to formify nodes which don't have data fields (ie. ...on Node)
387
- - e8b0de1f7: Add `parentTypename` to fields to allow us to disambiguate between fields which have the same field names but different types. Example, an event from field name of `blocks.0.title` could belong to a `Cta` block or a `Hero` block, both of which have a `title` field.
388
- - Updated dependencies [429d8e93e]
389
- - Updated dependencies [6c517b5da]
390
- - Updated dependencies [e81cf8867]
391
- - Updated dependencies [abf25c673]
392
- - Updated dependencies [801f39f62]
393
- - Updated dependencies [0e270d878]
394
- - Updated dependencies [e8b0de1f7]
395
- - @tinacms/sharedctx@0.1.1
396
- - @tinacms/toolkit@0.56.19
397
- - @tinacms/schema-tools@0.0.2
398
-
399
- ## 0.66.9
400
-
401
- ### Patch Changes
402
-
403
- - 91d5a6073: Allow "." in file names
404
- - 11d55f441: Add experimental useGraphQLForms hook
405
- - f41bd62ea: Ensure client-side Tina code only runs on the browser. Without this check, we'd see a server/client mismatch like:
406
-
407
- ```
408
- warning.js:33 Warning: Expected server HTML to contain a matching <div> in <body>.
409
- ```
410
-
411
- - Updated dependencies [e9a0c82cf]
412
- - Updated dependencies [d4fdeaa9f]
413
- - Updated dependencies [ed85f2594]
414
- - Updated dependencies [d86e515ba]
415
- - Updated dependencies [db0dab1d4]
416
- - @tinacms/toolkit@0.56.18
417
-
418
- ## 0.66.8
419
-
420
- ### Patch Changes
421
-
422
- - 4923a2d66: Checks isAuthenticated() before making requests to the GraphQL client
423
- - Updated dependencies [106549814]
424
- - Updated dependencies [4923a2d66]
425
- - Updated dependencies [a07ff39bb]
426
- - @tinacms/toolkit@0.56.17
427
-
428
- ## 0.66.7
429
-
430
- ### Patch Changes
431
-
432
- - bfada9a09: Used success messaging when creating/updating a Document in the CMS
433
-
434
- ## 0.66.6
435
-
436
- ### Patch Changes
437
-
438
- - becff2a0b: Adds define schema to the `tinacms` package (instead of `@tinacms/cli`. This is done in preparation of the extending tina work)
439
- - ae1a5a58f: Sets `tina-admin` to default to `true`
440
- - 3ed4c8727: Add flag for experimental new formify logic
441
- - 5535a9970: Switches to using HashRouter for Admin
442
- - 3ff1de06a: Upgrade to Tailwind 3
443
- - fbdb7be01: Adds a defineConfig function to allow type hints for the tinacms config
444
- - 24f8b057f: Handles errors better in the CMS
445
- - Updated dependencies [ae1a5a58f]
446
- - Updated dependencies [5535a9970]
447
- - Updated dependencies [3ff1de06a]
448
- - Updated dependencies [022ccd389]
449
- - Updated dependencies [24f8b057f]
450
- - @tinacms/toolkit@0.56.16
451
- - @tinacms/sharedctx@0.1.0
452
-
453
- ## 0.66.5
454
-
455
- ### Patch Changes
456
-
457
- - 43c834565: Adds an activity indicator throughout Admin
458
- - 53a4550db: Allows RouteMapping to be dynamically imported
459
- - 731451bee: Adjust the JWT token refresh logic to refresh tokens _before_ they expire.
460
- - e102d7438: Updated auth modal to use toolkit button components
461
- - Updated dependencies [43c834565]
462
- - @tinacms/toolkit@0.56.15
463
-
464
- ## 0.66.4
465
-
466
- ### Patch Changes
467
-
468
- - cc5c8431d: Remove console.log
469
- - Updated dependencies [af9f6c2c2]
470
- - Updated dependencies [2e14cda5e]
471
- - Updated dependencies [3d4c52a19]
472
- - @tinacms/toolkit@0.56.14
473
-
474
- ## 0.66.3
475
-
476
- ### Patch Changes
477
-
478
- - Updated dependencies [e41b709ce]
479
- - @tinacms/toolkit@0.56.13
480
-
481
- ## 0.66.2
482
-
483
- ### Patch Changes
484
-
485
- - 102628c7f: Fixes admin page wrapper scrolling
486
- - 55cb0c5ec: Updates the relativePath field for clarity
487
- - 9e77273d2: use collection name as fallback for label
488
- - Updated dependencies [8c18edd5c]
489
- - Updated dependencies [0773f6486]
490
- - Updated dependencies [d8cd60f65]
491
- - Updated dependencies [9e77273d2]
492
- - Updated dependencies [63a74aece]
493
- - @tinacms/toolkit@0.56.12
494
-
495
- ## 0.66.1
496
-
497
- ### Patch Changes
498
-
499
- - 3bba1817d: Integrates Chrome Components with TinaAdmin
500
- - Updated dependencies [3bba1817d]
501
- - Updated dependencies [415c03d25]
502
- - @tinacms/toolkit@0.56.11
503
- - @tinacms/sharedctx@0.1.0
504
-
505
- ## 0.66.0
506
-
507
- ### Minor Changes
508
-
509
- - d6f46a9f9: fix: When passing in queries into the root TinaCMS container, don't overwrite the data prop on an empty query
510
-
511
- ### Patch Changes
512
-
513
- - Updated dependencies [37286858e]
514
- - @tinacms/toolkit@0.56.10
515
-
516
- ## 0.65.3
517
-
518
- ### Patch Changes
519
-
520
- - 0c4456c11: fix: Send update to useTina hook on the initial isLoading change
521
-
522
- ## 0.65.2
523
-
524
- ### Patch Changes
525
-
526
- - a9b385b01: Fix mutation string for document creation
527
-
528
- ## 0.65.1
529
-
530
- ### Patch Changes
531
-
532
- - 68284198a: fix: use user-specific document creator callback
533
- - ccf4dcbd4: chore: Export low-level data provider from "tinacms", for the playground and other sandboz environments
534
- - f2431c031: Fix type for code_block TinaMarkdown element
535
-
536
- ## 0.65.0
537
-
538
- ### Minor Changes
539
-
540
- - 792f47251: useTina hook for page-level form registration
541
-
542
- ### Patch Changes
543
-
544
- - 6a50a1368: Updates the look and feel of the Tina Sidebar
545
- - 239382619: Introduces TinaAdminApi and consolidates types
546
- - Updated dependencies [8ad8f03fd]
547
- - Updated dependencies [6a50a1368]
548
- - Updated dependencies [792f47251]
549
- - @tinacms/toolkit@0.56.9
550
- - @tinacms/sharedctx@0.1.0
551
-
552
- ## 0.64.2
553
-
554
- ### Patch Changes
555
-
556
- - Updated dependencies [7006b38ea]
557
- - @tinacms/toolkit@0.56.8
558
-
559
- ## 0.64.1
560
-
561
- ### Patch Changes
562
-
563
- - 28010a026: Adds tailwind styles to Admin Layout
564
- - Updated dependencies [e8ca82899]
565
- - @tinacms/toolkit@0.56.7
566
-
567
- ## 0.64.0
568
-
569
- ### Minor Changes
570
-
571
- - 4a3990c7e: Cloudinary media store now serves images over `https` by default. This can now be configured though the handler provided.
572
-
573
- To revert to the old behavior:
574
-
575
- ```ts
576
- export default createMediaHandler(
577
- {
578
- // ...
579
- },
580
- {
581
- useHttps: false,
582
- }
583
- )
584
- ```
585
-
586
- The default for `useHttps` is `true`
587
-
588
- ## 0.63.0
589
-
590
- ### Minor Changes
591
-
592
- - 3897ec5d9: Replace `branch`, `clientId`, `isLocalClient` props with single `apiURL`. When working locally, this should be `http://localhost:4001/graphql`. For Tina Cloud, use `https://content.tinajs.io/content/<my-client-id>/github/<my-branch>`
593
-
594
- ```tsx
595
- // _app.tsx
596
- // ...
597
- <TinaCMS apiURL={process.env.NEXT_PUBLIC_TINA_API_URL} {...pageProps}>
598
- {livePageProps => <Component {...livePageProps} />}
599
- </TinaCMS>
600
- ```
601
-
602
- DEPRECATION NOTICE: `branch`, `clientId`, `isLocalClient` props will be deprecated in the future
603
-
604
- ### Patch Changes
605
-
606
- - 96e4a77e2: Fixed types
607
- - b5c22503a: Changes messaging on login page for TinaAdmin when in local-mode
608
- - Updated dependencies [60f939f34]
609
- - @tinacms/toolkit@0.56.6
610
-
611
- ## 0.62.0
612
-
613
- ### Minor Changes
614
-
615
- - 70da62fe8: deprecated the use of `getStaticPropsForTina`
616
-
617
- ### Patch Changes
618
-
619
- - 0afa75df1: 2342 - [TinaAdmin] Truncates the `filename` column for the Document List View
620
- - 7dafce89d: Fixed issue where content creator was invalid
621
- - 3de8c6165: Enabled branch creation in branch switcher
622
- - fee183f8f: add "switch to default branch" recover option to error boundary
623
- - 5c070a83f: feat: Add UI banner for when in localMode
624
- - Updated dependencies [ddf81a4fd]
625
- - Updated dependencies [20260a82d]
626
- - Updated dependencies [0370147fb]
627
- - Updated dependencies [3de8c6165]
628
- - Updated dependencies [2eaad97bf]
629
- - Updated dependencies [5c070a83f]
630
- - @tinacms/toolkit@0.56.5
631
-
632
- ## 0.61.1
633
-
634
- ### Patch Changes
635
-
636
- - Updated dependencies [2c7718636]
637
- - @tinacms/toolkit@0.56.4
638
-
639
- ## 0.61.0
640
-
641
- ### Minor Changes
642
-
643
- - 229feda1d: add .nvmrc file for setting preferred node version
644
-
645
- ## 0.60.3
646
-
647
- ### Patch Changes
648
-
649
- - 4adaf15af: Fix types which weren't included in previous patch
650
-
651
- ## 0.60.2
652
-
653
- ### Patch Changes
654
-
655
- - 816271d03: Ensure login/logout pages work when admin flag is disabled
656
-
657
- ## 0.60.1
658
-
659
- ### Patch Changes
660
-
661
- - Updated dependencies [4700d7ae4]
662
- - @tinacms/toolkit@0.56.3
663
-
664
- ## 0.60.0
665
-
666
- ### Minor Changes
667
-
668
- - 75974d0a4: Updates the tina cloud client to do id_token & access_token refreshes when needed
669
-
670
- ### Patch Changes
671
-
672
- - 88c209b45: Throw when Tina Cloud responds with non 200 code
673
- - dcdf1ecf0: Updates `react-router` to `v6` for `TinaAdmin`
674
- - 47d126029: Fix support of objects in a list for MDX templates
675
- - Updated dependencies [bc4699d2b]
676
- - @tinacms/toolkit@0.56.2
677
-
678
- ## 0.59.1
679
-
680
- ### Patch Changes
681
-
682
- - ed9d48abc: Swaps starter's old admin for the new one
683
- - f6876d30f: Alter empty sidebar message to be more specific to auto-generating logic
684
- - Updated dependencies [f6876d30f]
685
- - Updated dependencies [92268fc85]
686
- - @tinacms/toolkit@0.56.1
687
-
688
- ## 0.59.0
689
-
690
- ### Minor Changes
691
-
692
- - df3030990: Add basic branch switcher
693
-
694
- ### Patch Changes
695
-
696
- - 9ecceb59f: Always include `collection` for TinaAdmin `createDocument()` and `updateDocument()`
697
- - Updated dependencies [df3030990]
698
- - @tinacms/toolkit@0.56.0
699
-
700
- ## 0.58.1
701
-
702
- ### Patch Changes
703
-
704
- - e6995cfcb: Adds README for TinaAdmin
705
- - 60729f60c: Adds a `reference` field
706
- - 19e02829f: Add ability to control plugin layout for global plugins from formify
707
- - Updated dependencies [60729f60c]
708
- - @tinacms/toolkit@0.55.4
709
-
710
- ## 0.58.0
711
-
712
- ### Minor Changes
713
-
714
- - d1ed404ba: Add support for auto-generated SDK for type-safe data fetching
715
-
716
- ### Patch Changes
717
-
718
- - 138ceb8c4: Clean up dependencies
719
- - 0417e3750: Adds RouteMapperPlugin and FormMetaPlugin
720
- - Updated dependencies [138ceb8c4]
721
- - Updated dependencies [0417e3750]
722
- - Updated dependencies [d9f37ea7e]
723
- - @tinacms/toolkit@0.55.3
724
-
725
- ## 0.57.4
726
-
727
- ### Patch Changes
728
-
729
- - 4b7795612: Adds support for collection.templates to TinaAdmin
730
- - a39ddc611: update media store to load only when in edit mode
731
- - 1096fe3e4: Ensure forms unmount properly when `useGraphQLForms` unmounts
732
-
733
- ## 0.57.3
734
-
735
- ### Patch Changes
736
-
737
- - Updated dependencies [2724c48c0]
738
- - @tinacms/toolkit@0.55.2
739
-
740
- ## 0.57.2
741
-
742
- ### Patch Changes
743
-
744
- - 7849c1233: Fix styles on panel
745
-
746
- ## 0.57.1
747
-
748
- ### Patch Changes
749
-
750
- - 9c0d48e09: Fix console errors for mdx editor
751
- - Updated dependencies [9c0d48e09]
752
- - @tinacms/toolkit@0.55.1
753
-
754
- ## 0.57.0
755
-
756
- ### Minor Changes
757
-
758
- - b99baebf1: Add rich-text editor based on mdx, bump React dependency requirement to 16.14
759
-
760
- ### Patch Changes
761
-
762
- - 891623c7c: Adds support for List and Update to TinaAdmin
763
- - d5e3adf37: Adds support for Log In & Log Out to TinaAdmin
764
- - Updated dependencies [b99baebf1]
765
- - @tinacms/toolkit@0.55.0
766
-
767
- ## 0.56.3
768
-
769
- ### Patch Changes
770
-
771
- - 67df49220: Allow dashes in filenames for content creator
772
- - Updated dependencies [b961c7417]
773
- - @tinacms/toolkit@0.54.1
774
-
775
- ## 0.56.2
776
-
777
- ### Patch Changes
778
-
779
- - 84a86358f: Fix bug which reset the form onChange for GraphQL forms
780
-
781
- ## 0.56.1
782
-
783
- ### Patch Changes
784
-
785
- - a05aa61bd: Fix issue where forms weren't being removed when the page unmounted
786
- - @tinacms/toolkit@0.54.0
787
-
788
- ## 0.56.0
789
-
790
- ### Minor Changes
791
-
792
- - c6e2dd69a: Updated Wrapper component so that it can be build without loading the media store
793
- - 3f9cad860: A warning message is added to warn the user if they are using a staticRequest at run time.
794
-
795
- ### Patch Changes
796
-
797
- - 2908f8176: Fixes an issue where nested reference fields weren't updated properly when their values changed.
798
- - 08ef183a0: Allow tina.io URLs to be supplied as a a prop:
799
-
800
- ```tsx
801
- <TinaEditProvider
802
- editMode={
803
- <TinaCMS
804
- branch="main"
805
- clientId={NEXT_PUBLIC_TINA_CLIENT_ID}
806
- tinaioConfig={{
807
- baseUrl: "some-base.io"
808
- }}
809
- //...
810
- ```
811
-
812
- Or just the identity/content URLs:
813
-
814
- ```tsx
815
- <TinaEditProvider
816
- editMode={
817
- <TinaCMS
818
- branch="main"
819
- clientId={NEXT_PUBLIC_TINA_CLIENT_ID}
820
- tinaioConfig={{
821
- identityApiUrl: "https://some-base.io"
822
- // AND/OR
823
- contentApiUrl: "https://content.some-base.io"
824
- }}
825
- //...
826
- ```
827
-
828
- - Updated dependencies [9213d5608]
829
- - Updated dependencies [b59f23295]
830
- - Updated dependencies [a419056b6]
831
- - Updated dependencies [ded8dfbee]
832
- - Updated dependencies [5df9fe543]
833
- - Updated dependencies [9d68b058f]
834
- - Updated dependencies [91cebe5bc]
835
- - @tinacms/toolkit@0.54.0
836
-
837
- ## 0.55.2
838
-
839
- ### Patch Changes
840
-
841
- - Updated dependencies [7b149a4e7]
842
- - Updated dependencies [906d72c50]
843
- - @tinacms/toolkit@0.53.0
844
-
845
- ## 0.55.1
846
-
847
- ### Patch Changes
848
-
849
- - 9b27192fe: Build packages with new scripting, which includes preliminary support for ES modules.
850
- - Updated dependencies [9b27192fe]
851
- - @tinacms/toolkit@0.52.3
852
-
853
- ## 0.55.0
854
-
855
- ### Minor Changes
856
-
857
- - d0e896561: Provide better error boundary message and visual affordances to user in <ErrorBoundary />.
858
- - 27c1fd382: Adds a close button to the Tina Cloud auth model so a user is not suck in edit mode.
859
-
860
- ## 0.54.4
861
-
862
- ### Patch Changes
863
-
864
- - Updated dependencies [6b1cbf916]
865
- - @tinacms/toolkit@0.52.2
866
-
867
- ## 0.54.3
868
-
869
- ### Patch Changes
870
-
871
- - Updated dependencies [4de977f63]
872
- - @tinacms/toolkit@0.52.1
873
-
874
- ## 0.54.2
875
-
876
- ### Patch Changes
877
-
878
- - d1ef2545f: Ensure `undefined` values aren't passed back from getStaticPropsForTina
879
-
880
- ## 0.54.1
881
-
882
- ### Patch Changes
883
-
884
- - Updated dependencies [b4f5e973f]
885
- - @tinacms/toolkit@0.52.0
886
-
887
- ## 0.54.0
888
-
889
- ### Minor Changes
890
-
891
- - 3af2c075c: Loading state now resets in useGraphqlForms
892
- - 515fc3ffd: Don't treat cloud client with missing client-id as local client
893
-
894
- ### Patch Changes
895
-
896
- - Updated dependencies [634524925]
897
- - @tinacms/toolkit@0.51.0
898
-
899
- ## 0.53.0
900
-
901
- ### Minor Changes
902
-
903
- - 1b8bb5d0f: fix: don't throw error on missing client id
904
-
905
- ### Patch Changes
906
-
907
- - f863d8be8: Fixes an issue where new documents returned a 404 when on a hosted deployement. Instead, `getStaticPropsForTina` will catch and return an empty object for the data key. This allows us to replace it with real data client-side.
908
-
909
- ## 0.52.0
910
-
911
- ### Minor Changes
912
-
913
- - 8a20437c: Expose a createGlobalForm function in formifyCallback that creates a screen plugin
914
-
915
- ### Patch Changes
916
-
917
- - d31df43d: Handles situations where `currentFields` is not an Array
918
- - 271a72d7: Use collection label (defined in schema.ts) as form label
919
-
920
- ## 0.51.0
921
-
922
- ### Minor Changes
923
-
924
- - 6dfbfed0: Added variables to useGraphqlForms dependencies in order to update data when variables change
925
-
926
- ### Patch Changes
927
-
928
- - Updated dependencies [e074d555]
929
- - @tinacms/toolkit@0.50.1
930
-
931
- ## 0.50.1
932
-
933
- ### Patch Changes
934
-
935
- - 3f05aad1: Fix race condition where `values` was taking longer to update in React state, making the data syncing run too early
936
- - 76e3a8a7: Properly uses formifyCallback and documentCreatorCallback
937
-
938
- ## 0.50.0
939
-
940
- ### Minor Changes
941
-
942
- - 7f3c8c1a: # 🔧 Changes coming to TinaCMS ⚙️
943
-
944
- 👋 You may have noticed we've been hard at-work lately building out a more opinionated approach to TinaCMS. To that end, we've settled around a few key points we'd like to announce. To see the work in progress, check out the [main](https://github.com/tinacms/tinacms/tree/main) branch, which will become the primary branch soon.
945
-
946
- ## Consolidating @tinacms packages in to @tinacms/toolkit
947
-
948
- By nature, Tina relies heavily on React context, and the dependency mismatches from over-modularizing our toolkit has led to many bugs related to missing context. To fix this, we'll be consolidating nearly every package in the @tinacms scope to a single package called `@tinacms/toolkit`
949
-
950
- We'll also be rolling out esm support as it's now much easier to address build improvements
951
-
952
- ## A more focused tinacms package
953
-
954
- The `tinacms` package now comes baked-in with APIs for working with the TinaCMS GraphQL API. Because `@tinacms/toolkit` now encompasses everything you'd need to build your own CMS integration, we're repurposing the `tinacms` package to more accurately reflect the "batteries-included" approach.
955
-
956
- If you haven't been introduced, the GraphQL API is a Git-backed CMS which we'll be leaning into more in the future. With a generous free tier and direct syncing with Github its something we're really excited to push forward. Sign up for free here
957
- Note: tinacms still exports the same APIs, but we'll gradually start moving the backend-agnostic tools to @tinacms/toolkit.
958
-
959
- ## Consolidating the tina-graphql-gateway repo
960
-
961
- The tina-graphql-gateway repo will be absorbed into this one. If you've been working with our GraphQL APIs you'll need to follow our migration guide.
962
-
963
- ## Moving from Lerna to Yarn PNP
964
-
965
- We've had success with Yarn 2 and PNP in other monorepos, if you're a contributor you'll notice some updates to the DX, which should hopefully result in a smoother experience.
966
-
967
- ## FAQ
968
-
969
- ### What about other backends?
970
-
971
- The `@tinacms/toolkit` isn't going anywhere. And if you're using packages like `react-tinacms-strapi` or r`eact-tinacms-github` with success, that won't change much, they'll just be powered by `@tinacms/toolkit` under the hood.
972
-
973
- ### Do I need to do anything?
974
-
975
- We'll be bumping all packages to `0.50.0` to reflect the changes. If you're using @tincams scoped packages those won't receive the upgrade. Unscoped packages like `react-tinacms-editor` will be upgraded, and should be bumped to 0.50.0 as well.
976
- When we move to `1.0.0` we'll be pushing internal APIs to `@tinacms/toolkit`, so that's the long-term location of
977
-
978
- ### Will you continue to patch older versions?
979
-
980
- We'll continue to make security patches, however major bug fixes will likely not see any updates. Keep in mind that `@tinacms/toolkit` will continue to be developed.
981
-
982
- ### Patch Changes
983
-
984
- - 434d61d4: Use the default import from 'tinacms' to set up the Tina context:
985
-
986
- ```jsx
987
- // pages/_app.js
988
- import TinaCMS from 'tinacms'
989
-
990
- const App = ({ Component, pageProps }) => {
991
- return (
992
- <TinaCMS
993
- // Required: The query from your `getStaticProps` request
994
- query={pageProps.query}
995
- // Required: The variables from your `getStaticProps` request
996
- variables={pageProps.variables} // Variables used in your query
997
- // Required: The data from your `getStaticProps` request
998
- data={pageProps.data}
999
- // Optional: Set to true when working with the local API
1000
- isLocalClient={true}
1001
- // Optional: When using Tina Cloud, specify the git branch
1002
- branch="main"
1003
- // Optional: Your identifier when connecting to Tina Cloud
1004
- clientId="<some-id-from-tina-cloud>"
1005
- // Optional: A callback for altering the CMS object if needed
1006
- cmsCallback={cms => {}}
1007
- // Optional: A callback for altering the form generation if needed
1008
- formifyCallback={args => {}}
1009
- // Optional: A callback for altering the document creator plugin
1010
- documentCreatorCallback={args => {}}
1011
- >
1012
- {livePageProps => <Component {...livePageProps} />}
1013
- </TinaCMS>
1014
- )
1015
- }
1016
-
1017
- export default App
1018
- ```
1019
-
1020
- To load TinaCMS dynamically, use the EditState context:
1021
-
1022
- ```jsx
1023
- // pages/_app.js
1024
- import dynamic from 'next/dynamic'
1025
- import { TinaEditProvider } from 'tinacms/dist/edit-state'
1026
- const TinaCMS = dynamic(() => import('tinacms'), { ssr: false })
1027
-
1028
- const App({ Component, pageProps }) {
1029
- return (
1030
- <>
1031
- <TinaEditProvider
1032
- editMode={
1033
- <TinaCMS {...pageProps}>
1034
- {livePageProps => <Component {...livePageProps} />}
1035
- </TinaCMS>
1036
- }
1037
- >
1038
- <Component {...pageProps} />
1039
- </TinaEditProvider>
1040
- </>
1041
- )
1042
- }
1043
-
1044
- export default App
1045
- ```
1046
-
1047
- - Updated dependencies [7f3c8c1a]
1048
- - @tinacms/toolkit@0.44.0
1049
-
1050
- ## 0.4.0
1051
-
1052
- ### Minor Changes
1053
-
1054
- - ab4e388b: Updates where LoadingDots is imported from
1055
- - 7351d92f: # Define schema changes
1056
-
1057
- We're going to be leaning on a more _primitive_ concept of how types are defined with Tina, and in doing so will be introducing some breaking changes to the way schemas are defined. Read the detailed [RFC discussion](https://github.com/tinacms/rfcs/pull/18) for more on this topic, specifically the [latter portions](https://github.com/tinacms/rfcs/pull/18#issuecomment-805400313) of the discussion.
1058
-
1059
- ## Collections now accept a `fields` _or_ `templates` property
1060
-
1061
- You can now provide `fields` instead of `templates` for your collection, doing so will result in a more straightforward schema definition:
1062
-
1063
- ```js
1064
- {
1065
- collections: [
1066
- {
1067
- name: 'post',
1068
- label: 'Post',
1069
- path: 'content/posts',
1070
- fields: [
1071
- {
1072
- name: 'title',
1073
- label: 'Title',
1074
- type: 'string', // read on below to learn more about _type_ changes
1075
- },
1076
- ],
1077
- // defining `fields` and `templates` would result in a compilation error
1078
- },
1079
- ]
1080
- }
1081
- ```
1082
-
1083
- **Why?**
1084
-
1085
- Previously, a collection could define multiple templates, the ambiguity introduced with this feature meant that your documents needed a `_template` field on them so we'd know which one they belonged to. It also mean having to disambiguate your queries in graphql:
1086
-
1087
- ```graphql
1088
- getPostDocument(relativePage: $relativePath) {
1089
- data {
1090
- ...on Article_Doc_Data {
1091
- title
1092
- }
1093
- }
1094
- }
1095
- ```
1096
-
1097
- Going forward, if you use `fields` on a collection, you can omit the `_template` key and simplify your query:
1098
-
1099
- ```graphql
1100
- getPostDocument(relativePage: $relativePath) {
1101
- data {
1102
- title
1103
- }
1104
- }
1105
- ```
1106
-
1107
- ## `type` changes
1108
-
1109
- Types will look a little bit different, and are meant to reflect the lowest form of the shape they can represent. Moving forward, the `ui` field will represent the UI portion of what you might expect. For a blog post "description" field, you'd define it like this:
1110
-
1111
- ```js
1112
- {
1113
- type: "string",
1114
- label: "Description",
1115
- name: "description",
1116
- }
1117
- ```
1118
-
1119
- By default `string` will use the `text` field, but you can change that by specifying the `component`:
1120
-
1121
- ```js
1122
- {
1123
- type: "string",
1124
- label: "Description",
1125
- name: "description",
1126
- ui: {
1127
- component: "textarea"
1128
- }
1129
- }
1130
- ```
1131
-
1132
- For the most part, the UI properties are added to the field and adhere to the existing capabilities of Tina's core [field plugins](https://tina.io/docs/fields/). But there's nothing stopping you from providing your own components -- just be sure to register those with the CMS object on the frontend:
1133
-
1134
- ```js
1135
- {
1136
- type: "string",
1137
- label: "Description",
1138
- name: "description",
1139
- ui: {
1140
- component: "myMapField"
1141
- someAdditionalMapConfig: 'some-value'
1142
- }
1143
- }
1144
- ```
1145
-
1146
- [Register](https://tina.io/docs/fields/custom-fields/#registering-the-plugin) your `myMapField` with Tina:
1147
-
1148
- ```js
1149
- cms.fields.add({
1150
- name: 'myMapField',
1151
- Component: MapPicker,
1152
- })
1153
- ```
1154
-
1155
- ### One important gotcha
1156
-
1157
- Every property in the `defineSchema` API must be serlializable. Meaning functions will not work. For example, there's no way to define a `validate` or `parse` function at this level. However, you can either use the [formify](https://tina.io/docs/tina-cloud/client/#formify) API to get access to the Tina form, or provide your own logic by specifying a plugin of your choice:
1158
-
1159
- ```js
1160
- {
1161
- type: "string",
1162
- label: "Description",
1163
- name: "description",
1164
- ui: {
1165
- component: "myText"
1166
- }
1167
- }
1168
- ```
1169
-
1170
- And then when you register the plugin, provide your custom logic here:
1171
-
1172
- ```js
1173
- import { TextFieldPlugin } from 'tinacms'
1174
-
1175
- // ...
1176
-
1177
- cms.fields.add({
1178
- ...TextFieldPlugin, // spread existing text plugin
1179
- name: 'myText',
1180
- validate: value => {
1181
- someValidationLogic(value)
1182
- },
1183
- })
1184
- ```
1185
-
1186
- **Why?**
1187
-
1188
- The reality is that under the hood this has made no difference to the backend, so we're removing it as a point of friction. Instead, `type` is the true definition of the field's _shape_, while `ui` can be used for customizing the look and behavior of the field's UI.
1189
-
1190
- ## Defensive coding in Tina
1191
-
1192
- When working with GraphQL, there are 2 reasons a property may not be present.
1193
-
1194
- 1. The data is not a required property. That is to say, if I have a blog post document, and "category" is an optional field, we'll need to make sure we factor that into how we render our page:
1195
-
1196
- ```tsx
1197
- const MyPage = props => {
1198
- return (
1199
- <>
1200
- <h2>{props.getPostDocument.data.title}</h2>
1201
- <MyCategoryComponent>
1202
- {props.getPostDocument.data?.category}
1203
- </MyCategoryComponent>
1204
- </>
1205
- )
1206
- }
1207
- ```
1208
-
1209
- 2. The query did not ask for that field:
1210
-
1211
- ```graphql
1212
- {
1213
- getPostDocument {
1214
- data {
1215
- title
1216
- }
1217
- }
1218
- }
1219
- ```
1220
-
1221
- But with Tina, there's a 3rd scenario: the document may be in an invalid state. Meaning, we could mark the field as `required` _and_ query for the appropriate field, and _still_ not have the expected shape of data. Due to the contextual nature of Tina, it's very common to be in an intermediate state, where your data is incomplete simply because you're still working on it. Most APIs would throw an error when a document is in an invalid state. Or, more likely, you couldn't even request it.
1222
-
1223
- ## Undefined list fields will return `null`
1224
-
1225
- Previously an listable field which wasn't defined in the document was treated as an emptry array. So for example:
1226
-
1227
- ```md
1228
- ---
1229
- title: 'Hello, World'
1230
- categories:
1231
- - sports
1232
- - movies
1233
- ---
1234
- ```
1235
-
1236
- The responsee would be `categories: ['sports', 'movies']`. If you omit the items, but kept the empty array:
1237
-
1238
- ```md
1239
- ---
1240
- title: 'Hello, World'
1241
- categories: []
1242
- ---
1243
- ```
1244
-
1245
- The responsee would be `categories: []`. If you omit the field entirely:
1246
-
1247
- ```md
1248
- ---
1249
- title: 'Hello, World'
1250
- ---
1251
- ```
1252
-
1253
- The response will be `categories: null`. Previously this would have been `[]`, which was incorrect.
1254
-
1255
- ## For a listable item which is `required: true` you _must_ provide a `ui.defaultItem` property
1256
-
1257
- ### Why?
1258
-
1259
- It's possible for Tina's editing capabilities to introduce an invalid state during edits to list items. Imagine the scenario where you are iterating through an array of objects, and each object has a categories array on it we'd like to render:
1260
-
1261
- ```tsx
1262
- const MyPage = props => {
1263
- return props.blocks.map(block => {
1264
- return (
1265
- <>
1266
- <h2>{block.categories.split(',')}</h2>
1267
- </>
1268
- )
1269
- })
1270
- }
1271
- ```
1272
-
1273
- For a new item, `categories` will be null, so we'll get an error. This only happens when you're editing your page with Tina, so it's not a production-facing issue.
1274
-
1275
- ## Every `type` can be a list
1276
-
1277
- Previously, we had a `list` field, which allowed you to supply a `field` property. Instead, _every_ primitive type can be represented as a list:
1278
-
1279
- ```js
1280
- {
1281
- type: "string",
1282
- label: "Categories",
1283
- name: "categories",
1284
- list: true
1285
- }
1286
- ```
1287
-
1288
- Additionally, enumerable lists and selects are inferred from the `options` property. The following example is represented by a `select` field:
1289
-
1290
- ```js
1291
- {
1292
- type: "string",
1293
- label: "Categories",
1294
- name: "categories",
1295
- options: ["fitness", "movies", "music"]
1296
- }
1297
- ```
1298
-
1299
- While this, is a `checkbox` field
1300
-
1301
- ```js
1302
- {
1303
- type: "string",
1304
- label: "Categories",
1305
- name: "categories"
1306
- list: true,
1307
- options: ["fitness", "movies", "music"]
1308
- }
1309
- ```
1310
-
1311
- > Note we may introduce an `enum` type, but haven't discussed it thoroughly
1312
-
1313
- ## Introducing the `object` type
1314
-
1315
- Tina currently represents the concept of an _object_ in two ways: a `group` (and `group-list`), which is a uniform collection of fields; and `blocks`, which is a polymporphic collection. Moving forward, we'll be introducing a more comporehensive type, which envelopes the behavior of both `group` and `blocks`, and since _every_ field can be a `list`, this also makes `group-list` redundant.
1316
-
1317
- > Note: we've previously assumed that `blocks` usage would _always_ be as an array. We'll be keeping that assumption with the `blocks` type for compatibility, but `object` will allow for non-array polymorphic objects.
1318
-
1319
- ### Defining an `object` type
1320
-
1321
- An `object` type takes either a `fields` _or_ `templates` property (just like the `collections` definition). If you supply `fields`, you'll end up with what is essentially a `group` item. And if you say `list: true`, you'll have what used to be a `group-list` definition.
1322
-
1323
- Likewise, if you supply a `templates` field and `list: true`, you'll get the same API as `blocks`. However you can also say `list: false` (or omit it entirely), and you'll have a polymorphic object which is _not_ an array.
1324
-
1325
- This is identical to the current `blocks` definition:
1326
-
1327
- ```js
1328
- {
1329
- type: "object",
1330
- label: "Page Sections",
1331
- name: "pageSections",
1332
- list: true,
1333
- templates: [{
1334
- label: "Hero",
1335
- name: "hero",
1336
- fields: [{
1337
- label: "Title",
1338
- name: "title",
1339
- type: "string"
1340
- }]
1341
- }]
1342
- }
1343
- ```
1344
-
1345
- And here is one for `group`:
1346
-
1347
- ```js
1348
- {
1349
- type: "object",
1350
- label: "Hero",
1351
- name: "hero",
1352
- fields: [{
1353
- label: "Title",
1354
- name: "title",
1355
- type: "string"
1356
- }]
1357
- }
1358
- ```
1359
-
1360
- ## `dataJSON` field
1361
-
1362
- You can now request `dataJSON` for the entire data object as a single query key. This is great for more tedius queries like theme files where including each item in the result is cumbersome.
1363
-
1364
- > Note there is no typescript help for this feature for now
1365
-
1366
- ```graphql
1367
- getThemeDocument(relativePath: $relativePath) {
1368
- dataJSON
1369
- }
1370
- ```
1371
-
1372
- ```json
1373
- {
1374
- "getThemeDocument": {
1375
- "dataJSON": {
1376
- "every": "field",
1377
- "in": {
1378
- "the": "document"
1379
- },
1380
- "is": "returned"
1381
- }
1382
- }
1383
- }
1384
- ```
1385
-
1386
- ## Lists queries will now adhere to the GraphQL connection spec
1387
-
1388
- [Read the spec](https://relay.dev/graphql/connections.htm)
1389
-
1390
- Previously, lists would return a simple array of items:
1391
-
1392
- ```graphql
1393
- {
1394
- getPostsList {
1395
- id
1396
- }
1397
- }
1398
- ```
1399
-
1400
- Which would result in:
1401
-
1402
- ```json
1403
- {
1404
- "data": {
1405
- "getPostsList": [
1406
- {
1407
- "id": "content/posts/voteForPedro.md"
1408
- }
1409
- ]
1410
- }
1411
- }
1412
- ```
1413
-
1414
- In the new API, you'll need to step through `edges` & `nodes`:
1415
-
1416
- ```graphql
1417
- {
1418
- getPostsList {
1419
- edges {
1420
- node {
1421
- id
1422
- }
1423
- }
1424
- }
1425
- }
1426
- ```
1427
-
1428
- ```json
1429
- {
1430
- "data": {
1431
- "getPostsList": {
1432
- "edges": [
1433
- {
1434
- "node": {
1435
- "id": "content/posts/voteForPedro.md"
1436
- }
1437
- }
1438
- ]
1439
- }
1440
- }
1441
- }
1442
- ```
1443
-
1444
- **Why?**
1445
-
1446
- The GraphQL connection spec opens up a more future-proof structure, allowing us to put more information in to the _connection_ itself like how many results have been returned, and how to request the next page of data.
1447
-
1448
- Read [a detailed explanation](https://graphql.org/learn/pagination/) of how the connection spec provides a richer set of capabilities.
1449
-
1450
- > Note: sorting and filtering is still not supported for list queries.
1451
-
1452
- ## `_body` is no longer included by default
1453
-
1454
- There is instead an `isBody` boolean which can be added to any `string` field
1455
-
1456
- **Why?**
1457
-
1458
- Since markdown files sort of have an implicit "body" to them, we were automatically populating a field which represented the body of your markdown file. This wasn't that useful, and kind of annoying. Instead, just attach `isBody` to the field which you want to represent your markdown "body":
1459
-
1460
- ```js
1461
- {
1462
- collections: [{
1463
- name: "post",
1464
- label: "Post",
1465
- path: "content/posts",
1466
- fields: [
1467
- {
1468
- name: "title",
1469
- label: "Title",
1470
- type: "string"
1471
- }
1472
- {
1473
- name: "myBody",
1474
- label: "My Body",
1475
- type: "string",
1476
- component: 'textarea',
1477
- isBody: true
1478
- }
1479
- ]
1480
- }]
1481
- }
1482
- ```
1483
-
1484
- This would result in a form field called `My Body` getting saved to the body of your markdown file (if you're using markdown):
1485
-
1486
- ```md
1487
- ---
1488
- title: Hello, World!
1489
- ---
1490
-
1491
- This is the body of the file, it's edited through the "My Body" field in your form.
1492
- ```
1493
-
1494
- ## References now point to more than one collection.
1495
-
1496
- Instead of a `collection` property, you must now define a `collections` field, which is an array:
1497
-
1498
- ```js
1499
- {
1500
- type: "reference",
1501
- label: "Author",
1502
- name: "author",
1503
- collections: ["author"]
1504
- }
1505
- ```
1506
-
1507
- ```graphql
1508
- {
1509
- getPostDocument(relativePath: "hello.md") {
1510
- data {
1511
- title
1512
- author {
1513
- ...on Author_Document {
1514
- name
1515
- }
1516
- ...on Post_Document {
1517
- title
1518
- }
1519
- }
1520
- }
1521
- }
1522
- ```
1523
-
1524
- ## Other breaking changes
1525
-
1526
- ### The `template` field on polymorphic objects (formerly _blocks_) is now `_template`
1527
-
1528
- **Old API:**
1529
-
1530
- ```md
1531
- ---
1532
- ---
1533
- myBlocks:
1534
- - template: hero
1535
- title: Hello
1536
- ---
1537
- ```
1538
-
1539
- **New API:**
1540
-
1541
- ```md
1542
- ---
1543
- ---
1544
- myBlocks:
1545
- - \_template: hero
1546
- title: Hello
1547
- ---
1548
- ```
1549
-
1550
- ### `data` `__typename` values have changed
1551
-
1552
- They now include the proper namespace to prevent naming collisions and no longer require `_Doc_Data` suffix. All generated `__typename` properties are going to be slightly different. We weren't fully namespacing fields so it wasn't possible to guarantee that no collisions would occur. The pain felt here will likely be most seen when querying and filtering through blocks. This ensures the stability of this type in the future
1553
-
1554
- ```graphql
1555
- {
1556
- getPageDocument(relativePath: "home.md") {
1557
- data {
1558
- title
1559
- myBlocks {
1560
- ...on Page_Hero_Data { # previously this would have been Hero_Data
1561
- # ...
1562
- }
1563
- }
1564
- }
1565
- }
1566
- ```
1567
-
1568
- ### Patch Changes
1569
-
1570
- - d42e2bcf: Adds number, datetime, and boolean fields back into primitive field generators
1571
- - 95244e14: Early return for query nodes which can't be formified
1572
- - Updated dependencies [7351d92f]
1573
- - tina-graphql-helpers@0.1.2
1574
-
1575
- ## 0.3.0
1576
-
1577
- ### Minor Changes
1578
-
1579
- - 96ee3eb1: Revisited useDocumentCreatorPlugin to improve the UX
1580
-
1581
- ## 0.2.23
1582
-
1583
- ### Patch Changes
1584
-
1585
- - Bump packages to reflect new changest capabilities
1586
- - Updated dependencies [undefined]
1587
- - tina-graphql-helpers@0.1.1
1588
-
1589
- ## 0.2.22
1590
-
1591
- ### Patch Changes
1592
-
1593
- - Updated dependencies [undefined]
1594
- - tina-graphql-helpers@0.1.0