Stop committing the react-replay-webpack4 build - #1499
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The committed dist/ was never usable. #1388 copied it byte-for-byte from react-16, so main.js had no replay code, and index.html loaded /examples/replay-react-webpack4/ (words swapped, no file), which 404s. No test loads it, and nothing would keep a rebuilt copy current. - Remove dist/ and ignore it. CI's validate:examples already builds this example against the current SDK, which is the coverage it exists for. - Fix the production publicPath to /examples/react-replay-webpack4/dist/ so a future browser test can load a fresh build from the repo root. - Replace the README's stale commit-the-fixture steps with a note on how CI covers the example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
258f1cf to
63c141b
Compare
rollbar-circleci-machine
left a comment
There was a problem hiding this comment.
AI Agent Review (openai, openai-astra)
Stop committing the react-replay-webpack4 build. This looks correct and safe to merge.
examples/.gitignore:2(react-replay-webpack4/dist/) contains a slash, so git anchors it toexamples/and it matches onlyexamples/react-replay-webpack4/dist/.- The
publicPathchange atexamples/react-replay-webpack4/webpack.config.js:12fixes the transposedreplay-react-webpack4name. The deleteddist/index.htmlalso pointed its script at/examples/replay-react-webpack4/with nomain.js, so the committed build was broken anyway. - Nothing else in the repo references
react-replay-webpack4or itsdist/. No test intest/examples/loads it, so removing the build breaks nothing. - The README says CI builds this example, and that holds up:
.github/workflows/ci.yml:88-89runsnpm run validate:examples, andscripts/validate-examples.js:30-31,71runsnpm installandnpm run buildfor every example whoserollbardependency isfile:../rollbar.tgz(examples/react-replay-webpack4/package.json:23).replay/package.jsonis not excluded by.npmignore, so it ships in the tarball. - A locally built
dist/won't trip lint or formatting:eslint.config.js:149and.prettierignore:18both excludeexamples.
One low-severity note on the README follows as a finding.
Outside this diff, not a finding: examples/react-16/webpack.config.js:12 sets publicPath to /examples/react/dist/, but the committed examples/react-16/dist/index.html:11 loads /examples/react-16/dist/main.js. Rebuilding react-16 from its config would break test/examples/react.test.ts:16. It's the same kind of path mismatch this PR fixes for webpack4, and worth a follow-up.
I could not run anything, so I have not verified that the example builds or that tests pass.
Addresses review feedback: the README implied a test could load this example the way react.test.ts loads react-16, but react-16's build was committed and this one no longer is. Say why publicPath is absolute and that CI would first need to build the example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI Agent Review LGTM (openai, openai-astra)LGTM. No blocking findings were found. LGTM. The PR stops committing the Verified in the checkout:
Outside this PR's changed files: I did not run any tests or builds; everything above comes from reading the code. |
What
Follow-up to #1487.
examples/react-replay-webpack4/dist/was committed but never worked, and nothing would keep it current, so this PR stops committing it.dist/index.htmlpointed to/examples/replay-react-webpack4/, with the words swapped and no file name, so it 404s.replay/package.json, keep standard ones without replay #1388 copieddist/main.jsbyte-for-byte from thereact-16fixture. It was the plainrollbarbundle, with no rrweb and norollbar/replay.npm run buildnever rebuilds exampledist/folders. CI'svalidate:examplesrebuilds every example but throws the output away.Changes
dist/and addreact-replay-webpack4/dist/toexamples/.gitignore. I used the shared file because Drop vulnerable dev servers from old examples (clears 13 Dependabot alerts) #1487 creates this example's own.gitignore, and adding the same file in both PRs would conflict.webpack.config.js: fix the productionpublicPathto/examples/react-replay-webpack4/dist/. It has to stay absolute becauseloadHtmlintest/util/fixtures.tsrecreates the page's scripts inside the test runner's page, so a relativesrcwould resolve against the wrong URL. That's also how thereact-16fixture works.README.md: replace the commit-the-fixture steps, which pointed atexamples/reactandexamples/webpack/dist/, with a note thatdist/isn't committed and CI builds the example.No source, dependency or script changes.
What still covers this example
CI's
validate:examplesinstalls and builds it against the freshly packed SDK. That's the check this example exists for: webpack 4 resolvingrollbar/replaythroughreplay/package.json. If that breaks, CI fails. What nobody checks is whether the page runs; a browser test that loads a fresh build would add that.Validation (Node 22, npm 10)
npm pack, then a freshnpm installandnpm run buildin the example, asvalidate:examplesdoes. The build succeeds,main.js(529 KiB) bundles rrweb androllbar.replay, andindex.htmlloads/examples/react-replay-webpack4/dist/main.js.git statusstays clean afterward because the output is ignored./api/1/session/after the error item.git merge-tree).Not in this PR
examples/react-16/dist/andexamples/webpack/dist/have the same problem, but existing tests load them.test/examples/react.test.tsandtest/examples/webpack.test.tsrun against committed bundles of rollbar.js 2.7.1 and 2.13.0 from 2019, not the current SDK. Fixing those means changing how those tests get their build, so it's a separate change.🤖 Generated with Claude Code