Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
De volta ao Futuro do JS: As próximas features e propostas incríveis
Willian Martins
August 08, 2020
Technology
0
29
De volta ao Futuro do JS: As próximas features e propostas incríveis
Willian Martins
August 08, 2020
Tweet
Share
More Decks by Willian Martins
See All by Willian Martins
Back to the future of JS II: Beyond what we can foresee
wmsbill
0
41
A, B, C. 1, 2, 3. Iterables you and me.
wmsbill
0
54
Back to the future of JS II: Beyond what we can foresee
wmsbill
0
64
Back to the future of JS.
wmsbill
0
11
Node conf ar 2018.
wmsbill
0
200
Back to the future of JS
wmsbill
1
35
Back to the future of JS
wmsbill
2
230
WebAssembly in NodeJS
wmsbill
4
480
WebAssembly the Journey
wmsbill
2
120
Other Decks in Technology
See All in Technology
eBPF-based Container Networking
johnlin
2
1.1k
プロダクトマネージャーの役割と育成、評価
middleokada
15
10k
第22回 MLOps 勉強会:みてねのMLOps事情
tonouchi510
0
140
サイバー攻撃を想定したクラウドネイティブセキュリティガイドラインとCNAPP及びSecurity Observabilityの未来
sakon310
4
450
聊聊 Cgo 的二三事
david74chou
0
330
塩漬けにしているMySQL 8.0.xxをバージョンアップしたくなる、ここ数年でのMySQL 8.0の改善点 / MySQL Update 202208
yoshiakiyamasaki
1
600
〇〇みたいな検索作ってと言われたときに考えること / thinking before developing search system like that one
ryook
5
2.6k
ソフトウェアアーキテクチャの基礎: Software Architecture in a Nutshell
snoozer05
28
8.5k
A3-1 IBM Championが本音で語る「IBM Cloud」
kolinz
0
300
漫画で使えそうな背景画像をblenderを使って作ってみた!
nokonoko1203
0
230
ソフトバンクaPaaS領域への挑戦
sbtechnight
0
310
MySQL v5.7 勉強会/study-mysql-ver-5-7
andpad
0
2k
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
689
180k
Writing Fast Ruby
sferik
612
57k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
15k
Thoughts on Productivity
jonyablonski
44
2.4k
Debugging Ruby Performance
tmm1
65
10k
Statistics for Hackers
jakevdp
782
210k
The Straight Up "How To Draw Better" Workshop
denniskardys
225
120k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
224
49k
The Invisible Customer
myddelton
110
11k
Facilitating Awesome Meetings
lara
29
4.1k
Bootstrapping a Software Product
garrettdimon
296
110k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
6
560
Transcript
E ai, Beleza?
Quem é você!?
Pq vc tá aqui?
https://github.com/tc39/proposals
BrazilJS - ES
@wmsbill O que é this?
@wmsbill this no escopo global Browser - window Web worker
- self NodeJS - module.exports
@wmsbill this dentro de uma função?
@wmsbill this dentro de uma função?
None
@wmsbill Como fazer this ser previsível? Entender o valor de
this é complicado Function.prototype.bind Arrow function () => {}
Com .bind()
Com Arrow
@wmsbill Invocando uma função conhecida
@wmsbill Extraindo um método de um objeto
None
@wmsbill Duas sintaxes Unária : :context.method() Binária context: :method()
@wmsbill Sintaxe unária
@wmsbill Sintaxe Binária
@wmsbill
@wmsbill
@wmsbill
@wmsbill Operador Bind é útil para métodos virtuais Mas precisa
que do this para ser travado
@wmsbill Compondo sem this
@wmsbill
@wmsbill
None
@wmsbill Operador pipeline |> Sintaxe sugar para composição de funções
Cria uma cadeia de funções fluida
@wmsbill Operador pipeline |>
@wmsbill
@wmsbill
@wmsbill
@wmsbill Função com mais de um parâmetro.
@wmsbill Função com mais de um parâmetro.
@wmsbill Awaiting uma função
@wmsbill Awaiting uma função
@wmsbill Awaiting uma função
@wmsbill Awaiting uma função
@wmsbill Awaiting uma função
None
@wmsbill Smart pipeline Dois tipos bare style e topic style
() e [] são proibidos no bare style Quando () ou [] é necessário, usa- se o topic style # é um token temporário
@wmsbill Smart pipeline
@wmsbill What about curry?
None
@wmsbill Proposta de pipeline F# Extende a proposta mínima com
o passo await O passo await espera pela resolução do passo anterior.
@wmsbill Proposta de pipeline F#
@wmsbill
@wmsbill Partial application f(…) aridade = n; partialapp(f(…)) aridade =
m; m < n
@wmsbill
@wmsbill
@wmsbill Partial application no JS Possível com Function.prototype.bind .bind() trava
contexto e parametros
@wmsbill
@wmsbill Mas e o currying? É possível fazer partial application
com curry Curry ≠ Partial application Curry retorna aridade n-1
@wmsbill
@wmsbill Partial application com arrow function
None
@wmsbill Proposta partial application Cria dois novos tokens de parametros
? Para argumento único . . . para múltiplos argumentos (não está mais na spec inicial)
@wmsbill Syntaxe do partial application
@wmsbill With arbitrary parameter
None
@wmsbill Partial application em template string
@wmsbill Partial application em template string
None
@wmsbill O token . . . Espalha os argumentos não
travados Útil quando se quer travar ou o primeiro ou o último parâmetro
@wmsbill O token . . .
@wmsbill O token . . .
@wmsbill Partial application + pipeline
@wmsbill Partial application + pipeline
@wmsbill Posso usar isso em produção? Essas propostas estão em
estágios muito iniciais A adoção de uma pode mudar ou eliminar a adoção de outra Não está pronta pra prod (ainda)
https://www.twitch.tv/williandev https://twitter.com/wmsbill ola@willian.dev
Valeus! Falows!