Skip to content
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

fix: rollup comment annotation warning #2723

Merged
merged 1 commit into from Jan 30, 2024

Conversation

BobbieGoede
Copy link
Collaborator

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves #2640

Not sure if it this is the correct way to solve this issue, I don't exactly understand how the comment works and should be handled. I looked at https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/pages/runtime/composables.ts#L55-L83 for reference, our defineI18nRoute macro works in a similar way to definePageMeta in Nuxt but that doesn't use a comment like this, while defineRouteRules does which is also similar to our macro.

Let me know if this should be solved differently, this change simply removes the comment and adds a usage check just like definePageMeta has.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link
Collaborator

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Thanks!
I've just reviewed this PR!
You can check it! :)

src/transform/macros.ts Show resolved Hide resolved
@danielroe
Copy link
Contributor

I think if you update to /*@__PURE__*/ it will prevent the warning.

@BobbieGoede BobbieGoede merged commit 545ad1d into nuxt-modules:main Jan 30, 2024
7 checks passed
@BobbieGoede BobbieGoede deleted the fix/pure-comment branch January 30, 2024 14:51
DarthGigi pushed a commit to DarthGigi/i18n that referenced this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants