Skip to content

Investigate minifyIdentifiers: false workaround in minify.js #312

Description

@bjagg

Context

PR #303 added a build-time minify.js script using esbuild. The JS minification config disables identifier mangling:

const result = await esbuild.build({
    entryPoints: [file],
    minify: true,
    minifyWhitespace: true,
    minifyIdentifiers: false, // Disable to prevent breaking object property access
    minifySyntax: true,
    write: false
});

Problem

The comment claims this prevents breaking object property access like layout.navigation.tabs.externalId. But esbuild's identifier mangling shouldn't affect property access — it only mangles top-level identifiers in module scope, not object property names. This workaround may be hiding a real bug.

Disabling minifyIdentifiers also reduces the size benefit of minification. Before accepting this as the permanent solution, we should understand what actually broke.

Investigation steps

  1. Re-enable minifyIdentifiers: true in a test build
  2. Identify which file(s) break and how
  3. Determine whether the break is:
    • A legitimate esbuild bug (file upstream)
    • A code pattern that needs fixing in the source (e.g., using string literals for property access that confuse bundlers)
    • Actually a non-issue that was misdiagnosed

Priority

Low — post-release investigation. Filing as a follow-up to PR #303.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions