Skip to content

chore: keep built bundles out of search; remove unused dependencies and config - #226

Draft
TobiasDuelli wants to merge 2 commits into
masterfrom
chore-cleanup-phase1
Draft

TobiasDuelli wants to merge 2 commits into
masterfrom
chore-cleanup-phase1

Conversation

@TobiasDuelli

Copy link
Copy Markdown
Collaborator

Phase 1 of the cleanup: keep built bundles out of search, and remove dependencies and config nothing uses. No behaviour change. Every built bundle is byte-identical to master, and the npm tarball differs only in package.json, by the 14 removed dependency entries.

What changes

Change Files Why
.ignore .ignore, one sentence in AGENTS.md ripgrep, and the agents' Grep and Glob built on it, skip published/ (except _headers, which is deploy config), build/ and four old bundles or minified vendor files in demo/. Git, the build, the CDN deploy and npm do not read .ignore. A path named explicitly is still searched.
unique-selector out of dependencies package.json, package-lock.json src imports the vendored copy src/unique-selector (GleapTourSelector.js:1), never the package.
9 unused devDependencies package.json, package-lock.json @babel/cli, @babel/eslint-parser, @babel/plugin-transform-runtime, @node-minify/clean-css, @node-minify/core, @node-minify/csso, babel-preset-minify, eslint (no config, no script), uglify-js (terser minifies). Found by knip, each checked by hand.
4 asset loaders and their 2 webpack rules package.json, package-lock.json, webpack.config.js style-loader, css-loader, url-loader, file-loader: src imports no CSS, image or font file.
Azure config swa-cli.config.json deleted Azure Static Web Apps CLI config. The CDN is deployed by Cloudflare (wrangler.jsonc); the Azure workflow was deleted in 2022.

Untouched: src/, index.d.ts, build/, published/, .github/workflows/.

Removing dependencies and changing webpack.config.js are stop-and-ask items in AGENTS.md; this PR is the approved first phase.

Search

From the repo root, ripgrep 14.1.1:

rg -l master this branch
startFeedbackFlow 620 files (606 in published/, 6 in build/, 2 in demo/, 5 in src/, index.d.ts) 6 files: the 5 in src/ and index.d.ts
injectSession 628 files 13 files
bb-feedback-button 712 files, 36,241 matches 7 files, 77 matches

Proof

Bundles. origin/master (fresh git archive, npm ci, npm run build) against this branch (npm ci, npm run build), Node 24.22.3. sha256 of all 13 outputs:

File Bytes master = branch
build/browser/index.js 879,904 identical
build/browser/index.js.map 2,393,031 identical
build/esm/index.mjs 879,881 identical
build/esm/index.mjs.map 2,393,016 identical
build/cjs/index.js 880,100 identical
build/cjs/index.js.map 2,394,281 identical
build/embed/survey-embed.js 3,150 identical
published/latest/ and published/19.9.0/ (index.js, .map, survey-embed.js) identical

npm tarball. npm pack on both sides: the same 11 files, and only package.json differs. Its structural diff:

- devDependencies.@babel/cli: "^7.23.9"
- devDependencies.@babel/eslint-parser: "7.23.10"
- devDependencies.@babel/plugin-transform-runtime: "^7.23.9"
- devDependencies.@node-minify/clean-css: "^8.0.6"
- devDependencies.@node-minify/core: "^8.0.6"
- devDependencies.@node-minify/csso: "^8.0.6"
- devDependencies.babel-preset-minify: "^0.5.2"
- devDependencies.css-loader: "^6.10.0"
- devDependencies.eslint: "^8.57.0"
- devDependencies.file-loader: "^6.2.0"
- devDependencies.style-loader: "^3.3.4"
- devDependencies.uglify-js: "^3.17.4"
- devDependencies.url-loader: "^4.1.1"
- dependencies.unique-selector: "^0.5.0"
removed 14, added 0, changed 0

unique-selector for customers. npm install gleap fetches one package fewer: unique-selector@0.5.0, which has no dependencies of its own. Nothing loads it at runtime:

  • The source maps of the browser, ESM and CJS bundles list 10 unique-selector sources, all under ./src/unique-selector/. The npm packages inside are only floating-ui, @rrweb/packer, @rrweb/record and modern-screenshot.
  • The built files load nothing: 0 require("…") in build/cjs/index.js and build/browser/index.js, 0 imports in build/esm/index.mjs. survey-embed.js imports nothing.
  • src imports the package 0 times.

Worth a line in the next version's CHANGELOG.md.

Lockfile. Done with npm uninstall: 886 → 726 entries, 160 removed, 0 added, 0 with a changed version, resolved or integrity, 0 flag changes. The root lists lose exactly the 14 names above. As a side effect, 10 open Dependabot alerts (6 high, 4 medium) are on packages that leave the lockfile (js-yaml, lodash, flatted, postcss-selector-parser).

Checks

  • npm run test:smoke: 8 passed, on the branch's build.
  • npx vitest related webpack.config.js package.json --run: 44 files, 1,047 tests passed. With package.json in the change, related selects every test.
  • npm run typecheck: passed.
  • node tools/quality/check.mjs: 0 problems, 0 warnings.
  • Pre-push hook: passed on push.
  • npm ls --all reports one invalid: esbuild@0.17.19, the same on master.

Next

Not in this PR:

  • The missing CDN version folders.
  • The index.d.ts fixes.
  • The ./Gleap import cycle.
  • The hotspot splits.

🤖 Generated with Claude Code

TobiasDuelli and others added 2 commits November 19, 2026 15:36
A grep for an SDK identifier hit about 600 built bundles in published/ and
build/ for every match in src/. .ignore keeps ripgrep and the tools built on
it to the code; git, the build, the CDN deploy and npm do not read it.
published/_headers stays searchable because it is deploy config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- unique-selector: src imports its vendored copy (src/unique-selector), never
  the package, so no bundle contains it.
- 9 devDependencies nothing uses: @babel/cli, @babel/eslint-parser,
  @babel/plugin-transform-runtime, @node-minify/clean-css, @node-minify/core,
  @node-minify/csso, babel-preset-minify, eslint (no config, no script),
  uglify-js (terser minifies).
- style-loader, css-loader, url-loader, file-loader and their two webpack
  rules: src imports no CSS, image or font file.
- swa-cli.config.json: Azure Static Web Apps, replaced by the Cloudflare
  deploy; its workflow is long gone.

Removed with npm uninstall: the lockfile only loses entries (160), with no
version changes. Every built bundle is byte-identical to master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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