クライアント チャネル コード (phoenix.js ファイル内) を調べると、ES6 が使用されていることがわかりました。サンプルコード:
let chan = socket.chan("rooms:123", {token: roomToken})
// chan.on("new_msg", msg => console.log("Got message", msg) )
// $input.onEnter( e => {
// chan.push("new_msg", {body: e.target.val})
// .receive("ok", (message) => console.log("created message", message) )
// .receive("error", (reasons) => console.log("create failed", reasons) )
// .after(10000, () => console.log("Networking issue. Still waiting...") )
this.onError( reason => {
this.socket.log("channel", `error ${this.topic}`, reason)
this.state = CHAN_STATES.errored
this.rejoinTimer.setTimeout()
})
つまり、IE と Safari ではネイティブに実行されません (少なくとも)。ある種のポリフィルを使用するべきではありませんか? 最良のアプローチ/ポリフィルは何ですか? また、ポリフィルはクラス/let/...をカバーしますが、アロー関数/新しい文字列補間はカバーしないという印象を受けています。自分で変更する必要がありますか?