Eirik Vullum: JavaScript Metaprogramming - ES6 Proxy Use and Abuse | JSConf Budapest 2017

  Рет қаралды 36,395

JSConf

JSConf

Күн бұрын

Пікірлер
@sab611
@sab611 6 жыл бұрын
I still think he should have gotten an applause for [Function: Undefined]!
@sohamparekh6765
@sohamparekh6765 2 жыл бұрын
This talk is just marvellous! Clean explanation of core concepts backed by a real world use case. I wish I could attend this in person at the time
@FredrikChristenson
@FredrikChristenson 6 жыл бұрын
Dear god don't let DSL and custom syntax become a trend in Javascript.
@raybbo
@raybbo 7 жыл бұрын
Just something quick to add, I'm totally for using this to create observalbe objects! Especially when you're linking your objects directly to DOM manipulation or something.
@sobanya_228
@sobanya_228 6 жыл бұрын
Safe Null is actually the first thing came to my mind, when I've seen proxies.
@abhaytalks05
@abhaytalks05 5 жыл бұрын
Thanks Eirik, Proxies now make sense to me.
@ashmig
@ashmig 5 жыл бұрын
Great introduction to Proxy and Reflection! Thanks for talk and nice and clear examples!
@raybbo
@raybbo 7 жыл бұрын
I fully understand Proxies now, thanks! However, I don't quite understand how Proxies would support the readability and maintainability of your code. The developer would really have to document this well for this to work. Binding your data client-side like this doesn't make sense to me either, I much rather have the server deliver the data to me when I really need it instead of delivering bulk data like this.
@h3rteby
@h3rteby 6 жыл бұрын
Vue and MobX use Proxies to create observables for their reactivity systems. But yeah I don't think they belong in regular application code, they're too "clever". But for frameworks/packages they have their uses.
@micalevisk
@micalevisk 6 жыл бұрын
slides: slides.com/eiriklv/javascript-metaprogramming-with-proxies-41
@MartinOfSomeName
@MartinOfSomeName 7 жыл бұрын
Your "undefined proxy" would result in some very painfull debugging, as it hides the origin of the missing data and silences errors. Your program might not crash, but having "undefined" in every place of the UI is not exactly what I would call a win. Maybe using your seatbelt() function to generate more useful errors and/or safeguard accessing undefined object properties would be much more helpful.
@johnyepthomi892
@johnyepthomi892 2 жыл бұрын
If you think he doesn’t t know that , you’re a fool. He is merely demonstrating various things that can be done using proxies and having fun at the same time. There can be cases where you may need it too.
@rahimeinollahi1
@rahimeinollahi1 3 жыл бұрын
Awesome info is on this video...
@codewithsheikh2805
@codewithsheikh2805 Жыл бұрын
Real question is as a frontend developer or as node developer do i really need it ?
@PradeepMahato007
@PradeepMahato007 4 жыл бұрын
Intriguing insights !! Thanks...
@FrancoisLecroart
@FrancoisLecroart 7 жыл бұрын
Populate can be done with getter and setter. No need for proxy. I love the second example 😍 And a little sad that we can't replace object prototype. It would have been really fun 😎🤣
@MartinOfSomeName
@MartinOfSomeName 7 жыл бұрын
This can be done even without getters/setters, you just need to track circular references. BTW - you can replace object's prototype using Object.setPrototypeOf (look it up on developer.mozilla.org).
@maximemoreau711
@maximemoreau711 6 жыл бұрын
Hm, I think that's overkill... (the second example).
@h3rteby
@h3rteby 6 жыл бұрын
You don't even need to track circular references. Just go through all the objects and replace the string references with real references to that object, and you're done. It seems like the speaker thinks that when you assign an object to a property in JS, it gets copied, but you only create a reference. Because of this, circular references are not a problem at all.
@kuhaniresti
@kuhaniresti Жыл бұрын
FragmentjJS uses Proxy for creating magical reactivity
@JaeTask
@JaeTask 5 жыл бұрын
Thanks for this, a great talk
@SolidCode
@SolidCode 7 жыл бұрын
Very interesting!
@AinurEru
@AinurEru 6 жыл бұрын
Graph can be accomplished with properties (getters?) alone - not sure how it'd be in JavaScript, but here's how it'd be in python - with 2 versions (story-centric vs person-centric) people = [] stories = [] class Person(object): def __init__(self, name): self.name = name self.read = [] self.liked = [] self.authored = [] @property def authored(self): return [story for story in stories if self is story.author] class Story(object): def __init__(self, title, author): self.title = title self.author = author @property def liked_by(self): return [person for person in people if self in person.liked] @property def read_by(self): return [person for person in people if self in person.read] class Story(object): def __init__(self, title, author): self.title = title self.author = author self.read_by = [] self.liked_by = [] class Person(object): def __init__(self, name): self.name = name @property def authored(self): return [story for story in stories if self is story.author] @property def liked(self): return [story for story in stories if self in story.liked_by] @property def read(self): return [story for story in stories if self in story.read_by]
@h3rteby
@h3rteby 6 жыл бұрын
You don't even need to use getters in JS. When you assign an object to a property, it doesn't get copied, you create a reference. Because of this, there's actually no problem to have circular references, it won't lead to "infinity" as the speaker said.
@ukranaut
@ukranaut 4 жыл бұрын
cool
@sawilliams
@sawilliams 4 жыл бұрын
Lisp did all this 30 years ago
@shinobi1975
@shinobi1975 Жыл бұрын
Please don’t use this in your code with a team unless you have great documentation for it.
Asynchrony: Under the Hood - Shelley Vohr - JSConf EU
25:24
The Wizardry of Metaprogramming
30:23
PyCon AU
Рет қаралды 10 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Dan Callahan: Practical WebAssembly | JSConf Budapest 2017
36:06
JavaScript Metaprogramming - Dave Fancher - NDC London 2022
58:26
NDC Conferences
Рет қаралды 4,7 М.
Jafar Husain: Async Programming in ES7 | JSConf US 2015
32:57
So You Think You Know Git - FOSDEM 2024
47:00
GitButler
Рет қаралды 1,3 МЛН
The Power of JS Generators by Anjana Vakil
36:10
JSConf
Рет қаралды 169 М.
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 572 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН