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
De volta ao Futuro do JS: As próximas features e propostas incríveis
Search
Willian Martins
August 08, 2020
Technology
0
58
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
Além do else! Categorizando Pokemóns com Pattern Matching no JavaScript
wmsbill
0
750
Back to the future of JS II: Beyond what we can foresee
wmsbill
0
74
A, B, C. 1, 2, 3. Iterables you and me.
wmsbill
0
66
Back to the future of JS II: Beyond what we can foresee
wmsbill
0
76
Back to the future of JS.
wmsbill
0
11
Node conf ar 2018.
wmsbill
0
340
Back to the future of JS
wmsbill
1
42
Back to the future of JS
wmsbill
2
240
WebAssembly in NodeJS
wmsbill
4
540
Other Decks in Technology
See All in Technology
データ分析力を高めるSQL研修サービス『SQL Everyone』
hikarut
1
390
Prisma ORMを2年運用して培ったノウハウを共有する
tockn
19
5k
生成AIと産業向けソフトウェアの自動生成 〜 ハノーバーメッセ2024より〜
kioto
2
420
拓展QA日常工作的邊界
line_developers_tw
PRO
0
550
個人的、Kubernetes の最新注目機能! (2024年5月版) / TechFeed Experts Night#28 〜 コンテナ技術最前線
pfn
PRO
3
210
動画配信サービスのフロントエンド実装に学ぶ設計原則
yud0uhu
1
130
NewSQL Landscape
oracle4engineer
PRO
5
3.2k
OPENLOGI Company Profile for engineer
hr01
1
2.2k
#phpconkagawa レガシーコードにもオブザーバビリティを 〜少しずつ始めるサービス監視〜
yamato_sorariku
0
550
知識と実践を紡ぐGenAI / Connecting Knowledge and experience with GenAI
aki_moon
2
180
日本が誇るイタリアのダンスミュージック!? ユーロビートって何??
minorun365
PRO
2
190
Laboratories in Science and Technology: Deep Neural Networks
keio_smilab
PRO
3
100
Featured
See All Featured
Design by the Numbers
sachag
274
18k
4 Signs Your Business is Dying
shpigford
176
21k
Visualization
eitanlees
137
14k
The Cost Of JavaScript in 2023
addyosmani
21
4k
A better future with KSS
kneath
231
16k
Building Applications with DynamoDB
mza
88
5.7k
Debugging Ruby Performance
tmm1
70
11k
Code Reviewing Like a Champion
maltzj
515
39k
Thoughts on Productivity
jonyablonski
60
3.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.5k
Why Our Code Smells
bkeepers
PRO
331
56k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
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
[email protected]
Valeus! Falows!