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
天高くそびえ立つ巨塔によって PHPをJavaScriptに変換する
Search
potato4d(Takuma HANATANI)
July 15, 2017
Programming
0
590
天高くそびえ立つ巨塔によって PHPをJavaScriptに変換する
2017.07.15 Potato4d #phpkansai Lightning Talk
potato4d(Takuma HANATANI)
July 15, 2017
Tweet
Share
More Decks by potato4d(Takuma HANATANI)
See All by potato4d(Takuma HANATANI)
どうせキレイに書けない処理は逆にAIに書いてもらうほうが良い説 / #kyotojs 22
potato4d
3
410
TSX First な Zero-Runtime SSG potato4d/dodai とその仕組み / owned static site generator #kyotojs
potato4d
1
2.3k
Vue.js with TSX - From Vue 2.x to Vue 3 #v_tokyo11
potato4d
9
4.9k
終わりゆく Vue 2.x 時代の状態設計のアンサー - Vue 3 の Provider への期待 / The Last Architecture of the Vue 2.x
potato4d
25
7k
Web Worker を使ってブラウザ上でポケモンの画像を解析したい! / Pokemon recognition from screenshots in browser using web worker
potato4d
0
1.3k
Firebase & Google Cloud によるサーバーレス帳票管理 #FJUG / Serverless Architecture in Candy
potato4d
8
3.7k
NestJS meetup Tokyo Opening Talk / What is NestJS? #nestjs_meetup
potato4d
11
4.2k
私たちはなぜ SPA で開発するのか / Why you choose SPA
potato4d
39
27k
Amplify Console 誕生以来本番運用しつづけてわかったこと #awswakaran_tokyo
potato4d
6
3.5k
Other Decks in Programming
See All in Programming
Langfuseと歩む生成AI活用推進
licux
3
300
あのころの iPod を どうにか再生させたい
orumin
2
2.5k
Portapad紹介プレゼンテーション
gotoumakakeru
1
130
Understanding Ruby Grammar Through Conflicts
yui_knk
1
140
なぜ今、Terraformの本を書いたのか? - 著者陣に聞く!『Terraformではじめる実践IaC』登壇資料
fufuhu
4
660
実践!App Intents対応
yuukiw00w
1
350
私の後悔をAWS DMSで解決した話
hiramax
4
140
コーディングは技術者(エンジニア)の嗜みでして / Learning the System Development Mindset from Rock Lady
mackey0225
2
580
パスタの技術
yusukebe
1
400
🔨 小さなビルドシステムを作る
momeemt
2
530
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
470
Flutter로 Gemini와 MCP를 활용한 Agentic App 만들기 - 박제창 2025 I/O Extended Seoul
itsmedreamwalker
0
150
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
53
8.8k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Scaling GitHub
holman
462
140k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
BBQ
matthewcrist
89
9.8k
Done Done
chrislema
185
16k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
Thoughts on Productivity
jonyablonski
69
4.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Building Adaptive Systems
keathley
43
2.7k
Transcript
ఱߴͦ͘ͼཱ͑ͭڊౝʹΑͬͯ PHPΛJavaScriptʹม͢Δ 2017.07.15 Potato4d #phpkansai Lightning Talk
ࣗݾհ
@potato4d
None
None
ͯͨ͠
νϟϥ͍όϯυϚϯΈ͍͔ͨͩ ΒΊΖͱݴΘΕΔΞΠίϯͷ ਓ
None
օ͞Μbabel͝ଘͰ͔͢ʁ
None
ES2015+ͱ͍͏2015Ҏ߱ͷ JavaScriptΛݹ͍ES5ʹม͢Δ
ESͱ͍͏ͷ͕JavaScriptͷ ϕʔε༷Έ͍ͨͳͷ
ͦͷޙͷྐྵ͕ͦͷ࣌ͷ࣌Ͱ ͷ༷ʹͳΔ
৽͍͠JavaScriptͷػೳΛઌʹ ࢼ͢πʔϧ
ݱߦͷJavaScriptͷػೳΛݹ͍ ϒϥβͰಈ͔͢πʔϧ
html5shiv͋Δ͍Auto Prefixer
ಥવͰ͕͢͜͜Ͱ
ΫΠζͰ͢ʂ
ES20152015ͷJavaScript
ES20162016ͷJavaScript
͡Ό͋ES5Կͷ JavaScriptʁ
ͦ͏Ͱ͢Ͷ
A.D. 5Ͱ͢Ͷ
͜ͷྐྵ5ͷJavaScriptʹม ͢Δπʔϧ
͍ͬͯΔ͜ͱ ҙͷςΩετ to JS
͍ͬͯΔ͜ͱ ҙͷPHP to JS
babel-preset-php
Δ
͓ΉΖʹλʔϛφϧΛ։͘
mkdir _test
cd $_
npm init -
yarn add babel-cli babel- preset-php
> main.php
<?php $hoge=1; var_dump($hoge);
./node_modules/.bin/babel ./ main.php -o main.js
ͬͨ
ͭΒ͍ͱ͜Ζ
͍͍ͩͨಈ ͔ͳ͍
file_get_contentsಈ͔ͳ͍
xhrʹͳͬͨΓfetchʹͳͬͨΓ͠ͳ ͍
PHP to JSͷເͷπʔϧ
None
ͳ͔ͬͨ
͓·͚
ࡶʹEC-CUBEΛ Ϗϧυͯ͠ΈΔ