Repository navigation
v0.0.1-beta.5
Pre-release
Pre-release
·
79 commits
to main
since this release
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 thatany, 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 thevue.Refbindings of a component this way. goesm emit-tsandgoesm build -splittake 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:importfunction can return a pointer to a non-struct type, such as*string:nullorundefinedbecomes nil, any other value a pointer to it. Parameters take such pointers too. - A function made by
js.FuncOfreturns its result directly unless its own Go function blocks. Before, as soon as one function passed tojs.FuncOfblocked, every one returned a Promise.
Standard library
time.Localfollows the host's time zone rules: a time on the other side of a daylight saving transition has that side's offset, as a JavaScriptDatedoes, instead of the offset at start-up. Zones are named by their offsets, asUTC-5.IsDSTreports 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
StringorErrormethod, as one that readserr.Error()does, no longer carriestime.Time's formatting. Without package reflect, storing a value in an interface no longer counts as storing what it contains (thechan time.Timeof a timer). strconv.IsPrintand the quoting ofstrconv.Quoteask the engine's Unicode tables instead of carrying Go's (7 KB), and floats are formatted with the engine's integer formatting instead offormatBase10. 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 より新しい文字は印字可能と見なしません。