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
noteエディタの話
Search
ct8ker
October 23, 2018
Technology
1
11k
noteエディタの話
note engineer meetup #1
https://pieceofcake.connpass.com/event/101173/
ct8ker
October 23, 2018
Tweet
Share
Other Decks in Technology
See All in Technology
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
2
230
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
130
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
490
AIチャットボット開発への生成AI活用
ryomrt
0
170
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
200
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
110
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
130
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Application Development WG Intro at AppDeveloperCon
salaboy
0
200
"とにかくやってみる"で始めるAWS Security Hub
maimyyym
2
100
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Language of Interfaces
destraynor
154
24k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Automating Front-end Workflow
addyosmani
1366
200k
Thoughts on Productivity
jonyablonski
67
4.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Transcript
noteΤσΟλͷ note engineer meetup #1
ࣗݾհ • 20154݄ʙɹϐʔεΦϒέΠΫ • SIerग़ɹҰ൪ܦݧ͕͍ݴޠJava • ϑϩϯτΔαʔόʔαΠυΤϯδχΞ • झຯΤΦϧθΞͰώΧηϯ Takeshi
Tanazawa https://note.mu/ct8ker
͢͜ͱ • noteΤσΟλͷྺ࢙ • ΤσΟλͷׂ • Ͳ͏ͬͯ։ൃ͖ͯͨ͠ͷ͔ • ࣮͖ͯͨ͠ͷ •
ΤσΟλ։ൃͰͷۤ࿑ • ࠓޙͷ༧ఆ
χϡʔϝΩγί ҎԼൈਮ l͍͜͜ΘաࠅͳχϡʔϝΩγίͷߥͩz l༉அ͔ͨͭ͠ΒαϘςϯʹ͞͞Εͯࢮ͵z l͜͜ΞϯυΡ͢ΔΑ͏ͳࠊൈ͚ੜ͖Εͳ͍χϡʔϝΩ γίͷߥͳͷͩz lࠨͷ΄͏ʹग़ͨΓͰͳ͔ͬͨΓ͢ΔʮʴʯϚʔΫz l͜ͷΑ͏ͳ.FYJDPͷચྱ͕͓·͑Λ͍ͬͯΔz IUUQTEJFIBSEUBMFTDPNOOGEB
noteΤσΟλͷྺ࢙ • ॳʢ201404ʙ͙Β͍ʣ CTO konpyu࡞ɻܹϨΞ • 2ʢ2014͙Β͍ʙ201704ʣ ޭ࿑ऀɻͨͩ͠ɺχϡʔϝΩγίͷߥ • 3ʢ201704ʙʣ
ݱɻߥͰͳ͘ͳͬͨͱࢥ͍͍ͨ
ΤσΟλͷׂ <div contenteditable=“true”> <h3 name=“a”>ݟग़͠</h3> <p name=“b”>ςΩετஈམ</p> <blockquote name=“c”>Ҿ༻</blockquote> <p
name=“d”><img src=“img.jpg”></p> <pre name=“e”><code>ίʔυ</code></pre> <figure name=“f”></figure> </div> • contenteditableΛʮ͑ΔʯΑ͏ʹ͢Δ • ͜ͷϑΥʔϚοτΛࢮक͢Δʢग़དྷΔ͚ͩշదʹʣ
• CSS͕ਖ਼͘͠ద༻͞Εͣɺݟ͕ͨஶ่͘͠ΕΔ • Ұ෦ςΩετ͕ݟ͑ͳ͍ • ༗ྉઃఆ͕ಈ͔ͳ͍ • XSSͷڪා • χϡʔϝΩγίͷߥʹͳΔ
͠ϑΥʔϚοτ่͕ΕΔͱ…
• نҧͷຊจσʔλΛαʔόʔʹૹΔΘ͚ʹ ͍͔ͳ͍ • ฤूૢ࡞ͷࣗ༝ɾշదੑॏཁ͕ͩɺΓڀ ۃతʹnoteϑΥʔϚοτنΛࢮकग़དྷΔൣғ Ͱͷ࣮ݱʹͳΔ
Ͳ͏ͬͯ։ൃ͖ͯͨ͠ͷ͔ • 2016Նࠒɺ3ͷ։ൃελʔτ • 2CoffeeScriptͰॻ͔Ε͍ͯͯɺRailsͷassetsʹ Έࠐ·Ε͍ͯͨɻ 3ಠཱͤͯ͞ɺstandaloneͰಈ͔͍ͨ͠ɻES6 Ͱॻ͖͍ͨ • 2ʹ฿ͬͯɺMediumEditor※Λϕʔεʹ͢Δ
※MediumͬΆ͍ɺOSSͷWYSIWYGΤσΟλ
• શ෦ES5Ͱॻ͔Ε͍ͯΔ • classΛಋೖͯ͠extends֦ͯ͠ு͍ͨ͠ͷʹɺ͜Ε ࠔΔ • πʔϧͰҰൃมΛૂ͕ͬͨ೦ͳ݁Ռʹɻ ख࡞ۀͰશ෦ॻ͖͑ͨ • ES5Ͱॻ͔Εͨಠࣗͷ֦ுػߏআ
MediumEditorΛES6ʹॻ͖͑Δ
• ΄ΜͱTypeScriptʹ͔ͨͬͨ͠ɻ ແ͍ॴʹશ෦ܕ͚͢Δͷ͕ͭΒ͗ͨ͢ (RubyMimeॏ͗ͨ͢) • babelʹܾఆ • ES5 → TS(్த·Ͱ)
→ ES2015 • ͳΜͱ͔MediumEditor ES6(ES2015)൛͕Ͱ͖Δ TypeScript or babel(ES2015)
• webpackͬͯΈΔɻͦͷ··ఆணɻ ࠓʹͳͬͯ4.xܥʹ্͛Α͏ͱͯۤ͠͠Ή • webpack-dev-serverͰstandaloneͰಈ͔͢ HMR(Hot Module Replacement) • MediumEditorͷspecΛಈ͔ͨ͢Ίʹgruntಉډ
Ϗϧυڥͱ͔
• ֦ுίʔυͱMediumEditorίʔυͷσΟϨΫτϦΛ ͚Δ • MediumEditorͷίʔυมߋ͠ͳ͍ มߋ͢ΔͷຊՈߋ৽ʹै͢Δͱ͖͚ͩ • MediumEditorͷspec͕pass͢Δঢ়ଶΛҡ࣋ ޙͰࠔΒͳ͍ͨΊͷ։ൃϧʔϧ
࣮͖ͯͨ͠ͷ • ০ૢ࡞શൠͷϦϝΠΫ • Undo / Redo • ίϐϖ …ͷத͔Βɺಛʹख͕͔͔ؒͬͨͷͨͪ
০ૢ࡞શൠͷϦϝΠΫ
০ૢ࡞શൠͷϦϝΠΫ • MediumEditorcontenteditableͷAPIΛ͍ͬͯ Δ • execCommand(“formatBlock”, false, “p”); • ΫϩεϒϥβͰಈ࡞͕҆ఆ͠ͳ͍ɻ݁Ռ͕͘͠
ͳΒͳ͍
Q. Ͳ͏͢Δ͔ʁ
A. ࣗલͰ࣮
A. ࣗલͰ࣮ ͻͨ͢Β DOM ૢ࡞
Undo / Redo
• ϒϥβϑΥϧτͰɺcontenteditable APIΛͬ ͨฤू͔ͤ͠ͳ͍ • ࣗલͷDOMૢ࡞વޮ͔ͳ͍ Undo / Redo
Q. Ͳ͏͢Δ͔ʁ
A. ࣗલͰ࣮
A. ࣗલͰ࣮ ݁ՌɺDOMૢ࡞ͷࣗ༝্͕͕ͬͨʂ …ͷ͕ຊʹྑ͔ͬͨͷ͔Ͳ͏͔࣌ʑΉ
ίϐϖ
• contenteditable APIͷதͰಛʹ৴༻Ͱ͖ͳ͍ ” insertHTML” Λ͍ͬͯͨ • ͠͠noteϑΥʔϚοτΛഁյ͍ͯͨ͠ ίϐϖ
Q. Ͳ͏͢Δ͔ʁ
A. ࣗલͰ࣮
A. ࣗલͰ࣮ ͨͩͨͩͻͨ͢Β DOM ૢ࡞
ΤσΟλ։ൃͰͷۤ࿑ • ΫϩεϒϥβରԠ ϒϥβຖʹڍಈ͕ҧ͏ͱͭΒ͍ɻDOMૢ࡞Λ૿ ͯ͠ݮ͖͕ͬͯͨɺͦΕͰEdge… • ΤσΟλͰ͋ΕҰൠతʹʮ͜͏ಈ͍ͯͨΓલʯ ͳػೳΛɺͦͷ௨ΓͨΓલʹ࣮ݱ͠ͳ͚ΕͳΒ ͳ͍͠͞ web͔ͩΒଟগΞϨͰ͍͍͡ΌΜʁ
ࠓޙͷ༧ఆ • εϚϗରԠ ͏͙͢ग़·͢
ࠓޙͷ༧ఆ • ϑϧεΫϥονʹ͢Δ • noteઐ༻ػೳϓϥάΠϯͱͯ͠جຊػೳͱ͠ɺ noteҎ֎Ͱ͑Δ൚༻ੑΛ͍࣋ͨͤͨ • खͬͯ͘ΕΔํΛ͓͍ͪͯ͠·͢ʂ 4ΤσΟλ
͋Γ͕ͱ͏͍͟͝·ͨ͠