@clicktap/ui 2.0.4 → 2.0.5
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.
|
@@ -35,11 +35,38 @@ query text codegen started from.
|
|
|
35
35
|
|
|
36
36
|
## Migration
|
|
37
37
|
|
|
38
|
-
1. Switch codegen to string documents: `
|
|
39
|
-
|
|
38
|
+
1. Switch codegen to string documents. `documentMode: 'string'` goes under **`config`**, NOT
|
|
39
|
+
`presetConfig` — verified against `@graphql-codegen/client-preset` 4.8.3 and 6.1.3. Requires
|
|
40
|
+
client-preset >= 4 for `TypedDocumentString`. Regenerate.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
'./generated/': {
|
|
44
|
+
preset: 'client',
|
|
45
|
+
presetConfig: { fragmentMasking: false },
|
|
46
|
+
config: { documentMode: 'string' }, // <- here
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Verify the regeneration, because the wrong placement fails silently.** Under
|
|
51
|
+
`presetConfig`, codegen reports success and still emits AST documents — and since the new
|
|
52
|
+
client rejects an AST at runtime rather than at build time, both the build and the
|
|
53
|
+
typecheck stay green while every query goes out as the string `"[object Object]"`. A
|
|
54
|
+
consumer shipped exactly that and only caught it by counting emitted documents. After
|
|
55
|
+
regenerating, confirm the output contains `TypedDocumentString` and **zero**
|
|
56
|
+
`as unknown as DocumentNode`:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
grep -c 'TypedDocumentString' generated/graphql.ts # expect > 0
|
|
60
|
+
grep -c 'as unknown as DocumentNode' generated/graphql.ts # expect 0
|
|
61
|
+
```
|
|
40
62
|
2. Replace `TypedDocumentNode`/`RequestDocument` types at wrapper boundaries with
|
|
41
63
|
`GraphqlDocument` / `GraphqlVariables` from this module; `GraphQLClientRequestHeaders`
|
|
42
64
|
with the platform `HeadersInit`.
|
|
43
65
|
3. Sites that imported `ClientError` from `graphql-request` import it from here.
|
|
44
|
-
4.
|
|
45
|
-
`createAuthAwareFetch()`
|
|
66
|
+
4. Audit every site that turns a document into text itself, not just the `FormData` ones.
|
|
67
|
+
`createAuthAwareFetch()` is unchanged, and `String(document)` replaces `print(document)` —
|
|
68
|
+
but the class to search for is broader than uploads: **any hand-rolled
|
|
69
|
+
`fetch(url, { body: JSON.stringify({ query: print(Doc) }) })`**. A consumer found two
|
|
70
|
+
(`getCompanyCollection.ts`, `setCurrentCompanyCookie.ts`) that an inventory of upload call
|
|
71
|
+
sites did not anticipate, and they surfaced only after the codegen switch. Grep for
|
|
72
|
+
`print(` and for `from 'graphql'` across the app, not only for `FormData`.
|
|
@@ -22,16 +22,28 @@ base is react-aria-components; the rewrites cost nothing new:
|
|
|
22
22
|
- **Pagination** → native boundary/sibling windowing.
|
|
23
23
|
- **Badge** → the two wrapper elements, inline.
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Same name, CHANGED signature — read this first
|
|
26
|
+
|
|
27
|
+
These kept their names, so a call site compiles, but the contract moved. A consumer had four
|
|
28
|
+
call sites break on props this document previously listed as simply preserved.
|
|
29
|
+
|
|
30
|
+
| Prop | Was (heroui) | Now |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| `AccordionItem.onPress` | received a `PressEvent` | receives **no arguments**. A handler reading `e.target` type-checks anyway, because an extra declared parameter is accepted in some positions — it just gets `undefined` at runtime. |
|
|
33
|
+
| `Accordion.onSelectionChange` | could emit the string `'all'` | always emits `Set<string>`. A branch testing `keys === 'all'` is now dead code. |
|
|
34
|
+
| `Tooltip` `classNames.arrow` | slot existed | **removed** — the arrow is `OverlayArrow`; style it via `content`/`base` or the arrow element itself. |
|
|
35
|
+
| `Tooltip` `isOpen` | controlled open state | **not supported** — the RAC `TooltipTrigger` owns open state. Use `delay`/`isDisabled`, or drive visibility from the trigger. |
|
|
36
|
+
|
|
37
|
+
## Same name, same behavior
|
|
26
38
|
|
|
27
39
|
- Accordion: `selectionMode`, `defaultSelectedKeys` (incl. `"all"`),
|
|
28
|
-
`defaultExpandedKeys`, controlled `selectedKeys
|
|
40
|
+
`defaultExpandedKeys`, controlled `selectedKeys`,
|
|
29
41
|
`disallowEmptySelection`, `hideIndicator` (group and per-item),
|
|
30
42
|
`showDivider`/`dividerProps` (an `<hr>` between items — `[&_hr]:hidden`
|
|
31
43
|
keeps working), `itemClasses`/per-item `classNames` slots, per-item
|
|
32
44
|
`title`/`subtitle`/`startContent`/`indicator` (a component still receives
|
|
33
45
|
`{ isOpen }` — import `AccordionItemIndicatorProps` from HERE now),
|
|
34
|
-
`disableIndicatorAnimation`,
|
|
46
|
+
`disableIndicatorAnimation`, and the `data-open` attribute on
|
|
35
47
|
heading/trigger/indicator that `data-[open=true]:` selectors style.
|
|
36
48
|
- Tooltip: `content`, `offset`, `placement`, `showArrow`, `delay`,
|
|
37
49
|
`isDisabled`, `classNames.base/content`, arbitrary child as trigger.
|
|
@@ -38,6 +38,25 @@ reference app pins the identical versions. When bumping, take the trio from the
|
|
|
38
38
|
react-aria release announcement and re-run the production-bundle checks below —
|
|
39
39
|
aligning to the coherent set fixed the Table failure outright with no code change.
|
|
40
40
|
|
|
41
|
+
## If you still depend on `@heroui/*`, pinning is not enough
|
|
42
|
+
|
|
43
|
+
`@clicktap/ui` 2.x dropped heroui, so this case is invisible upstream — but a fork still carrying
|
|
44
|
+
it will install **both** trios no matter what it pins. heroui drags the old set in transitively:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
@heroui/badge -> @heroui/system -> @react-spectrum/provider -> @adobe/react-spectrum
|
|
48
|
+
-> react-aria-components (old)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
A consumer pinned one release *above* the verified set and ended up with two full trios and six
|
|
52
|
+
`@react-aria/*` subpackages at two versions each — precisely the skew this guide warns is invisible
|
|
53
|
+
outside production bundles. Aligning **down** to the verified set unified them.
|
|
54
|
+
|
|
55
|
+
So: pin to the verified set exactly (not "at least"), and if the duplicate persists, the remaining
|
|
56
|
+
copy is being pulled by a heroui/react-spectrum branch. Check with the instance-directory diff
|
|
57
|
+
below — and note that removing heroui is the only complete fix, since its transitive floor is not
|
|
58
|
+
something a pin can override.
|
|
59
|
+
|
|
41
60
|
## How to verify (jsdom cannot)
|
|
42
61
|
|
|
43
62
|
Probe a production build in a real browser: open an uncontrolled DialogTrigger modal
|