@timber-js/app 0.2.0-alpha.82 → 0.2.0-alpha.84

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 (28) hide show
  1. package/dist/_chunks/{actions-Dg-ANYHb.js → actions-YHRCboUO.js} +2 -2
  2. package/dist/_chunks/{actions-Dg-ANYHb.js.map → actions-YHRCboUO.js.map} +1 -1
  3. package/dist/_chunks/{define-CZqDwhSu.js → define-Itxvcd7F.js} +2 -2
  4. package/dist/_chunks/{define-CZqDwhSu.js.map → define-Itxvcd7F.js.map} +1 -1
  5. package/dist/_chunks/{define-cookie-C2IkoFGN.js → define-cookie-C9pquwOg.js} +4 -4
  6. package/dist/_chunks/{define-cookie-C2IkoFGN.js.map → define-cookie-C9pquwOg.js.map} +1 -1
  7. package/dist/_chunks/{request-context-qMsWgy9C.js → request-context-Dl0hXED3.js} +2 -2
  8. package/dist/_chunks/{request-context-qMsWgy9C.js.map → request-context-Dl0hXED3.js.map} +1 -1
  9. package/dist/_chunks/use-params-Br9YSUFV.js.map +1 -1
  10. package/dist/_chunks/{use-query-states-Lo_s_pw2.js → use-query-states-BiV5GJgm.js} +4 -1
  11. package/dist/_chunks/{use-query-states-Lo_s_pw2.js.map → use-query-states-BiV5GJgm.js.map} +1 -1
  12. package/dist/client/index.js +2 -2
  13. package/dist/client/internal.js +1 -1
  14. package/dist/client/top-loader.d.ts.map +1 -1
  15. package/dist/client/use-query-states.d.ts.map +1 -1
  16. package/dist/cookies/index.js +1 -1
  17. package/dist/index.js +1 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/plugins/shims.d.ts.map +1 -1
  20. package/dist/search-params/index.js +2 -2
  21. package/dist/server/index.js +2 -2
  22. package/dist/server/internal.js +2 -2
  23. package/package.json +7 -6
  24. package/src/cli.ts +0 -0
  25. package/src/client/top-loader.tsx +14 -10
  26. package/src/client/use-query-states.ts +6 -0
  27. package/src/plugins/shims.ts +1 -0
  28. package/LICENSE +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"shims.d.ts","sourceRoot":"","sources":["../../src/plugins/shims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAsE1D;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CA0OvD"}
1
+ {"version":3,"file":"shims.d.ts","sourceRoot":"","sources":["../../src/plugins/shims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAuE1D;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CA0OvD"}
@@ -1,5 +1,5 @@
1
- import { i as registerSearchParams, r as getSearchParamsDefinition } from "../_chunks/use-query-states-Lo_s_pw2.js";
2
- import { n as defineSearchParams } from "../_chunks/define-CZqDwhSu.js";
1
+ import { i as registerSearchParams, r as getSearchParamsDefinition } from "../_chunks/use-query-states-BiV5GJgm.js";
2
+ import { n as defineSearchParams } from "../_chunks/define-Itxvcd7F.js";
3
3
  //#region src/search-params/wrappers.ts
4
4
  /**
5
5
  * Wrap a nullable codec with a default value. When the inner codec returns
@@ -1,8 +1,8 @@
1
1
  import { n as isDevMode, t as isDebug } from "../_chunks/debug-ECi_61pb.js";
2
2
  import { t as formatSize } from "../_chunks/format-CYBGxKtc.js";
3
3
  import { n as formFlashAls } from "../_chunks/als-registry-HS0LGUl2.js";
4
- import { a as getHeaders, c as getSegmentParams, i as getHeader, n as getCookie, r as getCookies, s as getSearchParams } from "../_chunks/request-context-qMsWgy9C.js";
5
- import { a as revalidateTag, c as RedirectType, d as redirect, f as redirectExternal, i as revalidatePath, o as DenySignal, p as waitUntil, s as RedirectSignal, u as deny } from "../_chunks/actions-Dg-ANYHb.js";
4
+ import { a as getHeaders, c as getSegmentParams, i as getHeader, n as getCookie, r as getCookies, s as getSearchParams } from "../_chunks/request-context-Dl0hXED3.js";
5
+ import { a as revalidateTag, c as RedirectType, d as redirect, f as redirectExternal, i as revalidatePath, o as DenySignal, p as waitUntil, s as RedirectSignal, u as deny } from "../_chunks/actions-YHRCboUO.js";
6
6
  import { a as getSpanId, d as withSpan, o as getTraceId, t as addSpanEvent } from "../_chunks/tracing-CCYbKn5n.js";
7
7
  //#region src/server/form-data.ts
8
8
  /**
@@ -3,8 +3,8 @@ import { a as warnRedirectInSuspense, c as warnSuspenseWrappingChildren, i as wa
3
3
  import { t as classifyUrlSegment } from "../_chunks/segment-classify-BDNn6EzD.js";
4
4
  import { i as getMetadataRouteServePath, n as classifyMetadataRoute, r as getMetadataRouteAutoLink, t as METADATA_ROUTE_CONVENTIONS } from "../_chunks/metadata-routes-DS3eKNmf.js";
5
5
  import { a as timingAls, r as requestContextAls, t as earlyHintsSenderAls } from "../_chunks/als-registry-HS0LGUl2.js";
6
- import { f as runWithRequestContext, l as getSetCookieHeaders, m as setSegmentParams, p as setMutableCookieContext, t as applyRequestHeaderOverlay, u as markResponseFlushed } from "../_chunks/request-context-qMsWgy9C.js";
7
- import { l as RenderError, n as executeAction, o as DenySignal, r as isRscActionRequest, s as RedirectSignal, t as buildNoJsResponse } from "../_chunks/actions-Dg-ANYHb.js";
6
+ import { f as runWithRequestContext, l as getSetCookieHeaders, m as setSegmentParams, p as setMutableCookieContext, t as applyRequestHeaderOverlay, u as markResponseFlushed } from "../_chunks/request-context-Dl0hXED3.js";
7
+ import { l as RenderError, n as executeAction, o as DenySignal, r as isRscActionRequest, s as RedirectSignal, t as buildNoJsResponse } from "../_chunks/actions-YHRCboUO.js";
8
8
  import { c as replaceTraceId, d as withSpan, i as getOtelTraceId, l as runWithTraceId, o as getTraceId, r as generateTraceId, s as getTraceStore, u as setSpanAttribute } from "../_chunks/tracing-CCYbKn5n.js";
9
9
  import "../client/error-boundary.js";
10
10
  import "../_chunks/segment-context-fHFLF1PE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.82",
3
+ "version": "0.2.0-alpha.84",
4
4
  "description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
5
5
  "keywords": [
6
6
  "cloudflare-workers",
@@ -110,6 +110,11 @@
110
110
  "publishConfig": {
111
111
  "access": "public"
112
112
  },
113
+ "scripts": {
114
+ "build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
115
+ "typecheck": "tsgo --noEmit",
116
+ "prepublishOnly": "pnpm run build"
117
+ },
113
118
  "dependencies": {
114
119
  "@opentelemetry/api": "^1.9.1",
115
120
  "@opentelemetry/context-async-hooks": "^2.6.1",
@@ -152,9 +157,5 @@
152
157
  },
153
158
  "engines": {
154
159
  "node": ">=22.12.0"
155
- },
156
- "scripts": {
157
- "build": "vite build --config vite.lib.config.ts && tsc --emitDeclarationOnly --project tsconfig.json --outDir dist",
158
- "typecheck": "tsgo --noEmit"
159
160
  }
160
- }
161
+ }
package/src/cli.ts CHANGED
File without changes
@@ -28,7 +28,7 @@
28
28
  'use client';
29
29
 
30
30
  import { useState, createElement } from 'react';
31
- import { usePendingNavigationUrl, hasNativeNavigationTransition } from './navigation-context.js';
31
+ import { usePendingNavigationUrl } from './navigation-context.js';
32
32
 
33
33
  // ─── Types ───────────────────────────────────────────────────────
34
34
 
@@ -112,15 +112,19 @@ function ensureKeyframes(): void {
112
112
  */
113
113
  export function TopLoader({ config }: { config?: TopLoaderConfig }): React.ReactElement | null {
114
114
  const pendingUrl = usePendingNavigationUrl();
115
- // Navigation is pending when either:
116
- // 1. Our React-based pending URL is set (standard path), OR
117
- // 2. The Navigation API has an active transition (external navigations
118
- // intercepted by the navigate event that haven't completed yet).
119
- // In practice these are almost always in sync — the Navigation API
120
- // transition is active while our pendingUrl is set. This check ensures
121
- // the top-loader also shows for external navigations caught by the
122
- // Navigation API before our React state updates.
123
- const isPending = pendingUrl !== null || hasNativeNavigationTransition();
115
+ // Navigation is pending when the React-based pending URL is set.
116
+ // pendingUrl is set as an urgent update in navigateTransition()
117
+ // React commits it before the next paint, so the TopLoader appears
118
+ // immediately when a real RSC navigation starts.
119
+ //
120
+ // We intentionally do NOT check hasNativeNavigationTransition() here.
121
+ // The Navigation API's transition is active for ALL intercepted
122
+ // navigations, including shallow URL updates (nuqs search param
123
+ // changes with shallow: true) and prevented navigations. Those
124
+ // briefly set navigation.transition via event.intercept() but do
125
+ // NOT trigger RSC fetches — showing the TopLoader would be incorrect.
126
+ // pendingUrl is the authoritative signal for "we're fetching RSC data."
127
+ const isPending = pendingUrl !== null;
124
128
 
125
129
  const color = config?.color ?? DEFAULT_COLOR;
126
130
  const height = config?.height ?? DEFAULT_HEIGHT;
@@ -95,8 +95,14 @@ export function useQueryStates<T extends Record<string, unknown>>(
95
95
 
96
96
  const bridged = bridgeCodecs(codecs);
97
97
 
98
+ // Forward hook-level options (shallow, scroll, history) to nuqs.
99
+ // These become the default for all setter calls from this hook instance.
100
+ // Per-call options in setParams(values, opts) override these defaults.
98
101
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
102
  const nuqsOptions: any = {};
103
+ if (_options?.shallow !== undefined) nuqsOptions.shallow = _options.shallow;
104
+ if (_options?.scroll !== undefined) nuqsOptions.scroll = _options.scroll;
105
+ if (_options?.history !== undefined) nuqsOptions.history = _options.history;
100
106
  if (resolvedUrlKeys && Object.keys(resolvedUrlKeys).length > 0) {
101
107
  nuqsOptions.urlKeys = resolvedUrlKeys;
102
108
  }
@@ -50,6 +50,7 @@ const SUBPATH_SRC_MAP: Record<string, string> = {
50
50
  'cache': 'cache/index.ts',
51
51
  'cookies': 'cookies/index.ts',
52
52
  'search-params': 'search-params/index.ts',
53
+ 'segment-params': 'segment-params/index.ts',
53
54
 
54
55
  'adapters/cloudflare': 'adapters/cloudflare.ts',
55
56
  'adapters/cloudflare/dev': 'adapters/cloudflare-dev.ts',
package/LICENSE DELETED
@@ -1,8 +0,0 @@
1
- DONTFUCKINGUSE LICENSE
2
-
3
- Copyright (c) 2025 Daniel Saewitz
4
-
5
- This software may not be used, copied, modified, merged, published,
6
- distributed, sublicensed, or sold by anyone other than the copyright holder.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.