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.6k
Other Decks in Programming
See All in Programming
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.8k
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
510
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
luccafort
PRO
1
150
Design Foundational Data Engineering Observability
sucitw
3
200
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
100
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
120
デザイナーが Androidエンジニアに 挑戦してみた
874wokiite
0
440
AWS発のAIエディタKiroを使ってみた
iriikeita
1
190
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
590
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
150
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.4k
Featured
See All Featured
Building Adaptive Systems
keathley
43
2.7k
Into the Great Unknown - MozCon
thekraken
40
2k
Embracing the Ebb and Flow
colly
87
4.8k
Thoughts on Productivity
jonyablonski
70
4.8k
Optimizing for Happiness
mojombo
379
70k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
The Art of Programming - Codeland 2020
erikaheidi
56
13k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
112
20k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Documentation Writing (for coders)
carmenintech
74
5k
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Λ Ϗϧυͯ͠ΈΔ