JavaScript Metaprogramming - ES6 Proxy Use and Abuse
summary
ES6 Proxy is an un-transpilable feature that redefines property access, assignment, function invocation and pairs with the Reflect API and revocable proxies. Examples include runtime validation and logging traps, an observable wrapper, a URL-builder DSL and a clever lazy population via proxies that lets a JSON graph be accessed “infinitely” deep without eager expansion — used successfully on a real-time project. Caveats: proxies are slower than plain objects and can be abused (e.g. a seatbelt never-undefined proxy) and can break serialization.
AI-written summary · about
chapters (25)
- 0:00Intro
- 0:42Metaprogramming
- 2:36Language Constructs / Syntax
- 3:15Operators
- 5:10Introspection
- 5:39Self-modification
- 6:25Intercession
- 9:02Proxy Server
- 10:11Proxying Objects
- 13:31Handler
- 15:11Traps
- 16:43Revocable
- 18:20Validation
- 20:45Debugging / Logging
- 22:11Observable objects
- 24:07Construction / DSLS
- 27:42Deeply accessing a JSON "graph"
- 29:48MongoDB Populate?
- 30:47Schemaless
- 31:38Naming conventions
- 32:41Object.assign (eager)
- 34:32Proxy (lazy)
- 39:21Redefining Undefined
- 40:25Seatbelts
- 42:47Why can't I do this??
related talks
26mJavaScript Metaprogramming - ES6 Proxy Use and Abuse
24mJavaScript metaprogramming with ES2015 Proxy
22mMetaprogramming, ES6 Proxy
54mMetaProgramming with JavaScript
36mMetaprogramming - A journey into ES6
50mMetaprogramming in JavaScript
27mUnlock the Proxy Power (Vue.js)
07mJS Proxy, where have you been
