Understand Braid's styling and runtime requirements
masterBraid relies on several technologies for styling and validation that may require specific bundler configurations:
Styling with Vanilla Extract
Braid uses Vanilla Extract for styling. This allows CSS to be authored in TypeScript and statically extracted at build time into atomic CSS classes. You will need a bundler plugin (like the one provided by Vanilla Extract) to collect these styles and inject them into your document or a separate stylesheet.
Runtime Assertions
Braid uses the assert library to perform precondition and invariant checking at runtime to ensure components are used correctly.
- Recommendation: To avoid performance overhead in production, use
unassertat build time (e.g., viababel-plugin-unassert) to strip these calls from your production bundle.
Dev-time Warnings
Braid provides warnings for deprecations and other communications based on process.env.NODE_ENV.
- Recommendation: Ensure your bundler (e.g., Webpack) replaces
process.env.NODE_ENVwith a hardcoded string during the build process so that minifiers can perform dead-code elimination and remove these checks from production bundles.