Hacking the JavaScript using Proxies and Reflection || Hacking JS with Proxy || Erick Wendel

Hacking the JavaScript using Proxies and Reflection || Hacking JS with Proxy || Erick Wendel

Erick Wendel

54 года назад

7,314 Просмотров

The Proxy object enables you to create a proxy for another object, which can intercept and redefine fundamental operations for that object.

If you have watched my video about the JavaScript decorators proposal you'll find this very alike.

Decorators and the Proxy object have the same goal. They help us intercept and/or override behaviors in Functions, classes, or objects.

We're gonna build an application to inspect how long a function takes to finish and print it out on the screen by just decorating our function with an extension

We'll also use metaprogramming practices by using the JavaScript Reflect object to retrieve class names, functions, and much more.

Are you ready? Then let's begin.

✅ LINKS

▸Source code: https://github.com/ErickWendel/hacking-js-with-proxies-and-reflection.git

▸Mastering Node.js Streams Training: https://bit.ly/nodejs-streams-training
▸ Telegram channel: https://bit.ly/ErickWendelContentHub
▸ My courses: http://bit.ly/ew-courses-yt

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
https://www.keithcirkel.co.uk/metaprogramming-in-es6-part-3-proxies/

✅ FOLLOW ME

▸ Linkedin: https://linkedin.com/in/erickwendel
▸ Blog: https://erickwendel.com.br/
▸ Facebook: https://fb.com/page.erickwendel
▸ Medium: https://medium.com/@erickwendel
▸ Twitter: https://twitter.com/erickwendel_

✅ TIMELINE

00:00 - SUBSCRIBE NOW
00:03 - Introduction
01:00 - Content about Node.js and JavaScript
01:28 - The node.js version required for this class
01:37 - Creating a JavaScript class
03:01 - Intercepting a function using JS Proxies
04:50 - Simulating the behavior of Decorators with the JS Proxy
06:53 - Getting all the function names using the Reflect Object
07:56 - Using the Proxy object to intercept functions (hack!)
10:19 - Intercepting properties or objects with proxy
10:48 - Getting how long a function took to finish
11:31 - Final considerations
13:07 - Thank you!

#JavaScriptHacking #ProxyProgramming #ReflectionProgramming #ErickWendel #WebSecurity #WebDevelopment #SoftwareDevelopment #FrontendDevelopment #BackendDevelopment #JavaScriptTricks #JSProgramming #JSDevelopment #JavaScriptTips #ProgrammingTips #CodingTips #WebDevTips #WebDevTricks #CodeOptimization #CodeEfficiency #CodeImprovement #CodeDebugging #WebSecurityTips #WebSecurityTricks #ProgrammingCommunity #CodingCommunity #CodeNewbie #ProgrammingConcepts #ProgrammingTechniques #CodeDecorators

Тэги:

#hacking_the_javascript_using_proxies_and_reflection #hacking_javascript_using_proxy #hacking_javascript_using_reflection #hacking_javascript #hacking_js #hacking_js_using_proxies_and_reflection #Erik_Wendel #hacking_Javascript_usin_proxies_and_reflections_with_erick_wendel #proxies_and_reflections #javascript #metaprogramming #reflection #proxy #reflect #performance #javascript_tutorial #javascript_course #javascript_for_beginners #how_to_hack_javascript_using_proxies_and_reflections #how
Ссылки и html тэги не поддерживаются


Комментарии: