Skip to content

Add opt-in LoadTable and LoadEntries methods (1.3.1) - #18

Merged
Severnbli merged 2 commits into
mainfrom
feature/load-table
Oct 28, 2026
Merged

Severnbli merged 2 commits into
mainfrom
feature/load-table

Conversation

@Severnbli

@Severnbli Severnbli commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • New Load Table Method setting (off by default). Every generated table class gets:
    public static Task<StringTable> LoadTable() => LocalizedTables.LoadStringTable(TableName);
    Asset tables return Task<AssetTable> and load the table only, not its assets. Asset table classes also get LoadEntries(), which loads the table plus the assets of all its entries through PreloadTables. Tables marked No Preload in their Preload Asset Table metadata are loaded without their assets. With UniTask Members there are also LoadTableAsync(CancellationToken) and LoadEntriesAsync(CancellationToken).
  • Runtime: LocalizedTables.LoadStringTable / LoadAssetTable / LoadAssetTableEntries and LocalizedTablesUniTask.LoadStringTableAsync / LoadAssetTableAsync / LoadAssetTableEntriesAsync. The Task versions finish through the operation's Completed callback instead of handle.Task, so they also work on WebGL. When Localization isn't configured they complete with null.
  • The generated code returns Task, not AsyncOperationHandle, so user asmdefs don't need a new Unity.ResourceManager reference.
  • Compatibility:
    • With the option off, the output is byte-for-byte the same, and the hash signature only changes when the option is on.
    • The method names are claimed after key names, so a key named LoadTable keeps its name and the method becomes LoadTable_2.
    • Task, StringTable and AssetTable are reserved class names only while the option is on.
  • README (new Loading a table section, settings table), CHANGELOG, and version bump to 1.3.1.

Testing

  • EditMode tests in Unity 6000.6.6f1 batch mode: 156 passed, 0 failed, 1 skipped (UniTask compile, since UniTask isn't installed).
  • New emitter tests: off by default, string and asset tables, the UniTask variant, name collisions with keys, class names reserved only while the option is on, and LoadEntries on asset tables only. The generated-code compile test now runs with the option on.
  • Not compiled locally: the LocalizedTablesUniTask additions, because UniTask isn't installed in the test project. CI's UniTask job should cover them.

🤖 Generated with Claude Code

Severnbli and others added 2 commits October 28, 2026 09:53
Load Table Method emits LoadTable() on every table class, returning
Task<StringTable> / Task<AssetTable>, plus LoadTableAsync with UniTask
Members. The runtime awaits the Localization operation through its
completion callback, so it also works on WebGL. Off by default and
claimed after key names, so existing output and members don't change.
Bump version to 1.3.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Load Table Method on, asset table classes also get LoadEntries()
(and LoadEntriesAsync with UniTask), which preloads the table and the
assets of all its entries through PreloadTables. LoadTable stays
table-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Severnbli Severnbli changed the title Add opt-in LoadTable method (1.3.1) Add opt-in LoadTable and LoadEntries methods (1.3.1) Oct 28, 2026
@Severnbli
Severnbli merged commit d68be2c into main Oct 28, 2026
15 checks passed
@Severnbli Severnbli added the feature New feature or request label Oct 28, 2026
@Severnbli Severnbli self-assigned this Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant