The examples on this site demonstrate React code that gets transpiled at runtime to either ES6-compatible React or Preact code using different versions of the Bundless "src=bundless.PARSERNAME.[min||dev].js".
To use Preact instead of React, include the attribute to="preact" in the script tag. This allows you to switch between
React and Preact seamlessly, depending on your requirements. No changes to your codebase are required to transition to a bundler.
There are four different parsers available in these examples. Each parser has its own strengths and weaknesses, as outlined in the table below:
| Parser | Pros | Cons |
|---|---|---|
| Acorn | Lightweight, fast, and highly modular. | Limited support for advanced syntax features. |
| Babel | Comprehensive syntax support and ecosystem integration. | Slower performance compared to other parsers. |
| Meriyah | Fast and ES2020-compliant. | Smaller community and fewer plugins. |
| Sucrase | Optimized for development with fast transpilation. | Not a full parser; limited to specific transformations. |