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(nuxt): pass (and handle) relative paths in builder:watch
#22333
Conversation
Run & review this pull request in StackBlitz Codeflow. |
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:watch
builder:watch
π Linked issue
β Type of change
π Description
For
chokidar-granular
andparcel
watcher 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-granular
andparcel
watchers 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.)~/composablestest
Related: #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