ES5 shim for ES6 Reflect and Proxy objects, providing compatibility for older JavaScript environments.
Harmony-reflect is an ES5 shim that provides implementations of the ES6 Reflect and Proxy objects for environments lacking native support. It solves the problem of using modern JavaScript reflection and proxy features in older browsers or Node.js versions before v6.0.0, ensuring compatibility across different JavaScript runtimes.
JavaScript developers working on projects that need to run on older environments but want to use ES6 metaprogramming features like proxies and reflection APIs.
Developers choose harmony-reflect because it offers a reliable, spec-compliant shim for critical ES6 features, enabling advanced object interception and reflection without requiring engine upgrades. Its ability to patch global methods ensures consistent proxy behavior across patched environments.
ES5 shim for ES6 Reflect and Proxy objects
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works on older environments like Firefox 4+ and Node.js with harmony flags, patching global methods (e.g., Object.getOwnPropertyDescriptor) to recognize proxies.
Defines a full Reflect API and updates Proxy to align with ES6 specifications, enabling consistent metaprogramming features in pre-ES6 runtimes.
Implements all proxy traps, allowing advanced object interception for use cases like membranes and observers, as shown in the examples directory.
Allows developers to use ES6 reflection and proxy features without upgrading JavaScript engines, bridging gaps for libraries and legacy code.
The README states native support is now common in major browsers and Node.js v6+, making the shim unnecessary overhead for many projects.
Includes removed traps like enumerate() and has incompatibilities with Symbol objects, leading to potential bugs in newer spec contexts.
In Node.js, globals are only patched in the requiring module, causing inconsistencies (e.g., Array.isArray returning false) when proxies interact with external code.
Requires enabling harmony flags (e.g., --harmony-proxies) and managing environment-specific configurations, adding complexity to integration.