Repository navigation
[SDK-776] Move prop-types from peerDependencies to dependencies - #178
devtools-agent[bot] wants to merge 1 commit into
Conversation
prop-types is an implementation detail of the components' runtime prop checks, not something consumers share with us, so per the prop-types README it belongs in `dependencies`. As a peer it isn't installed by yarn 1, pnpm without auto-install-peers, or npm --legacy-peer-deps, and the README's install instructions don't mention it, so following them gives "Cannot find module 'prop-types'" at import time. Keep it external in both rollup builds: peerDepsExternal only covers peers, and without this rollup would try to inline prop-types' CommonJS source (breaking the ES/CJS build) and bake it into the UMD bundle. Build output is byte-identical to 1.2.0. Also drop the now-redundant devDependency entry, which otherwise keeps prop-types and its dependencies flagged as dev-only in the lockfile. Fixes #70 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI Agent Review LGTM (openai, openai-astra)LGTM. No blocking findings were found. LGTM, no findings. package.json ( rollup.config.mjs: the new
package-lock.json: the root entry mirrors Not verified: the PR's claims that the build output is byte-identical and that tests, lint and typecheck pass. No CI or test output was available to check them. Outside the diff, no action needed: |
Fixes #70. Linear: SDK-776.
What changed
package.json: movedprop-typesfrompeerDependenciestodependencies(same^15.7.2range). Removed the duplicatedevDependenciesentry too. Without that, npm keepsprop-typesand its dependencies marked"dev": truein the lockfile.rollup.config.mjs: addedexternal: ['prop-types']to both build configs.package-lock.json: regenerated for the above.Why
prop-typesis used only for our components' runtime prop checks. Consumers don't need to share an instance with us, and the prop-types README recommends that libraries list it independencies. Our README's install line isnpm install @rollbar/react rollbar, which never mentionsprop-types. So anyone whose package manager doesn't auto-install peers gets an import-time crash.The rollup change is needed because
rollup-plugin-peer-deps-externalonly externalizes peer deps. Moving the package alone made rollup try to inline prop-types' CommonJS source: the ES/CJS build failed outright, and the UMD bundle silently changed. I externalized onlyprop-typesinstead of turning onincludeDependencies, because that option would also stop bundlingtiny-invariant, which is an unrelated behaviour change.Validation
npm run buildoutput (dist/,lib/,bundles/) is byte-identical to the v1.2.0 build (diff -r).npm test(13/13),npm run lintandnpm run typecheckpass.@rollbar/react react@18 react-dom@18 rollbar@3, then SSR-renders<Provider><ErrorBoundary>…:npm pack)unmet peer dependency "prop-types"→Cannot find module 'prop-types'auto-install-peers=false)Cannot find module 'prop-types'--legacy-peer-depsCannot find module 'prop-types'Notes:
npx prettier --check rollup.config.mjsalready fails onmainbecause of the existingentryFileNameslines. I didn't reformat unrelated code.prop-typesthemselves are unaffected. Within the^15range it dedupes to a single copy.🤖 Generated with Claude Code