Skip to content

fix(tech-detect): next/script props need a JS token in children and an id or strategy beside a src #1444 - #1452

Closed
nc9 wants to merge 1 commit into
mainfrom
fix/flight-script-props-1444
Closed

nc9 wants to merge 1 commit into
mainfrom
fix/flight-script-props-1444

Conversation

@nc9

@nc9 nc9 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1444.

Follow-up to #1442. The next/script component is recognised by its props, and a client component could have script-like props.

  • A src counts only beside an id or a strategy (a bare src is any embed or image component).
  • String children are read as inline code only with a call and a statement end or block (( and ; or {) AND a JavaScript token (function, =>, an assignment, .createElement, window., document.); the word function, window., =>, = or a ?query= in prose is not enough alone.
  • Tests in flight-script-narrow-1437.test.ts: parenthesised prose with an id, a bare src (and src with alt, width), src beside an id or strategy still read, prose containing each JS token without both brackets, and the REAL fp2 next build page (client components; build hashes replaced): n1 (id and parenthesised prose) and n2 are not loaders, but n3 (id and src) and n4 (id and function-like children) ARE script-shaped, so the page still detects the vendor; with n3 and n4's URLs replaced it does not. 38 tests.
  • Known limits, in the docs: an id with a src or code-like text cannot be told from next/script; an id-only inline snippet with no strategy and no JS token (a bare loadTag('...');) is no longer read.
  • Docs sentence and CHANGELOG (Unreleased / Fixed) updated.

Skill: no change needed.

nik

… src needs an id or strategy #1444

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 force-pushed the fix/flight-script-props-1444 branch from 338b8f0 to 8356255 Compare October 31, 2026 19:04
@nc9 nc9 mentioned this pull request Oct 31, 2026
@nc9

nc9 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@nc9 nc9 closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tech-detect: next/script props heuristic reads client components with a src or code-like prose (#1442 residual)

1 participant