Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Next.js で Ruby をプログラミング&実行できるアプリを作る
Search
uutan1108
January 18, 2024
Programming
2.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Next.js で Ruby をプログラミング&実行できるアプリを作る
エンジニアの自由研究発表会vol.9
https://tech-street.connpass.com/event/305362/
uutan1108
January 18, 2024
Transcript
19 slides
Next.js で Ruby を プログラミング&実行できる アプリを作る エンジニアの自由研究発表会vol.9 うーたん
自己紹介 • うーたん • 新卒サーバーサイドエンジニア ◦ 株式会社ゆめみ • 趣味 ◦
アニメを見ること • X ◦ @uutan1108
目次 - 作ったもの - 仕組み - Server Actions - @ruby/wasm-wasi
- 終わりに
作ったもの
None
None
Ruby のコードを Next.js のみで実行できる
仕組み
仕組み ・Server ActionsはNext.js 14でStableになった機能です。 サーバー側で関数を実行できます。 ・サーバー側の実行結果をクエリパラメータに与えリダイ レクト させます。
実行前 実行後
Server Actions
Server Actions and Mutations サーバーアクションは、サーバー上で実行される非同期関数で す。サーバーコンポーネントやクライアントコンポーネントで使 用し、Next.jsアプリケーションのフォーム送信やデータを処理し ます。 https://nextjs.org/docs/app/building-your-application /data-fetching/server-actions-and-mutations
Server Actions ・フォームのsubmitが押 さ れた時にサーバーで 関数 が実行される。 ・フォームの入力内容を 受 け取り処理をでき る。 ・onAction関数にRuby を 実行するコードを書 く 引
用:https://future-architect.github.io/articles/20231130a
wasm
WebAssembly とは何か この機能はウェブプラットフォームにとって大きな意味を持ちま す。ウェブ上で動作するクライアントアプリで従来は実現できな かった、ネイティブ水準の速度で複数の言語で記述されたコー ドをウェブ上で動作させる方法を提供します。 今回はサーバー側でWasmを実行しています。 https://developer.mozilla.org/ja/docs/WebAssembl y/Concepts
@ruby/wasm-wasi ・先ほどのonAction関数内のコー ド。 ・npmでインストールできる。 ・wasmを読み込んでユーザーから 受け取ったコードを実行する。 ・Rubyで標準入力を与え、標準 出 力を取得するコードを追加す る。
終わりに
感想 • 意外と簡単に実装できた • Next.js 14 の新しい機能 Server Actions を使ってみたが、
便利そうな気がする • OHMORIYUSUKE/ruby-web でコードを公開しているので 見てください! • 作ってみると楽しい
ご清聴ありがとうございました🙇
More Decks by uutan1108
See All by uutan1108
勉強会の懇親会が苦手な人も楽しめる場をつくりたい
ohmori_yusuke
5
1.4k
四畳半神話大系から学ぶ判断における経験の必要性
ohmori_yusuke
1
56
エンジニアとQAエンジニアを繋いでくれた振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
0
290
Designing a Cross-Disciplinary Engineering Community Through Anime
ohmori_yusuke
3
150
コミュニティ・勉強会を作るのは目的じゃない
ohmori_yusuke
1
430
映画のエンドロール風の動画を自動生成するツールを作った
ohmori_yusuke
2
160
アウトプットは“成果物”じゃなく“副産物”だった話
ohmori_yusuke
1
180
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
1k
仕様がそのままテストになる!Javaで始める振る舞い駆動開発
ohmori_yusuke
8
6.3k
Other Decks in Programming
See All in Programming
Performance Optimization With LLMs
xleitix
0
260
LLM 101
dalinaum
0
480
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.5k
Modernizing iOS Apps
seyfoyun
0
150
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
200
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
260
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
170
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
170
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
570
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
1
190
protojson における文字化けの扱い
kazuki1023
0
400
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
310
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Accessibility Awareness
sabderemane
1
300
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
4
1.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
380
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
660
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
A Soul's Torment
seathinner
9
3.9k