Skip to content

Commit a497d4b

Browse files
fix(web,h): drop router-only props from core anchor types (#3963)
state, noscroll, replace, and preload are not standard anchor attributes. A routing integration declares them. link stays as the shared explicit-links opt-in the SSR claim bag already copies. Co-authored-by: Cursor <[email protected]>
1 parent 234cfc9 commit a497d4b

4 files changed

Lines changed: 15 additions & 36 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@solidjs/web": patch
3+
"@solidjs/h": patch
4+
---
5+
6+
Remove `state`, `noscroll`, `replace`, and `preload` from core anchor JSX types. They are not standard `<a>` attributes; a routing integration declares them by augmenting `AnchorHTMLAttributes`. `link` stays — it is the shared explicit-links opt-in, and the SSR claim bag already copies that name. Media and webview `preload` attributes are unchanged. Types only.

‎packages/h/jsx-runtime/src/jsx.d.ts‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,20 +1127,11 @@ export namespace JSX {
11271127
>;
11281128
type?: FunctionMaybe<string | RemoveAttribute>;
11291129

1130-
// Client-side navigation contract. These attributes are inert markup on
1131-
// their own — a routing integration that delegates anchor clicks (e.g.
1132-
// @solidjs/router) reads them off the element at event time. Typed here
1133-
// so plain `<a>` elements participate without per-router augmentation.
1130+
// Client-side navigation contract. `link` is inert markup on its own —
1131+
// a routing integration that delegates anchor clicks (e.g. @solidjs/router)
1132+
// reads it off the element at event time.
11341133
/** Marks the anchor as a client-navigation link when the integration requires explicit opt-in. */
11351134
link?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1136-
/** Serialized (JSON) history state pushed alongside the navigation. */
1137-
state?: FunctionMaybe<string | RemoveAttribute>;
1138-
/** Suppress scroll restoration/reset after the navigation. */
1139-
noscroll?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1140-
/** Replace the current history entry instead of pushing a new one. */
1141-
replace?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1142-
/** Route preload intent; `"false"` disables the integration's default eager preload. */
1143-
preload?: FunctionMaybe<boolean | "false" | RemoveAttribute>;
11441135

11451136
/** @experimental */
11461137
attributionsrc?: FunctionMaybe<string | RemoveAttribute>;

‎packages/web/jsx/jsx-h.d.ts‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,20 +1128,11 @@ export namespace JSX {
11281128
>;
11291129
type?: FunctionMaybe<string | RemoveAttribute>;
11301130

1131-
// Client-side navigation contract. These attributes are inert markup on
1132-
// their own — a routing integration that delegates anchor clicks (e.g.
1133-
// @solidjs/router) reads them off the element at event time. Typed here
1134-
// so plain `<a>` elements participate without per-router augmentation.
1131+
// Client-side navigation contract. `link` is inert markup on its own —
1132+
// a routing integration that delegates anchor clicks (e.g. @solidjs/router)
1133+
// reads it off the element at event time.
11351134
/** Marks the anchor as a client-navigation link when the integration requires explicit opt-in. */
11361135
link?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1137-
/** Serialized (JSON) history state pushed alongside the navigation. */
1138-
state?: FunctionMaybe<string | RemoveAttribute>;
1139-
/** Suppress scroll restoration/reset after the navigation. */
1140-
noscroll?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1141-
/** Replace the current history entry instead of pushing a new one. */
1142-
replace?: FunctionMaybe<BooleanAttribute | RemoveAttribute>;
1143-
/** Route preload intent; `"false"` disables the integration's default eager preload. */
1144-
preload?: FunctionMaybe<boolean | "false" | RemoveAttribute>;
11451136

11461137
/** @experimental */
11471138
attributionsrc?: FunctionMaybe<string | RemoveAttribute>;

‎packages/web/jsx/jsx.d.ts‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,20 +1139,11 @@ export namespace JSX {
11391139
target?: "_self" | "_blank" | "_parent" | "_top" | (string & {}) | RemoveAttribute;
11401140
type?: string | RemoveAttribute;
11411141

1142-
// Client-side navigation contract. These attributes are inert markup on
1143-
// their own — a routing integration that delegates anchor clicks (e.g.
1144-
// @solidjs/router) reads them off the element at event time. Typed here
1145-
// so plain `<a>` elements participate without per-router augmentation.
1142+
// Client-side navigation contract. `link` is inert markup on its own —
1143+
// a routing integration that delegates anchor clicks (e.g. @solidjs/router)
1144+
// reads it off the element at event time.
11461145
/** Marks the anchor as a client-navigation link when the integration requires explicit opt-in. */
11471146
link?: BooleanAttribute | RemoveAttribute;
1148-
/** Serialized (JSON) history state pushed alongside the navigation. */
1149-
state?: string | RemoveAttribute;
1150-
/** Suppress scroll restoration/reset after the navigation. */
1151-
noscroll?: BooleanAttribute | RemoveAttribute;
1152-
/** Replace the current history entry instead of pushing a new one. */
1153-
replace?: BooleanAttribute | RemoveAttribute;
1154-
/** Route preload intent; `"false"` disables the integration's default eager preload. */
1155-
preload?: boolean | "false" | RemoveAttribute;
11561147

11571148
/** @experimental */
11581149
attributionsrc?: string | RemoveAttribute;

0 commit comments

Comments
 (0)