Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PHPerから見た昨今のJSについて
Search
polidog
PRO
March 14, 2015
Technology
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPerから見た昨今のJSについて
polidog
PRO
March 14, 2015
More Decks by polidog
See All by polidog
omasushiというライブラリを作った
polidog
PRO
0
250
RelayerというPHPのフレームワークを作った
polidog
PRO
0
200
AIがコードを書く時代の ジェネレーティブプログラミング
polidog
PRO
3
1.3k
小さな開発会社を作った理由(再)
polidog
PRO
0
320
React Server ComponentsでAPI不要の開発体験
polidog
PRO
1
940
小さな開発会社が受託開発に力を入れる理由
polidog
PRO
0
560
小さな開発会社を作った理由
polidog
PRO
1
3.7k
小さな開発会社がWebサービスを作る理由
polidog
PRO
1
890
トランザクションスクリプトは何がダメなのか?
polidog
PRO
2
4.1k
Other Decks in Technology
See All in Technology
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
150
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
210
Von-Neumann Machines, Dreams & The Futures of IT
ufried
0
100
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
860
What the customer really needed
kawaguti
PRO
3
210
Goodbye ShellScript, Hello File-based App
shunsock
0
260
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
120
AIで社員の自主発信に広報目線を組み込む
_mossann_t
0
130
.NET WebAssemblyで実現するクライアントサイドAI推論:NuGetからViteまで、2つのエコシステムを繋ぐビルド戦略
yamachu
0
190
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.3k
事業課題から技術的負債に向き合う
sansantech
PRO
2
2k
「ピッケル本」日本語版は4.0(第6版)が出版されるべき / pickaxe4-nagoyark05
kakutani
2
190
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
550
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
A designer walks into a library…
pauljervisheath
211
25k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
520
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
810
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
360
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
PHPer͔ΒݟͨࡢࠓͷJSʹͭ ͍ͯ ੩ԬJavaScriptษڧձ #3 @polidog
ࣗݾհ • ϙϦυοάͰ͢ɻ݄ྋଠͬͯݴ͍·͢ɻ • ਗ਼ਫࢢੜ·Εɻਗ਼ਫ۠ҭͪɻ • PHPerͰ͢ɻJS࣌ʑॻ͖·͢ɻ • SymfonyϢʔβʔձͷਓʹͳΓ·ͨ͠ɻ •
λϰΟίϜגࣜձࣾͰΤϯδχΞͬͯ·͢ɻ
ࠓ͍ͨ͜͠ͱ
ͦͷલʹએ
λϰΟίϜͰɺgotripͱ͍ ͏ϝσΟΞͬͯ·͢ɻ http://gotrip.jp/
Symfony Meetup։࠵͠· ͢ʂ https://symfony.doorkeeper.jp/events/ 21692
ࠓ͍ͨ͜͠ͱ
ECMA Script6!!
– @nakajmg “ࠓ͔Β֮͑ΔͳΒCoffeeScriptΑΓES6 ͩΑɻ”
ͱ͜ΖͰESͬͯʁ
–ɹWikipediaΑΓ “Ecma InternationalʹΑͬͯඪ४Խ͞Ε ͨεΫϦϓτݴޠͰ͋Δɻ࣮͝ͱͷޓ ੑ͕͍ JavaScript ྨʢಛʹ JScriptʣ ͷඪ४ΛఆΊͨͷͰ͋Δɻ”
ES6ͰՃ͞ΕΔ
Features https://github.com/lukehoban/es6features
ࠓ͢ػೳ 1. ؔ(Arrow functions,Function Argumentss) 2. ม(let + const) 3.
Ϋϥε(classes) 4. δΣωϨʔλͱfor of 5. άϩʔόϧΦϒδΣΫτ(Map,Set, WeakMap, WeakSet) 6. Promises
1. ؔ var test = a => { console.log(“execute!! :
”+a); } function a(x, y=12) { } function b(x, ...y) { } function c(x,y,z) {} args = [1,2,3] c(…args);
1. ؔ(ArrowFunctions) =>ΛͬͯؔఆٛͰ͖Δ Ҿෳ (a,b) => ͱͳΔ ෳߦͷ߹{}Λ͏
1. ؔ(FunctionArguments) ؔύϥϝʔλʹʹσϑΥϧτ͕ઃఆͰ͖ Δɻ ՄมҾΛ…argsͰࢦఆͰ͖Δɻ ྻΛؔҾʹల։Ͱ͖Δɻ
2. ม let hoge = 1; const fuga = 2;
2. ม letΛ͏ͱϒϩοΫείʔϓ͕࣮ݱͰ͖Δɻ constΛ͏ͱ্ॻ͖Ͱ͖ͳ͍ɻ
3. Ϋϥε class Hoge { } var hoge = new
Hoge();
3. Ϋϥε ΫϥεએݴͰॻ͚Δɻ extendsͰܧঝͰ͖Δɻ superͰܧঝݩͷϝιουݺͼग़ͤΔɻ
4. δΣωϨʔλͱfor of let gen = function*() { for(let i
= 0; i < 10; i++) { yield i+10; } } for (let i of gen()) { console.log(i) }
4. δΣωϨʔλͱfor of function* ͱ yieldΛ͏ for of ͰϧʔϓͰ͖Δ ArrowFunctionͱΈ߹ΘͤΒΕͳ͍
5. άϩʔόϧΦϒδΣΫτ var set = new Set(); set.add(“hoge”).add(“fuga”) var map
= new Map(); map.set(“hoge”,10); map.set(“fuga”,20);
5. άϩʔόϧΦϒδΣΫτ Set Map WeakSet WeakMap ͕͑Δɻ
6. Promises function timeout(duration = 0) { return new Promise((resolve,
reject) => { setTimeout(resolve, duration); }) } var p = timeout(1000).then(() => { return timeout(2000); }).then(() => { throw new Error("hmm"); }).catch(err => { return Promise.all([timeout(100), timeout(200)]); })
6. Promises http://azu.github.io/promises-book/
Ͳ͏ͬͯಈ͔͢ͷʁ
ECMAScript 6 compatibility table http://kangax.github.io/compat-table/es6/
େ͖͚ͯ̎ͭ͘ • αʔόαΠυͰ࣮ߦ͢Δ • τϥϯείϯύΠϥΛར༻͢Δ
αʔόαΠυͰಈ͔ͯ͠ΈΑ ͏ɻ
IUUQTJPKTPSHKBJOEFYIUNM
͜Μͳײ͡Ͱ࣮ߦ͢Δ $ iojs --harmony_classes ./classes.es6.js $ iojs --harmony_arrow_functions ./arrows.js $
iojs --es_staging ./hoge.js
iojs͏ͱ͖ʹҙ
Φϓγϣϯ(flag)͕ඞཁ • shipping features → ϑϥάඞཁͳ͍ • staged features →
--es_staging͕ඞཁ • in progress features → ݸผʹϑϥάࢦఆ͕ඞ ཁ
ϑϥάΛௐΔ $ iojs --v8-options | grep harmony
ΊΜͲ͍͔͘͞Βશ෦ͷϑϥ άΛࢦఆͯ͠ΈΔɻ $ iojs $(iojs --v8-options | grep harmony |
sed -e 's/(.*)\(.* \)/ /g' | tr '\n' ' ‘) ./hoge.js
ৄ͍͠ࣄiojsͷαΠτͷ͜ ͜Λ֬ೝ͠·͠ΐ͏ɻ https://iojs.org/ja/es6.html
τϥϯείϯύΠϥ
IUUQTCBCFMKTJP
gulpͱΈ߹ΘͤͯΈ·͠ΐ ͏ɻ
“Ұ൪ॏཁͳͷָ͘͠ॻ͚Δ͔Ͳ͏͔ͬ ͯ͜ͱɻ”