-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(nuxt): ensure component dirs in node_modules
have lower scanning priority
#6382
Conversation
β Deploy Preview for nuxt3-docs canceled.
|
@pi0 Now my chance is here for my first contribution π |
Would you attach a reproduction showing that The linked PR (#6070) is still only available on the edge channel, and will not work in RC6. |
@danielroe Sure....already working on it as mentioned. Yeah i know its edge. It's only releated to edge version |
@danielroe Ok the thing with But here is a working reproduction what i mean: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Yes, it might be that you are on a version of edge before the PR, which is why a repro would be helpful. I like the point about priority. But it might be more than just sorting them. See for example this logic in framework/packages/kit/src/components.ts Lines 54 to 63 in a41644e
|
The The priority issue: framework/packages/nuxt/src/components/scan.ts Lines 125 to 128 in 07fa104
|
Here is the priority issue thing. Please run |
I give up on the prefix thing....seems to be working now. Renaming the ticket so its accurate |
Thanks for providing reproduction @CodeDredd ππΌ Locally trying and debugging, this is normalized output of componentDirs:
Obviously, |
components/global
is not working correctly
Debugging more, it seems a regression from the content module (See #1417) which we should solve there. (@CodeDredd please ping in linked comment if you like to work on fixing it. I think you can simply reverse layers() so that last unshift goes to first) I think it would be a general good fix to ensure dirs with |
node_modules
have lower scanning priority
Nice find. I agree, user provided components should always override modules/extends. |
I dont't want make a double sort to ensure that |
make sure that node_modules is always last and global dirs always first
@pi0 now you test it again....it should be now save that |
π Linked issue
Related #6070
β Type of change
π Description
Somehow the behaviour for overwriting components which are defined by packages changed. For example if you have a
Logo
component which is stored undercomponents/global
will lose against the package likedocus
there also a componentcomponents/content/Logo
is.It gets even stranger. A component incomponents/global
will be prefixed withGlobal
which is not right. So at the end you getGlobalLogo
registeredSo for now it's not possible to overwrite a global component locally because of how the directories are listed. In my case the
Logo
from thenode_modules
package was always first and therefor no other defined component could overwrite it.π Checklist
Reproduction
Priority issue: https://codesandbox.io/s/eager-noyce-r9tjgs