Skip to content

feat(scan): support data-options config on auto.global.js script tag - #442

Open
Debbl wants to merge 1 commit into
aidenybai:mainfrom
Debbl:feat/auto-script-data-options
Open

Debbl wants to merge 1 commit into
aidenybai:mainfrom
Debbl:feat/auto-script-data-options

Conversation

@Debbl

@Debbl Debbl commented May 8, 2026

Copy link
Copy Markdown

Add a data-options JSON attribute on auto.global.js so CDN users can configure react-scan declaratively, no separate init script needed:

<script src=".../auto.global.js" data-options='{"enabled":false}'></script>

Same pattern as react-grab's getScriptOptions — read at module top-level via document.currentScript, JSON-parsed in a try/catch.

Authored with AI assistance (Claude Code), human-reviewed.

@vercel

vercel Bot commented May 8, 2026

Copy link
Copy Markdown

@Debbl is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

Parse a JSON object from the script tag's data-options attribute and pass it
to scan(), relying on the existing validateOptions for per-field checks.
Warn when the attribute is not a valid JSON object.
@Debbl
Debbl force-pushed the feat/auto-script-data-options branch from 45656bd to 503e2d3 Compare September 23, 2026 03:22
@Debbl
Debbl marked this pull request as ready for review September 23, 2026 03:25

This branch has not been deployed

No deployments
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.

1 participant