fix(nuxt): pass (and handle) relative paths in builder:watch#22333
fix(nuxt): pass (and handle) relative paths in builder:watch#22333
builder:watch#22333Conversation
|
|
Makes sense, especially because the majority of users won't rely on these paths directly.
To me this sounds reasonable, especially given no issues/feedback (known to me) to the absolute vs. relative path changes. And better monorepo layer support is another big benefit here 👍🏻 |
Good point. Then indeed relative paths make more sense. We should keep a TODO or similar though for making them absolute in the next major. |
|
I think the change to absolute makes perfect sense. https://github.com/Hebilicious/form-actions-nuxt/blob/581f8696c5768b7799dd4d10f45b77922e076c5e/packages/form-actions-nuxt/src/module.ts#L208 |
|
I've talked myself around. I'm thinking we should probably refactor this to emit relative paths again, even if we use absolute paths under-the-hood. We can then change the behaviour in a major version. Maintainers of modules who rely on absolute path can simply normalise paths with |
builder:watchbuilder:watch
🔗 Linked issue
❓ Type of change
📚 Description
For
chokidar-granularandparcelwatcher options, watch events emit the absolute path. Forchokidar, the path was relative tosrcDir. (This was an unintentionally breaking change when #20836 was merged and later made default.)This PR:
chokidar-granularandparcelwatchers also emit relative paths.The reason I've chosen this rather than reverting to previous behaviour is that 3.7 is a minor release so we can make a more significant change to this behaviour. In addition, I think it makes more sense to have absolute path when handling things like watching layers in a monorepo, which may not be 'within' the source directory of the project. However, I would welcome thoughts on this. (We could instead emit all paths as relative in parcel/chokidar-granular for backwards compatibility.)~/composablestestRelated: #22307.
TODO:
consider emitting relative paths for backwards compatibility and moving to absolute paths in a future major release. How significant do we feel this change is?📝 Checklist