LearnNewsExamplesServices
Frontmatter
id10108
titleDecide me=this policy across the repo — standardize or document the frontend/Node.js boundary
stateClosed
labels
documentationenhancementaiarchitecture
assigneesneo-gpt
createdAtApr 19, 2026, 7:48 PM
updatedAtJun 7, 2026, 6:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/10108
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 7, 2026, 6:30 PM

Decide me=this policy across the repo — standardize or document the frontend/Node.js boundary

Closed v13.0.0/archive-v13-0-0-chunk-5 documentationenhancementaiarchitecture
tobiu
tobiu commented on Apr 19, 2026, 7:48 PM

Summary

Coding-guidelines rule (.github/CODING_GUIDELINES.md §34): "Create variables for every item which you use more than 2 times. This rule also counts for this." → applied extensively in frontend (src/), NOT applied in Node.js (ai/, buildScripts/). Captured in session memory project_core_base_conventions.md.

The me = this pattern has multi-decade rationale (pre-fat-arrow scoping + minified-bundle-size savings in production) but that rationale DOESN'T apply equally to both environments:

  • Frontend: bundled + minified via Webpack/Terser → me compresses smaller than this. Pattern pays off.
  • Node.js: no bundling, no minification → bundle-size argument collapses. Pattern is cognitive overhead without payoff.

So the boundary is either (a) intentional, with rationale that should be documented, or (b) accidental drift across different authors / time periods.

This ticket forces a decision + codifies it.

Options

A) Standardize everywhere — apply me = this in Node.js too. Wins: consistency across environments; one rule to remember. Losses: cognitive tax for Node.js readers who don't get bundle-size benefit.

B) Keep frontend-only + document the boundary — extend CODING_GUIDELINES.md §34 to explicitly state "applies to bundled frontend code (src/) only; in Node.js code (ai/, buildScripts/, etc.) use this directly since bundle-size isn't a concern." Wins: honors the actual rationale; removes ambiguity for contributors (human or LLM). Losses: two rules to remember.

C) Drop entirely — post-fat-arrow era, this scoping mostly handled by arrow functions; marginal minification savings. Wins: simpler rule; aligns with modern JS defaults. Losses: loses the bundle-size discipline Neo.mjs has been calibrated around for years; breaks a large body of existing idiomatic code.

Recommendation (open to challenge)

Option B. The bundle-size rationale is real and specific to the frontend environment. Codifying the boundary in the guidelines converts tribal knowledge into reviewable policy. Option A adds overhead without benefit in Node.js; option C loses a deliberate performance-discipline pattern.

Acceptance Criteria

  • Decision documented in .github/CODING_GUIDELINES.md §34 with explicit environment boundary
  • If option A chosen: sweep ai/ + buildScripts/ to apply the pattern consistently (separate sub-tickets acceptable)
  • If option C chosen: sweep src/ + workspace apps to remove the pattern (staged migration; don't squash the history)
  • If option B chosen (recommended): documentation-only; existing code untouched

Related

  • Session memory: project_core_base_conventions.md
  • Coding guidelines: .github/CODING_GUIDELINES.md §34 (variable reuse rule, currently ambiguous about environment boundary)
  • Adjacent discipline: §35 (const economy, similar bundle-size-rationale territory)

Origin Session ID: 1db25bbe-f39d-4dcd-bb0e-bc125ce91326

tobiu added the enhancement label on Apr 19, 2026, 7:48 PM
tobiu added the ai label on Apr 19, 2026, 7:48 PM
tobiu added the architecture label on Apr 19, 2026, 7:48 PM
tobiu cross-referenced by #10030 on Apr 19, 2026, 7:53 PM
tobiu referenced in commit 3ba68a5 - "docs(guidelines): document me-this runtime boundary (#10108) (#12688)" on Jun 7, 2026, 6:30 PM
tobiu closed this issue on Jun 7, 2026, 6:30 PM