Skip to content

Add support for importing translation files directly#19

Merged
k0d13 merged 14 commits intomainfrom
compile-no-more
Apr 26, 2026
Merged

Add support for importing translation files directly#19
k0d13 merged 14 commits intomainfrom
compile-no-more

Conversation

@k0d13
Copy link
Copy Markdown
Owner

@k0d13 k0d13 commented Apr 23, 2026

Replace the compile step with support for importing the translation files directly
Closes #18

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
saykit Skipped Skipped Apr 26, 2026 3:06am

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

🦋 Changeset detected

Latest commit: 228d887

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
unplugin-saykit Patch
babel-plugin-saykit Patch
@saykit/format-po Patch
@saykit/config Patch
@saykit/transform-js Patch
@saykit/transform-jsx Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added examples Updates or additions to example apps package: config Related to @saykit/config and the CLI package: format-po Related to @saykit/format-po package: babel-plugin Related to babel-plugin-saykit website Updates to the documentation website labels Apr 23, 2026
@k0d13 k0d13 added the package: unplugin Related to unplugin-saykit label Apr 23, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR replaces the two-step extract → compile workflow with a single extract step, enabling direct import of .po translation files at build time via Babel and unplugin transform hooks. The compile/build workers and the fallbackLocales config field are removed, .d.ts type declarations are generated alongside each locale file, and the hash function is made URL-safe.

Confidence Score: 5/5

Safe to merge; only a single P2 finding about error reporting in watch mode that doesn't affect the happy path.

All findings are P2 or lower. The core inline-import feature (babel + unplugin load hooks, .d.ts generation, hash URL-safety) is implemented correctly. The watch-mode error suppression is a UX gap but doesn't affect normal extraction or the new direct-import feature.

packages/config/src/commands/extract.ts — watch + allSettled interaction

Prompt To Fix All With AI
This is a comment left during a code review.
Path: packages/config/src/commands/extract.ts
Line: 23-29

Comment:
**Error reporting unreachable in watch mode**

When `--watch` is active, each bucket's task `await`s `worker.watch()`, which is an infinite loop and never resolves. `Promise.allSettled(tasks)` therefore never settles, so the `AggregateError` block is never reached. If one bucket fails during `scan()` / `write()` while another is watching, the failure is logged but never surfaced as a thrown error — the CLI appears to be running correctly while silently ignoring one bucket's failure.

A common pattern is to run the scan/write phase with `Promise.all` first (letting it throw immediately on failure), then start watch loops independently:
```ts
await Promise.all(
  workers.map(async (w) => { await w.scan(); await w.write(); }),
);
if (options.watch) await Promise.all(workers.map((w) => w.watch()));
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (4): Last reviewed commit: "Remove fallback references from docs" | Re-trigger Greptile

Comment thread packages/config/src/features/loader/resolve.ts
Comment thread packages/config/src/features/catalogue/storage.ts
Comment thread packages/plugin-babel/src/index.ts Outdated
@k0d13 k0d13 force-pushed the compile-no-more branch from d0977ee to 90553ab Compare April 24, 2026 03:09
@k0d13 k0d13 force-pushed the compile-no-more branch from 90553ab to 7bf35ef Compare April 24, 2026 03:24
@github-actions github-actions Bot added dependencies Updates or changes related to project dependencies package: core Related to the core saykit package package: react Related to @saykit/react package: carbon Related to @saykit/carbon package: transform-js Related to @saykit/transform-js package: transform-jsx Related to @saykit/transform-jsx labels Apr 24, 2026
@k0d13 k0d13 force-pushed the compile-no-more branch from 7bf35ef to 292a0de Compare April 24, 2026 03:28
@k0d13 k0d13 removed dependencies Updates or changes related to project dependencies package: core Related to the core saykit package package: react Related to @saykit/react package: carbon Related to @saykit/carbon package: transform-js Related to @saykit/transform-js package: transform-jsx Related to @saykit/transform-jsx labels Apr 24, 2026
Comment thread website/content/core-concepts/runtime.mdx Outdated
@k0d13 k0d13 merged commit 1a3aadd into main Apr 26, 2026
9 checks passed
@k0d13 k0d13 deleted the compile-no-more branch April 26, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Updates or additions to example apps package: babel-plugin Related to babel-plugin-saykit package: config Related to @saykit/config and the CLI package: format-po Related to @saykit/format-po package: unplugin Related to unplugin-saykit website Updates to the documentation website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create loader for .po files

1 participant