Skip to content

Stop committing the react-replay-webpack4 build - #1499

Merged
brianr merged 2 commits into
masterfrom
fix/react-replay-webpack4-fixture
Sep 28, 2026
Merged

brianr merged 2 commits into
masterfrom
fix/react-replay-webpack4-fixture

Conversation

@brianr

@brianr brianr commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

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.

  • It never loaded. dist/index.html pointed to /examples/replay-react-webpack4/, with the words swapped and no file name, so it 404s.
  • It had no replay code. Replay bundling scheme, with replay/package.json, keep standard ones without replay #1388 copied dist/main.js byte-for-byte from the react-16 fixture. It was the plain rollbar bundle, with no rrweb and no rollbar/replay.
  • Nothing uses it or updates it. No test loads this page. Root npm run build never rebuilds example dist/ folders. CI's validate:examples rebuilds every example but throws the output away.

Changes

  • Remove dist/ and add react-replay-webpack4/dist/ to examples/.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 production publicPath to /examples/react-replay-webpack4/dist/. It has to stay absolute because loadHtml in test/util/fixtures.ts recreates the page's scripts inside the test runner's page, so a relative src would resolve against the wrong URL. That's also how the react-16 fixture works.
  • README.md: replace the commit-the-fixture steps, which pointed at examples/react and examples/webpack/dist/, with a note that dist/ isn't committed and CI builds the example.

No source, dependency or script changes.

What still covers this example

CI's validate:examples installs and builds it against the freshly packed SDK. That's the check this example exists for: webpack 4 resolving rollbar/replay through replay/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)

  • On this branch, npm pack, then a fresh npm install and npm run build in the example, as validate:examples does. The build succeeds, main.js (529 KiB) bundles rrweb and rollbar.replay, and index.html loads /examples/react-replay-webpack4/dist/main.js. git status stays clean afterward because the output is ignored.
  • An earlier revision of this PR committed that rebuilt bundle, and I tested it in headless Chrome, served from the repo root with the Rollbar API stubbed to allow replay. The page rendered, all three buttons worked, and a replay upload with rrweb events went to /api/1/session/ after the error item.
  • Merges cleanly with Drop vulnerable dev servers from old examples (clears 13 Dependabot alerts) #1487's branch (git merge-tree).

Not in this PR

  • examples/react-16/dist/ and examples/webpack/dist/ have the same problem, but existing tests load them. test/examples/react.test.ts and test/examples/webpack.test.ts run 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T16:23:21.441649Z 258f1cf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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>
@brianr
brianr force-pushed the fix/react-replay-webpack4-fixture branch from 258f1cf to 63c141b Compare September 28, 2026 16:29
@brianr brianr changed the title Rebuild react-replay-webpack4 fixture with a working script path Stop committing the react-replay-webpack4 build Sep 28, 2026

@rollbar-circleci-machine rollbar-circleci-machine left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 to examples/ and it matches only examples/react-replay-webpack4/dist/.
  • The publicPath change at examples/react-replay-webpack4/webpack.config.js:12 fixes the transposed replay-react-webpack4 name. The deleted dist/index.html also pointed its script at /examples/replay-react-webpack4/ with no main.js, so the committed build was broken anyway.
  • Nothing else in the repo references react-replay-webpack4 or its dist/. No test in test/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-89 runs npm run validate:examples, and scripts/validate-examples.js:30-31,71 runs npm install and npm run build for every example whose rollbar dependency is file:../rollbar.tgz (examples/react-replay-webpack4/package.json:23). replay/package.json is not excluded by .npmignore, so it ships in the tarball.
  • A locally built dist/ won't trip lint or formatting: eslint.config.js:149 and .prettierignore:18 both exclude examples.

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.

Comment thread examples/react-replay-webpack4/README.md Outdated
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>
@rollbar-circleci-machine

Copy link
Copy Markdown

AI Agent Review LGTM (openai, openai-astra)

LGTM. No blocking findings were found.

LGTM. The PR stops committing the react-replay-webpack4 build output, ignores dist/, fixes a wrong publicPath and updates the maintainer notes in the README.

Verified in the checkout:

  • publicPath fix: the old value /examples/replay-react-webpack4/dist/ did not match the example's real directory. The new value /examples/react-replay-webpack4/dist/ does (examples/react-replay-webpack4/webpack.config.js:12). It only applies to npm run build, which passes --build (examples/react-replay-webpack4/package.json:5).
  • gitignore: react-replay-webpack4/dist/ in examples/.gitignore:2 is matched relative to examples/, so it covers the right directory.
  • Nothing depends on the deleted dist/: no test, config or script in the checkout mentions this example. The only React loadHtml test loads examples/react-16/dist/index.html (test/examples/react.test.ts:16). ESLint ignores examples (eslint.config.js:149).
  • README is accurate:
    • CI runs validate:examples (.github/workflows/ci.yml:88-89), which runs npm install and npm run build for every example that depends on file:../rollbar.tgz (scripts/validate-examples.js:30-31,71). This example does (examples/react-replay-webpack4/package.json:23).
    • The example imports rollbar/replay (examples/react-replay-webpack4/src/index.js:3), and replay/package.json exists as the directory-level fallback that webpack 4 would use.
    • loadHtml copies script src values into the runner's page (test/util/fixtures.ts:12-25), so the reasoning for an absolute publicPath holds.

Outside this PR's changed files: examples/react-16/webpack.config.js:12 still sets publicPath to /examples/react/dist/, while its committed examples/react-16/dist/index.html:11 loads /examples/react-16/dist/main.js. A rebuild of that example would therefore generate a script path that doesn't match its directory. That may be worth its own fix.

I did not run any tests or builds; everything above comes from reading the code.

@brianr brianr self-assigned this Sep 28, 2026
@brianr
brianr merged commit 13ccabf into master Sep 28, 2026
6 checks passed
@brianr
brianr deleted the fix/react-replay-webpack4-fixture branch September 28, 2026 18:24
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.

3 participants