Skip to content

INTER-2492: Remove postinstall script and detect framework at runtime - #211

Merged
erayaydin merged 4 commits into
mainfrom
fix/remove-postinstall-script-inter-2492
Sep 14, 2026
Merged

erayaydin merged 4 commits into
mainfrom
fix/remove-postinstall-script-inter-2492

Conversation

@erayaydin

Copy link
Copy Markdown
Member

pnpm 10+ blocks install scripts by default, so pnpm users hit:

[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: @fingerprint/react

and silently got no framework info in integrationInfo at all. The script only stamped the framework name and version into the published bundle.

With this change also: integrationInfo for React apps goes from react-sdk/<sdk>/react to react-sdk/<sdk>/react/<react>. Next.js is unchanged. Preact reports no version.

Preact

Preact exposes no version at runtime, so this drops exact Preact versions from analytics. For now, going with name-only.

pnpm 10+ blocks install scripts by default, so pnpm users hit
`ERR_PNPM_IGNORED_BUILDS` and got no framework info in `integrationInfo`
at all. The script only stamped the framework name and version into the
published bundle, and runtime detection already existed as the fallback.

React now reports an exact version it previously lacked, so
`integrationInfo` goes from `react-sdk/<sdk>/react` to
`react-sdk/<sdk>/react/<react>`. Next.js is unchanged. Preact reports
no version, since preact exposes none at runtime.

Related-Task: INTER-2492
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
96.79% (+0.39% 🔼)
151/156
🟢 Branches
95.51% (+0.71% 🔼)
85/89
🟢 Functions
97.78% (-0.14% 🔻)
44/45
🟢 Lines
97.33% (+0.44% 🔼)
146/150

Test suite run success

41 tests passing in 15 suites.

Report generated by 🧪jest coverage report action from 35454c7

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 96.79 95.5 97.77 97.33
🟢  src 100 100 100 100
🟢   detect-env.ts 100 100 100 100
🟢   env.types.ts 100 100 100 100
🟢   ...nt-context.ts 100 100 100 100
🟢   ssr.ts 100 100 100 100
🟢   ...sitor-data.ts 100 100 100 100
🟢  src/components 100 100 100 100
🟢   ...-provider.tsx 100 100 100 100
🟢   ...vironment.tsx 100 100 100 100
🟢  src/utils 88.09 87.5 92.3 90
🟢   ...is-defined.ts 100 100 100 100
🟢   ...-cache-key.ts 80.76 83.33 85.71 84 5,10,43,52
🟢   to-error.ts 100 100 100 100
🟢   ...mise-store.ts 100 100 100 100

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The install-time mechanism is cleanly removed, and the runtime behavior is consistently implemented and tested.

Pull request overview

Removes install-time framework stamping and performs framework/version detection at runtime, avoiding pnpm 10 ignored-build warnings.

Changes:

  • Removes the postinstall detection script and generated environment modules.
  • Reports the runtime React version while leaving Next.js and Preact behavior intact.
  • Updates tests and release notes for the new analytics format.
File summaries
File Description
.changeset/lucky-donuts-repeat.md Documents the minor release behavior change.
package.json Removes the postinstall script and scripts package content.
scripts/detect-env.js Deletes install-time framework detection.
src/get-env.ts Removes build-time environment parsing.
src/env.ts Removes the build-time placeholder.
src/env.types.ts Removes the obsolete environment validator.
src/detect-env.ts Adds runtime React version reporting.
src/components/with-environment.tsx Uses runtime detection directly.
__tests__/detect-env.test.ts Updates runtime detection expectations.
__tests__/fpjs-provider.test.tsx Verifies React version in integration metadata.
__tests__/with-environment.preact.test.tsx Verifies Preact reports no compatibility version.
Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@erayaydin
erayaydin marked this pull request as ready for review September 11, 2026 03:32
TheUnderScorer
TheUnderScorer previously approved these changes Sep 11, 2026

@TheUnderScorer TheUnderScorer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I left just one suggestion regarding the changeset.

Comment thread .changeset/lucky-donuts-repeat.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Following releases will be created using changesets from this PR:

@fingerprint/react@3.2.0

Minor Changes

  • Remove the postinstall script for detecting framework version. (fe6d9e1)

@erayaydin
erayaydin merged commit ac89eb5 into main Sep 14, 2026
11 checks passed
@erayaydin
erayaydin deleted the fix/remove-postinstall-script-inter-2492 branch September 14, 2026 13:52
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.

4 participants