$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Contributing to Deno is fun!
Search
petamoriken / 森建
October 20, 2023
Programming
0
410
Contributing to Deno is fun!
Deno Fest ディノフェス - presented by toranoana.deno
https://deno-fest-2023.deno.dev/
petamoriken / 森建
October 20, 2023
Tweet
Share
More Decks by petamoriken / 森建
See All by petamoriken / 森建
Module Harmony
petamoriken
2
690
Denoでフロントエンド開発 2025年春版 / Frontend Development with Deno (Spring 2025)
petamoriken
1
1.5k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
600
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
280
フロントエンドの標準仕様をどう追っているか / How I follow the frontend standards specs
petamoriken
4
2.5k
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
600
DOM Observable
petamoriken
1
300
Deno に Web 標準 API を実装する / Implementing Web standards API to Deno
petamoriken
0
730
Stage 2 Decorators の変遷 / Stage 2 Decorators history
petamoriken
0
7.2k
Other Decks in Programming
See All in Programming
Deno Tunnel を使ってみた話
kamekyame
0
230
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
340
Cap'n Webについて
yusukebe
0
150
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
630
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
1.7k
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.9k
Cell-Based Architecture
larchanjo
0
140
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
140
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
250
開発に寄りそう自動テストの実現
goyoki
2
1.4k
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
120
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
160
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
A better future with KSS
kneath
240
18k
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
370
Six Lessons from altMBA
skipperchong
29
4.1k
RailsConf 2023
tenderlove
30
1.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
0
300
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
29
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
0
62
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Transcript
Contributing to Deno is fun! pixiv Inc. 森内建太 petamoriken 2023.10.20
2 自己紹介 • Web エンジニア • ECMAScript や WHATWG を追うのが好き • よく仕様についての記事を書いています petamoriken プロダクト支援本部
課題解決部(福岡)
3
4 目次 • Deno の構成 • Deno 内部の JavaScript • primordials.js について • コントリビュート手順
• プルリクエストの具体例
5 Deno の構成 • Cargo (Rust) ワークスペースで管理されている • https://github.com/denoland/deno ◦ cli コマンドライン
◦ runtime 実行部分 ◦ ext Web 標準 API、FFI、Node.js 互換レイヤーなど • https://github.com/denoland/deno_core ◦ core V8、JS と Rust を仲介する部分 (ops) など
6 Deno 内部の JavaScript • Deno API のインターフェースは JavaScript で実装されている ◦ Web 標準 API、Node.js 互換レイヤーなど ◦ ファイルシステム、ネットワークなど外界とのやり取りは Rust
• 実行時に都度テキストとして読み込むと時間がかかる 👉 V8 スナップショット機能で JavaScript と ops の初期化処理を高速化
pub fn create_runtime_snapshot(snapshot_path: PathBuf) { let fs = std::sync::Arc::new(deno_fs::RealFs); let
mut extensions: Vec<Extension> = vec![ deno_webidl::deno_webidl::init_ops_and_esm(), deno_console::deno_console::init_ops_and_esm(), deno_url::deno_url::init_ops_and_esm(), deno_web::deno_web::init_ops_and_esm::<Permissions>( Default::default(), Default::default(), ), // ... ]; 7 deno/runtime/build.rs
function quoteString(string, ctx) { const quote = ArrayPrototypeFind( ctx.quotes, (c)
=> !StringPrototypeIncludes(string, c), ) ?? ctx.quotes[0]; const escapePattern = new SafeRegExp(`(?=[${quote}\\\\])`, "g"); string = StringPrototypeReplace(string, escapePattern, "\\"); if (ctx.escapeSequences) { string = replaceEscapeSequences(string); } return `${quote}${string}${quote}`; } 8 deno/ext/console/01_console.js
9 primordials.js について • プロトタイプ汚染されても問題なく内部コードが実行できるようするためのもの ◦ deno_core/core/00_primordials.js で提供される • CI で dlint prefer-primordials ルールでチェックされる // NG
["foo", "bar"].include("foo"); // OK const { ArrayPrototypeInclude } = window.__bootstrap.primordials; ArrayPrototypeInclude(["foo", "bar"], "foo");
10 コントリビュート手順 1. イシューを見つける • good first issue ラベルが付いているものが取っつきやすいです 2. 取り組むことを宣言する
3. プルリクエストを作成する • わからない箇所は Discord や日本コミュニティ Slack などで気軽に聞いて👌 • 見てもらう前に cargo test ./ tools/format.js ./tools/lint.js を 実行して CI を通す くわしくはコントリビュートガイドへ https://docs.deno.com/runtime/manual/references/contributing/
11 プルリクエストの具体例 • feat(console): Display cause errors in console #12462