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: comments being treated as errors #152

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

hacknug
Copy link
Contributor

@hacknug hacknug commented Oct 17, 2024

πŸ”— Linked issue

Fixing this was easier than opening an 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)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR prevents the module from treating comments as errors and logging them to the console.

I looked into pushing the comments to currentGroup.comments.push(comment) to later restore them but, as mentioned in your comment (comments are too hard to parse in a logical order, we'll just omit them), it makes things unnecessarily complicated and would require rewriting other parts of the module. Plus I would count getting rid of them as minification so I'm guessing it's a good thing.

I believe we can get rid of currentGroup.comment and the for loop where we restore the comments since we're not saving them at any point. Might have a very minor positive impact on sites with a big robots.txt file.

@harlan-zw
Copy link
Contributor

harlan-zw commented Oct 17, 2024

Great contribution, thanks!

Feel free to send any subsequent PRs related to the optimization.

@harlan-zw harlan-zw merged commit ee973f1 into nuxt-modules:main Oct 17, 2024
1 check passed
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.

2 participants