Skip to content

Conversation

@cernymatej
Copy link
Member

@cernymatej cernymatej commented Aug 3, 2025

📚 Description

This PR removes an unused enabled flag in the components directory options.

It was hard-coded to true in the app:resolve hook in:

return {
global: componentOptions.global,
...dirOptions,
// TODO: https://github.com/nuxt/framework/pull/251
enabled: true,
path: dirPath,
extensions,
pattern: dirOptions.pattern || `**/*.{${extensions.join(',')},}`,
ignore: [
'**/*{M,.m,-m}ixin.{js,ts,jsx,tsx}', // ignore mixins
'**/*.d.{cts,mts,ts}', // .d.ts files

So it shouldn't have had any effect here either:

if (dir.enabled === false) {
continue
}

Since the only time the scanComponents function is called, it uses the array with the hard-coded value:

nuxt.hook('app:templates', async (app) => {
const newComponents = await scanComponents(componentDirs, nuxt.options.srcDir!)

@cernymatej cernymatej requested a review from danielroe as a code owner August 3, 2025 14:33
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Aug 3, 2025

Warning

Rate limit exceeded

@danielroe has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between aa28c79 and eacde84.

📒 Files selected for processing (3)
  • packages/nuxt/src/components/module.ts (0 hunks)
  • packages/nuxt/src/components/scan.ts (0 hunks)
  • packages/nuxt/test/scan-components.test.ts (0 hunks)

Walkthrough

The changes remove the enabled boolean property from the documentation, type definitions, and implementation related to component directory scanning. Specifically, the enabled property is no longer documented as an option for the addComponentsDir function, has been removed from the ScanDir interface, and is no longer set or filtered in the logic that constructs the list of component directories. No other properties or logic were altered.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 3, 2025

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@32844

nuxt

npm i https://pkg.pr.new/nuxt@32844

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@32844

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@32844

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@32844

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@32844

commit: eacde84

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 3, 2025

CodSpeed Performance Report

Merging #32844 will not alter performance

Comparing cernymatej:chore/remove-components-enabled-flag (eacde84) with main (327ba8f)

Summary

✅ 10 untouched

@cernymatej
Copy link
Member Author

One test failed because it passed component entries with enabled: false to the scanComponents function. I don't think this is possible to do "normally" since the components:dirs hook receives the allDirs array, which gets later transformed to the hard-coded enabled: true.

Looking forward to receiving feedback on this.

@danielroe danielroe changed the title chore(nuxt): remove unused enabled flag from directory options fix(nuxt): remove unused enabled flag from directory options Sep 11, 2025
@danielroe danielroe merged commit 656066c into nuxt:main Sep 11, 2025
47 of 49 checks passed
@github-actions github-actions bot mentioned this pull request Sep 11, 2025
@cernymatej cernymatej deleted the chore/remove-components-enabled-flag branch September 11, 2025 22:00
@github-actions github-actions bot mentioned this pull request Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants