You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Many deps externaled (electron, react, redux, codemirror, lodash, moment, prettier) — loaded via `<script>` tags, not bundled (see `webpack-skeleton.js`)
47
47
- CSS Modules via `react-css-modules` + Stylus; class pattern `[name]__[local]___[path]`
48
-
-**Webpack `process` shim:** Webpack 1 injects `process.versions = {}`. Any dep reading `process.versions.node` at module load (e.g. `fs-extra@7+`) crashes. Pin such deps or external them.
48
+
-`.babelrc` target `ie: 11` — full ES5 transpile, required to match ES5 HOC pattern in `react-css-modules` and friends. See CLAUDE.md "Babel target quirk" before changing.
49
+
- Terser `keep_classnames`, `keep_fnames`, `ecma: 5` in webpack-production.config.js — preserves ES5 output and readable names.
49
50
50
51
## Dependency quirks
51
52
52
-
-**uuid v11 broken with Webpack 1:** uuid v11 CJS dist uses ES2020+ syntax (optional chaining, nullish coalescing). Webpack 1's bundled acorn parser cannot handle it. Keep uuid pinned to `^9.0.1`.
53
-
-**uuid CVE (GHSA-j3pc-g49g-gw9v):** Only affects `v3()/v5()/v6()` with external output buffers. Our usage is `v4()` only — not affected.
53
+
-**uuid v11 now supported (v0.20.0):** acorn 8 in webpack 5 parses ES2020 syntax. uuid pinned to `^11.1.1`. Code uses `v4()` only.
54
54
-**`request` removal:** Removed from tree by deleting unused `jsdom@^9.4.2` and `grunt-electron-installer` devDeps. The `grunt-electron-installer` also pulled in `uuid@3.x` (function-call API), which conflicted with modern uuid resolution.
55
55
-**Windows installer removed:**`grunt-electron-installer` + `create-windows-installer` grunt task removed. Re-add when Windows builds are needed.
56
56
-**Yarn resolutions preferred:** Use `"resolutions"` in package.json to pin transitive deps rather than bumping dep ranges directly — minimizes lockfile churn.
Copy file name to clipboardExpand all lines: CLAUDE.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,9 +54,9 @@ Webpack aliases: `lib` → `./lib`, `browser` → `./browser`. These are used th
54
54
55
55
## Toolchain quirks
56
56
57
-
-**Webpack 1 + Babel 6**— loader chains use `!` syntax (e.g. `style!css?modules!stylus`), not the modern `use:[]` form.
57
+
-**Webpack 5 + Babel 7**(migrated in v0.20.0 from webpack 1 + babel 6). `module.rules` array form; loader options under `options:` object. `targets: { ie: 11 }` in `.babelrc` forces full ES5 transpile — required to keep ES5 HOCs (`react-css-modules`) compatible with user code (see "Babel target quirk" below). Terser `keep_classnames + keep_fnames + ecma:5` in webpack-production.config.js preserves the ES5 output through minify.
58
58
-**Externals:** electron, react, redux, codemirror, lodash, moment, prettier are loaded via `<script>` tags in the HTML skeleton (`webpack-skeleton.js`), not bundled. Do not attempt to import them as if they were bundled.
59
-
-**`process` shim:** Webpack 1 injects `process.versions = {}`. Any dep reading`process.versions.node` at module load (e.g. `fs-extra@7+`) crashes. Pin such deps or external them.
59
+
-**`process` shim (legacy webpack 1 quirk, mostly resolved in webpack 5):** Webpack 5 with `target: 'electron-renderer'` uses real Node's`process` — no shim. `resolve.fallback: false` for all node built-ins in `webpack-skeleton.js` because `nodeIntegration: true` loads modules through real Node, not webpack polyfills.
60
60
-**CSS Modules** via `react-css-modules` + Stylus. Class name pattern: `[name]__[local]___[path]`.
61
61
-**HMR dev:** Manual refresh needed when editing constructors or adding new CSS classes (registered at construction time).
62
62
@@ -142,10 +142,23 @@ The `-v /app/node_modules` anonymous volume preserves the container's `node_modu
142
142
143
143
## Outstanding security work (next priorities)
144
144
145
-
Ordered by runtime impact (renderer-bundled first, build-only / blocked last). Items already applied or explicitly skipped live in the **Dependency policy** section above.
145
+
All previously blocked items cleared by v0.20.0 webpack 1→5 + babel 6→7 migration (see `.claude/plans/UpgradePlan_Webpack5_Zero_Alerts.md`). Open Dependabot alerts: **0**.
146
146
147
-
1.**`markdown-it` 5.1.0 and 8.4.2** still pinned by transitive consumers (`@enyaxu/markdown-it-anchor@5`, etc.); resolve to the already-locked 12.3.2 via the `resolutions` block once the parser-plugin chain (footnote, kbd, anchor) is verified.
148
-
2.~~**Mermaid tier B / C** (`~9.3.0` then `^9.4.3`)~~ — **empirically blocked 2026-05-28**: 9.3.0's UMD ships ES2019 optional-catch syntax that webpack 1's acorn 5.7.4 cannot parse. Defer to webpack 1 → 2+ migration.
149
-
3.**Webpack 1 ceiling** — `webpack-dev-server@1.16.5`, `loader-utils@0.2.17`, `postcss 5.x`, `braces 1.x/2.x`, `babel-traverse 6.26`, `uuid >= 10`, `mermaid 10+`, `markdownlint >= 0.12`, `json5 2+`. All gated on webpack 1 → 5 migration (which brings acorn 8+ for ES2020/ES2019 syntax). Out of scope for incremental work.
147
+
1.**`markdown-it` 5.1.0 and 8.4.2** still pinned by transitive consumers (`@enyaxu/markdown-it-anchor@5`, etc.); resolve to the already-locked 12.3.2 via the `resolutions` block once the parser-plugin chain (footnote, kbd, anchor) is verified. Not a CVE; bundle-dedup improvement.
148
+
2.**markdownlint 0.11 → 0.34+** still pending. 0.34+ is ESM-only requires dynamic `await import(...)` in `browser/components/CodeEditor.js:31`. No CVE in alert list — not urgent.
4.~~**Electron renderer `vm` deprecation warning** — **Suppressed 2026-05-28** via `app.commandLine.appendSwitch('disable-features', 'V8VmDeprecation')` in `lib/main-app.js`. vm is still functional through Electron 42.~~
151
151
5.~~**Electron 14→42** — **Completed 2026-05-28** in 4 phases. See `.claude/plans/UpgradePlan_Electron14_to_Latest.md`.~~
152
+
153
+
## Babel target quirk (v0.20.0)
154
+
155
+
`.babelrc` uses `targets: { ie: 11 }` — full ES5 transpile of user code. This is deliberate, not legacy. **Do not change to a modern target** (electron, chrome, defaults) without reading this section.
156
+
157
+
Reason: several node_modules deps ship pre-transpiled ES5 with `_inherits` HOC pattern that wraps user components via `class WrappedComponent extends UserComponent` → at runtime `_Component.apply(this, arguments)`. When user code is ES6 class, calling it via `.apply(this, ...)` (no `new`) triggers V8's "Class constructor X cannot be invoked without 'new'" error. Specifically affects:
158
+
159
+
-`react-css-modules@4.7.11` (`dist/extendReactClass.js`) — wraps Main + every CSS-Modules-styled component
160
+
- Other suspects with ES5 HOC pattern: `react-debounce-render`, `react-autosuggest@10`, `react-image-carousel`, `react-composition-input`, `react-sortable-hoc`, `react-color`, `connected-react-router`
161
+
162
+
Forcing user code to ES5 (matching the deps' transpile level) avoids the cross-class boundary. Verified by inspecting `compiled/main.js`: contains `function Main(a)` (not `class Main`), 87 `_inherits` helpers — all ES5.
163
+
164
+
Webpack-production.config.js terser also pinned to `ecma: 5` for the same reason — `keep_classnames: true, keep_fnames: true` keep names readable in stack traces for debugging without restoring ES6 syntax.
0 commit comments