Skip to content

v0.0.1-beta.5

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Oct 04:27
· 79 commits to main since this release
0ba69f8

Tagged on 2026-10-17. Changes since v0.0.1-beta.4: v0.0.1-beta.4...v0.0.1-beta.5.

JS calling ABI

  • A handle that reaches JavaScript inside an any, such as a pointer to an instantiation of a generic type returned by a lookup function, has its exported methods, as a handle of a type named in an exported signature does; so does a handle inside a slice, map or struct in that any, and a handle one of their methods returns. JavaScript can pass any handle where an interface it implements is expected, also when Go never converts its type to that interface. gosfc reads the vue.Ref bindings of a component this way.
  • goesm emit-ts and goesm build -split take several packages and build them as one program: each is an entry with the JS calling ABI, and the packages they share are lowered once, so their modules share state. An entry that another entry imports is called by it as Go code, not through the JavaScript wrappers. gosfc builds all the components of an app as one program this way.
  • A //goesm:import function can return a pointer to a non-struct type, such as *string: null or undefined becomes nil, any other value a pointer to it. Parameters take such pointers too.
  • A function made by js.FuncOf returns its result directly unless its own Go function blocks. Before, as soon as one function passed to js.FuncOf blocked, every one returned a Promise.

Standard library

  • time.Local follows the host's time zone rules: a time on the other side of a daylight saving transition has that side's offset, as a JavaScript Date does, instead of the offset at start-up. Zones are named by their offsets, as UTC-5. IsDST reports whether the offset is larger than the one 182 days before or after, which differs from Go's in zones whose daylight saving time moves clocks back, such as Europe/Dublin.

Bundle size

  • A method called through an interface is kept only if the program stores a value of its type in an interface. A program that calls some String or Error method, as one that reads err.Error() does, no longer carries time.Time's formatting. Without package reflect, storing a value in an interface no longer counts as storing what it contains (the chan time.Time of a timer).
  • strconv.IsPrint and the quoting of strconv.Quote ask the engine's Unicode tables instead of carrying Go's (7 KB), and floats are formatted with the engine's integer formatting instead of formatBase10. Characters newer than the engine's Unicode version are not printable.

日本語

2026-10-17 にタグを付けました。v0.0.1-beta.4 からの差分は v0.0.1-beta.4...v0.0.1-beta.5 で確認できます。

JS 呼び出しの ABI

  • any に入って JavaScript に渡るハンドル (ルックアップ関数が返すジェネリック型のインスタンスへのポインタなど) も、export された関数のシグネチャに現れる型のハンドルと同じように公開メソッドを持つようになりました。その any に入ったスライス、マップ、構造体の中のハンドルや、それらのメソッドが返すハンドルも同じです。また JavaScript は、Go のコードがその interface に変換していない型のハンドルも、その型が実装する interface を受け取る引数に渡せます。gosfc は、コンポーネントの vue.Ref のバインディングをこの方法で読みます。
  • goesm emit-ts と goesm build -split は複数のパッケージを受け取り、1 つのプログラムとしてビルドするようになりました。どのパッケージも JS 呼び出しの ABI を持つエントリーになり、それらが共有するパッケージは 1 回だけ変換されるので、各モジュールは状態を共有します。ほかのエントリーがインポートするエントリーは、JavaScript 向けのラッパーではなく Go のコードとして呼ばれます。gosfc はアプリのすべてのコンポーネントをこの方法で 1 つのプログラムとしてビルドします。
  • //goesm:import の関数が *string のような構造体以外へのポインタを返せるようになりました。null と undefined は nil に、それ以外の値はその値へのポインタになります。引数にも使えます。
  • js.FuncOf で作った関数は、その Go の関数自身がブロックしない限り、結果をそのまま返すようになりました。これまでは js.FuncOf に渡した関数のどれか 1 つがブロックすると、すべてが Promise を返していました。

標準ライブラリ

  • time.Local がホストのタイムゾーンの規則に従うようになりました。JavaScript の Date と同じく、夏時間の切り替えをまたいだ時刻には、起動時のオフセットではなくその時期のオフセットが使われます。ゾーン名は UTC-5 のようにオフセットから付けます。IsDST は 182 日前か 182 日後のオフセットより大きいかどうかを返すので、Europe/Dublin のように時計を戻す夏時間のゾーンでは Go と異なります。

バンドルサイズ

  • インターフェース経由で呼ばれるメソッドは、プログラムがその型の値をインターフェースに入れる場合にだけ残すようになりました。err.Error() を読むプログラムのように、どこかで String や Error を呼ぶプログラムにも、time.Time の書式化が入らなくなります。また、package reflect を使わないプログラムでは、値をインターフェースに入れても、その中身 (タイマーの chan time.Time など) まで入れたことにはしません。
  • strconv.IsPrint と strconv.Quote のエスケープは、Go の表 (7 KB) の代わりにエンジンの Unicode の表を使うようになりました。浮動小数点数の書式化も、formatBase10 の代わりにエンジンの整数の書式化を使います。エンジンの Unicode より新しい文字は印字可能と見なしません。