-
Notifications
You must be signed in to change notification settings - Fork 829
feat(compiler): add deprecation warnings for legacy compiler #1934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this 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.
| { | ||
| "permissions": { | ||
| "allow": [ | ||
| "Bash(pnpm build:*)" | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Check if the file exists and its git status
git ls-files | grep -i settings
git status --ignored | grep -i settingsRepository: 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/nullRepository: 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.jsonRepository: 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/nullRepository: 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 -20Repository: 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.
| ## Documentation | ||
|
|
||
| Full documentation: https://lingo.dev/compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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_deprecationmodule.Changes
next(),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.@deprecated— All relevant public APIs (next,vite, loader,loadDictionary,transformComponent) are marked with@deprecatedand point to@lingo.dev/compilerand the migration guide.packages/compiler/README.mdstate that the legacy compiler is deprecated and document the new compiler usage;packages/cli/README.mdincludes a short deprecation note.packages/compiler/src/_deprecation.tswith one message andshowDeprecationWarning();index.tsandlingo-turbopack-loader.tsuse it instead of duplicating logic.Testing
Business logic tests added:
Visuals
Required for UI/UX changes:
N/A — no UI/UX changes.
Checklist
.changeset/legacy-compiler-deprecation.mdCloses #--
Summary by CodeRabbit
Deprecation
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.