Skip to content

Conversation

@cherkanovart
Copy link
Contributor

@cherkanovart cherkanovart commented Jan 29, 2026

Summary

Adds deprecation warnings across the legacy compiler (@lingo.dev/_compiler), updates the main and package READMEs to mention deprecation and the new compiler, and centralizes the warning logic in a shared _deprecation module.

Changes

  • Runtime deprecation warningsnext(), vite(), and the Turbopack loader each show a one-time console warning (with migration link and new compiler benefits) when the legacy compiler is used.
  • JSDoc @deprecated — All relevant public APIs (next, vite, loader, loadDictionary, transformComponent) are marked with @deprecated and point to @lingo.dev/compiler and the migration guide.
  • README updates — Main repo README and packages/compiler/README.md state that the legacy compiler is deprecated and document the new compiler usage; packages/cli/README.md includes a short deprecation note.
  • Shared deprecation module — New packages/compiler/src/_deprecation.ts with one message and showDeprecationWarning(); index.ts and lingo-turbopack-loader.ts use it instead of duplicating logic.

Testing

Business logic tests added:

  • No new tests (deprecation is runtime messaging only; existing compiler tests still apply)
  • All tests pass locally

Visuals

Required for UI/UX changes:

  • Before/after screenshots attached
  • Video demo for interactions (< 30s)

N/A — no UI/UX changes.

Checklist

  • Changeset added (if version bump needed) — .changeset/legacy-compiler-deprecation.md
  • Tests cover business logic (not just happy path) — N/A for this change
  • No breaking changes (or documented below)

Closes #--

Summary by CodeRabbit

  • Deprecation

    • Legacy compiler now emits runtime deprecation warnings to signal end-of-life and encourage migration.
    • Deprecation notices added to all public API declarations.
  • Documentation

    • Comprehensive migration guides added with installation steps and configuration examples for Next.js and Vite.
    • Clear upgrade instructions and feature highlights provided to transition to the new compiler.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

This PR adds comprehensive deprecation handling for the legacy compiler package by introducing runtime deprecation warnings, JSDoc annotations on public APIs, and updated documentation with migration guidance to the new compiler.

Changes

Cohort / File(s) Summary
Deprecation Infrastructure
packages/compiler/src/_deprecation.ts
New module implementing a single-emission deprecation warning mechanism with showDeprecationWarning() function to prevent repeated warnings.
Runtime Deprecation Warnings
packages/compiler/src/index.ts, packages/compiler/src/lingo-turbopack-loader.ts
Added showDeprecationWarning() calls at runtime in unplugin, Next.js, Vite entry points, and Turbopack loader to emit deprecation notices.
Public API Deprecation Annotations
packages/compiler/src/_loader-utils.ts
Added @deprecated JSDoc tags to loadDictionary and transformComponent functions with migration guidance referencing new compiler.
Documentation & Migration Guidance
packages/compiler/README.md, packages/cli/README.md
Updated READMEs with deprecation notices, concrete migration paths, before/after configuration examples, and feature highlights of new compiler.
Configuration & Changeset
.claude/settings.local.json, .changeset/legacy-compiler-deprecation.md
Added local Claude settings for build command permissions and changeset documenting deprecation handling introduction.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 The old warren whispers its farewell song,
A gentle warning: move along, move along!
To the shiny new burrow, bright and strong,
Where modern compilers all belong! ✨
Hop onward, dear friend—it won't take long!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding deprecation warnings for the legacy compiler. It is concise, clear, and directly reflects the primary objective.
Description check ✅ Passed The description covers the required sections: summary, changes, testing, visuals, and checklist. All key changes are documented and the changeset is confirmed added.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.claude/settings.local.json:
- Around line 1-6: The permissions.allow entry currently uses the broad wildcard
"Bash(pnpm build:*)" which permits any pnpm build subcommand and arguments;
update this to the minimal required command(s) under the permissions.allow array
(e.g., replace or add explicit entries instead of the wildcard) or
document/confirm the intended scope so Claude IDE only gets the exact pnpm
build:... subcommands needed; locate the permissions.allow JSON key and the
string "Bash(pnpm build:*)" and either constrain it to specific commands or add
justification in the settings.

In `@packages/compiler/README.md`:
- Around line 90-92: Update the "## Documentation" section to replace the bare
URL with a markdown link: change the line containing "Full documentation:
https://lingo.dev/compiler" so it uses link syntax (e.g., "Full documentation:
[https://lingo.dev/compiler](https://lingo.dev/compiler)" or "Full
documentation: [Lingo Compiler Docs](https://lingo.dev/compiler)") so the URL is
properly formatted as a markdown link.

Comment on lines +1 to +6
{
"permissions": {
"allow": [
"Bash(pnpm build:*)"
]
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Check if the file exists and its git status
git ls-files | grep -i settings
git status --ignored | grep -i settings

Repository: lingodotdev/lingo.dev

Length of output: 153


🏁 Script executed:

# Explore the .claude directory structure
ls -la .claude/ 2>/dev/null || echo "Directory may not exist or is empty"
find . -name "*.claude" -o -name ".claude" -type d 2>/dev/null
git ls-files | grep "\.claude"

Repository: lingodotdev/lingo.dev

Length of output: 517


🏁 Script executed:

# Check for similar local/config files in repo
git ls-files | grep -E "\.(local|local\.json|config)$"
cat .gitignore 2>/dev/null | grep -E "(\.local|\.claude|settings)"

Repository: lingodotdev/lingo.dev

Length of output: 164


🏁 Script executed:

# Search for documentation about settings or permissions
fd -e md -e txt | xargs grep -l "\.claude\|settings.*local" 2>/dev/null | head -10
rg "pnpm build" --type md --type txt 2>/dev/null

Repository: lingodotdev/lingo.dev

Length of output: 131


🏁 Script executed:

# Check if .claude is in .gitignore
cat .gitignore | grep -E "\.claude|/\.claude"

Repository: lingodotdev/lingo.dev

Length of output: 47


🏁 Script executed:

# Check the content of the actual file
cat .claude/settings.local.json

Repository: lingodotdev/lingo.dev

Length of output: 139


🏁 Script executed:

# Look for any documentation or README in .claude directory
find .claude -type f -name "*.md" -o -name "README*" | xargs cat 2>/dev/null

Repository: lingodotdev/lingo.dev

Length of output: 14650


🏁 Script executed:

# Search for any references to the permissions system or settings
rg "permissions|allow|Bash\(" --type json --type md --type ts 2>/dev/null | head -20

Repository: lingodotdev/lingo.dev

Length of output: 1788


Verify the breadth of the Bash permission allowlist.

The wildcard pnpm build:* permits any build subcommand and arguments—confirm this scope is intentional for Claude IDE integration.

🤖 Prompt for AI Agents
In @.claude/settings.local.json around lines 1 - 6, The permissions.allow entry
currently uses the broad wildcard "Bash(pnpm build:*)" which permits any pnpm
build subcommand and arguments; update this to the minimal required command(s)
under the permissions.allow array (e.g., replace or add explicit entries instead
of the wildcard) or document/confirm the intended scope so Claude IDE only gets
the exact pnpm build:... subcommands needed; locate the permissions.allow JSON
key and the string "Bash(pnpm build:*)" and either constrain it to specific
commands or add justification in the settings.

Comment on lines +90 to +92
## Documentation

Full documentation: https://lingo.dev/compiler
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Format URL as markdown link.

The bare URL should be formatted as a proper markdown link for better accessibility and consistency with markdown best practices.

📝 Proposed fix
 ## Documentation

-Full documentation: https://lingo.dev/compiler
+Full documentation: [https://lingo.dev/compiler](https://lingo.dev/compiler)
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

92-92: Bare URL used

(MD034, no-bare-urls)

🤖 Prompt for AI Agents
In `@packages/compiler/README.md` around lines 90 - 92, Update the "##
Documentation" section to replace the bare URL with a markdown link: change the
line containing "Full documentation: https://lingo.dev/compiler" so it uses link
syntax (e.g., "Full documentation:
[https://lingo.dev/compiler](https://lingo.dev/compiler)" or "Full
documentation: [Lingo Compiler Docs](https://lingo.dev/compiler)") so the URL is
properly formatted as a markdown link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants