Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unable to reuse a JavaScriptFunction to call from ruby back to javascript

オープン
#228 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, ruby
領域
backend

調査の方向性

Start by tracing how MiniRacer::JavaScriptFunction values are exposed to Ruby and how the existing callback mechanism crosses between Ruby and JavaScript. The issue gives no file or test names, so locate those entry points and related tests before estimating the change. Done means a Ruby callback can invoke the JavaScript function and continue the described round trip; add or identify coverage for that behavior.

索引モデルが issue の本文から書いたものです。

説明

I have attached a ruby block to my js context in order to power a callback mechanism. It should go ruby -> js -> ruby -> js (and maybe a few more times after that). My code looks something like:

      subject.register_helper('alsowith') do |this, context, block|
        context["fn"]
      end

where context looks like this in a debugger:

0> context
=> {"name"=>"alsowith", "hash"=>{}, "fn"=>#<MiniRacer::JavaScriptFunction:0x00007fd20c0a3620>, "inverse"=>#<MiniRacer::JavaScriptFunction:0x00007fd20c0a34e0>, "data"=>{"root"=>{"weather"=>{"summary"=>"sunny"}}}}

Unfortunately I can't use the "fn" key's value, a JavaScriptFunction appears to be an empty class and not invocable. I was expecting something like context["fn"].call(123) so I could keep going.

主要言語
JavaScript
スター
628
フォーク
100
平均マージ
1日 20時間
マージ済み PR(30日)
2

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rubyjs/mini_racer のほかの issue

rubyjs/mini_racer の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。