Skip to content

chore: snap build tooling cleanup (babel config, preinstalled builds, manifest locales) - #264

Open
ulissesferreira wants to merge 4 commits into
mainfrom
chore/snaps-team-audit-improvements
Open

chore: snap build tooling cleanup (babel config, preinstalled builds, manifest locales)#264
ulissesferreira wants to merge 4 commits into
mainfrom
chore/snaps-team-audit-improvements

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Explanation

This PR is a round of Snap build/tooling cleanup identified during a quick audit from the Snaps team:

  • Removed babel.config.js from the bitcoin-wallet-snap, stellar-wallet-snap, and tron-wallet-snap packages. These per-package Babel configs are no longer needed, and the corresponding documentation reference was removed from AGENTS.md.
  • Replaced the custom build-preinstalled-snap.js scripts in all four wallet Snaps (bitcoin, solana, stellar, tron) with the built-in mm-snap build --preinstalled flag. The preinstalled snap options (removable: false, hideSnapBranding: true) now live in each package's snap.config.ts, and the build scripts in package.json were simplified accordingly (locale generation now runs after mm-snap build). The now-unused script entries were also removed from eslint-suppressions.json.
  • Removed locales from snap.manifest.json for all four wallet Snaps.
  • Kept blanket polyfills: true in every snap.config.ts (including the create-package snap template, previously polyfills: false). Explicit per-snap polyfill allowlists were evaluated and discarded: Webpack only bundles polyfills that are actually imported after minification, so explicit sets produce byte-identical bundles to polyfills: true — bundle sizes were compared against main and are unchanged for all four Snaps. The remaining fs/module fallback warnings for tron-wallet-snap are pre-existing and come from node-only code paths that are unreachable in-browser.

There are no runtime behavior changes to the Snaps themselves; this only affects how the preinstalled snap artifacts are generated at build time.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@ulissesferreira
ulissesferreira requested review from a team as code owners September 3, 2026 13:30
@ulissesferreira
ulissesferreira force-pushed the chore/snaps-team-audit-improvements branch 2 times, most recently from ec61ea5 to af89a2d Compare September 3, 2026 15:02
@ulissesferreira
ulissesferreira force-pushed the chore/snaps-team-audit-improvements branch from af89a2d to 7fb5a3b Compare September 3, 2026 15:14
"locales/tr.json",
"locales/vi.json",
"locales/zh_CN.json"
]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This does not do whatever you think it does 😅. It's only used to localize some Snap manifest fields like name and description, which are never seen by our users because the Snap is preinstalled. If you are wondering about the localization text in json's that will be bundled automatically without a problem (doesn't have to be referenced here, it's just code).

"registry": "https://registry.npmjs.org/"
}
},
"locales": ["locales/en.json"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This does not do whatever you think it does 😅. It's only used to localize some Snap manifest fields like name and description, which are never seen by our users because the Snap is preinstalled. If you are wondering about the localization text in json's that will be bundled automatically without a problem (doesn't have to be referenced here, it's just code).

"registry": "https://registry.npmjs.org/"
}
},
"locales": ["locales/en.json"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This does not do whatever you think it does 😅. It's only used to localize some Snap manifest fields like name and description, which are never seen by our users because the Snap is preinstalled. If you are wondering about the localization text in json's that will be bundled automatically without a problem (doesn't have to be referenced here, it's just code).

"registry": "https://registry.npmjs.org/"
}
},
"locales": ["locales/en.json"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This does not do whatever you think it does 😅. It's only used to localize some Snap manifest fields like name and description, which are never seen by our users because the Snap is preinstalled. If you are wondering about the localization text in json's that will be bundled automatically without a problem (doesn't have to be referenced here, it's just code).

experimental: { wasm: true },
preinstalled: {
removable: false,
hideSnapBranding: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
hideSnapBranding: true,
hideSnapBranding: true,
hidden: true,

In the CLI this has to be explicit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed ✅

@ulissesferreira
ulissesferreira force-pushed the chore/snaps-team-audit-improvements branch from 7fb5a3b to f430b2b Compare September 3, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants