@ethlete/query 6.0.0-next.19 → 6.0.0-next.20
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 +56 -0
- package/fesm2022/ethlete-query.mjs +815 -78
- package/fesm2022/ethlete-query.mjs.map +1 -1
- package/generators/migrate-to-query-v3/auth-provider-scaffold.js +131 -0
- package/generators/migrate-to-query-v3/cleanup-migration.js +128 -77
- package/generators/migrate-to-query-v3/http-client-check.js +93 -0
- package/generators/migrate-to-query-v3/legacy-prepare-migration.js +8 -9
- package/generators/migrate-to-query-v3/legacy-query-creator-migration.js +155 -137
- package/generators/migrate-to-query-v3/migration-scope.js +41 -0
- package/generators/migrate-to-query-v3/migration.js +17 -9
- package/generators/migrate-to-query-v3/module-graph.js +153 -0
- package/generators/migrate-to-query-v3/query-client-migration.js +53 -5
- package/generators/migrate-to-query-v3/rename-symbols.js +193 -0
- package/generators/migrate-to-query-v3/schema.json +12 -0
- package/package.json +1 -1
- package/types/ethlete-query.d.ts +540 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @ethlete/query
|
|
2
2
|
|
|
3
|
+
## 6.0.0-next.20
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#3037](https://github.com/ethlete-io/ethdk/pull/3037) [`a83cfe4`](https://github.com/ethlete-io/ethdk/commit/a83cfe4b3e69c3e70ac20f81a5c287bdb6278a63) Thanks [@github-actions](https://github.com/apps/github-actions)! - Cache entries are now kept for `keepUnusedFor` (5 minutes by default) after their last consumer was destroyed, instead of being discarded immediately. A query that mounts again within that window — a list page reached via browser back navigation, for instance — binds to the existing entry and renders its previous response right away while revalidating in the background (`executionState()` reports `{ type: 'loading', hasCachedResponse: true }`).
|
|
8
|
+
|
|
9
|
+
- Configurable per client (`createQueryClient({ keepUnusedFor })`) and per query creator; `0` restores the previous release-immediately behavior.
|
|
10
|
+
- Independent of `cache-control`, so it also applies to private/authenticated responses.
|
|
11
|
+
- Only entries holding a response are kept — in-flight and errored ones are still aborted immediately. At most 50 unused entries per client are retained, and retention is disabled on the server.
|
|
12
|
+
|
|
13
|
+
- [#3037](https://github.com/ethlete-io/ethdk/pull/3037) [`7ae9eaa`](https://github.com/ethlete-io/ethdk/commit/7ae9eaa878c6c3bfa80876c67ac1f9360a1c24ec) Thanks [@github-actions](https://github.com/apps/github-actions)! - Close the gaps found while migrating a real workspace from the legacy client to v3:
|
|
14
|
+
|
|
15
|
+
- **Client-level headers.** `createQueryClient({ headers })` takes `HttpHeaders` or a function
|
|
16
|
+
re-read on every request, so a signal can drive it. Per-query `args.headers` merge on top and win
|
|
17
|
+
per name. `client.refreshQueriesInUse()` re-runs every bound `GET`/`HEAD`/`OPTIONS` (in-flight ones
|
|
18
|
+
included) — the replacement for v2's `setDefaultHeaders({ refreshQueriesInUse: true })`.
|
|
19
|
+
- **`provider.setTokens(access, refresh)`** on the public bearer auth provider, for tokens issued
|
|
20
|
+
outside it (SSO callbacks, native shells). Previously reachable only from inside a custom feature.
|
|
21
|
+
- **`logout()` now resets bound secure queries.** It already unbound their cache entries, but the
|
|
22
|
+
query objects kept their `response()`, so a component mounted across a logout went on rendering the
|
|
23
|
+
previous user until something called `reset()`.
|
|
24
|
+
- **Legacy `prepare()` failures are diagnosable.** Calling it without an injection context throws
|
|
25
|
+
`ET950` naming the creator instead of a bare `NG0203`; calling it with an already destroyed injector
|
|
26
|
+
returns an inert query and warns in dev mode instead of throwing `NG0205` from a view's cleanup
|
|
27
|
+
phase. `createLegacyQueryCreator` takes a `name` for those messages.
|
|
28
|
+
- **Query-collection consumers accept real legacy queries.** `AnyQueryCollection` no longer pins the
|
|
29
|
+
arguments type, so a `createQueryCollectionSignal` result is assignable to `*etQuery`,
|
|
30
|
+
`queryStateErrorSignal` and `switchQueryCollectionState` without a cast.
|
|
31
|
+
- **`queryErrorMessages(error)` / `queryErrorMessage(error)`** flatten a `QueryErrorResponse` into
|
|
32
|
+
displayable strings, and `emptyQueryArgs<TArgs>()` covers argless queries in generic code (auth
|
|
33
|
+
registry `execute()` now takes no argument either).
|
|
34
|
+
- **`BearerAuthProviderOf<typeof ref>`** derives the exact provider type; `AnyBearerAuthProvider` no
|
|
35
|
+
longer forces bracket access on `provider.queries` under `noPropertyAccessFromIndexSignature`.
|
|
36
|
+
|
|
37
|
+
`migrate-to-query-v3` got a precision pass:
|
|
38
|
+
|
|
39
|
+
- Renames are scoped to imports that actually resolve to the migrated symbol, so same-named type
|
|
40
|
+
members, config properties and exports from unrelated packages are left alone; import aliases are
|
|
41
|
+
preserved instead of dropped.
|
|
42
|
+
- `--projects` / `--include` migrate one app or library at a time.
|
|
43
|
+
- Unused imports (`def`, `AnyLegacyQuery*`, stale client symbols) are no longer left behind.
|
|
44
|
+
- Auth providers are scaffolded from the v2 `V2BearerAuthProvider` config instead of `queries: []`.
|
|
45
|
+
- Devtools are migrated rather than deleted: the per-client `provideQueryClientForDevtools` calls
|
|
46
|
+
collapse into one `provideQueryDevtools()`, `QueryDevtoolsComponent` is re-imported from
|
|
47
|
+
`@ethlete/components`, and `<et-query-devtools>` markup is left alone — both versions use that selector.
|
|
48
|
+
- New report tasks for dropped v2 client options, missing `provideHttpClient()`, `setDefaultHeaders`
|
|
49
|
+
call sites and the auth import-cycle layout.
|
|
50
|
+
|
|
51
|
+
- [#3037](https://github.com/ethlete-io/ethdk/pull/3037) [`0c30546`](https://github.com/ethlete-io/ethdk/commit/0c30546c220bc40f5a167c9d5cbad2757e9c7108) Thanks [@github-actions](https://github.com/apps/github-actions)! - Add a signals-first query form: `createQueryForm({ fields, queryParamPrefix? })` alongside field creators `queryField`, `searchQueryField`, `sortQueryField`, `stringArrayQueryField`, `numberArrayQueryField`, `booleanArrayQueryField`, `dateQueryField`, `dateArrayQueryField`.
|
|
52
|
+
|
|
53
|
+
Built on Angular signal forms, so each field is bindable to the SDK's own controls with `[formField]` (e.g. `<input etInput [formField]="qf.fields.search" />`). Fields commit as a debounced signal `value`, sync to the URL query params (default elision, `ET_NULL__` sentinel, `active:direction` sort format, prefix namespacing), reset dependents via the `isResetBy` graph, expose `activeFilterCount` as a signal, and support a detached `branch()` for edit-then-apply filter flows.
|
|
54
|
+
|
|
55
|
+
Also adds a `withPageResetOnError` query feature that resets the page (a signal or a query-form field) when the current page goes out of range (HTTP `416`, or a dev-mode `500` Pagerfanta out-of-range error), plus the exported `isPageOutOfRangeError` predicate.
|
|
56
|
+
|
|
57
|
+
The existing reactive-forms `QueryForm` is unchanged and remains available.
|
|
58
|
+
|
|
3
59
|
## 6.0.0-next.19
|
|
4
60
|
|
|
5
61
|
### Minor Changes
|