Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Direct ProxiesでObject.observeの Polyfillはできるのか
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kazuhito Hokamura
December 18, 2014
Programming
690
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Direct ProxiesでObject.observeの Polyfillはできるのか
Kazuhito Hokamura
December 18, 2014
More Decks by Kazuhito Hokamura
See All by Kazuhito Hokamura
TypeScriptとGraphQLで実現する 型安全なAPI実装 / TSKaigi 2024
hokaccha
5
5.1k
Kotlin製のGraphQLサーバーをNode.jsでモジュラモノリス化している話
hokaccha
0
3.8k
GraphQLの負債と向き合うためにやっていること
hokaccha
2
1.6k
ユビーのアーキテクチャに対する取り組み
hokaccha
1
490
RailsエンジニアのためのNext.js入門
hokaccha
7
22k
Cookpad Summer Internship 2021 Web Frontend
hokaccha
0
7.4k
巨大なモノリシック Rails アプリケーションの マイクロサービス化戦略 / 2019 microservices in cookpad
hokaccha
3
4.1k
巨大なRailsアプリケーションを「普通」にするための取り組み
hokaccha
1
1.1k
Web Frontend Improvement in Cookpad
hokaccha
1
1.2k
Other Decks in Programming
See All in Programming
霧の中の代数的エフェクト
funnyycat
1
320
OS アップデート対応の取り組み方がもっと共有されてほしい
andpad
0
110
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
170
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
480
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
150
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
400
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
840
AIエージェントで 変わるAndroid開発環境
takahirom
2
470
Vite+ Unified Toolchain for the Web
naokihaba
0
720
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.8k
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
5.3k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
240
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
So, you think you're a good person
axbom
PRO
2
2.1k
Prompt Engineering for Job Search
mfonobong
0
370
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
390
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
170
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
260
Discover your Explorer Soul
emna__ayadi
2
1.2k
Transcript
Direct ProxiesͰObject.observeͷ PolyfillͰ͖Δͷ͔
None
Object.observe Object.observe(obj, (changes) => { // do something }); •
objΛมߋ͢Δͱhandler͕ؔݺΕΔ
Direct Proxies var proxy = new Proxy(obj, { set(target, name,
val, receiver) { // do something } }); • objΛҾͱͯ͠৽ͨͳཧΦϒδΣΫτʢproxyʣΛಘΔ • proxyΛૢ࡞ͨ࣌͠ʹhandler͕ݺΕΔ • objΛૢ࡞ͯ͠handlerݺΕͳ͍
͜ͷAPIΛPolyfill͢Δ ͷແཧͰɾɾʁ Object.observe(obj, (changes) => { // do something });
ProxyͷPolyfillϥΠϒϥϦ
None
harmony-reflect/examples/observer.js
͍͚ͦ͏ʂʂ
ͳΜ͔ΤϥΔɾɾ // Firefox 36.0 Observer(Object); // enable polyfill var obj
= {}; Object.observe(obj, handler); //=> uncaught exception: can only get notifier of observable objects, given [object Object]
͜͏͢Δඞཁ͕͋ΔΒ͍͠ var obj = {}; var o = Object.createObservable(obj); Object.observe(o,
handler);
Q: Direct ProxiesͰObject.observeͷ PolyfillͰ͖Δͷ͔
A:ʢͨͿΜʣແཧ
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ