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

Add proper support for watching non-Cayo components and re-prerendering the dependent pages #47

Closed
matthew-ia opened this issue Jan 5, 2022 · 2 comments · Fixed by #59
Labels
bug Something isn't working enhancement New feature or updates to an existing feature

Comments

@matthew-ia
Copy link
Owner

Try using precinct. Looks like it has a way to get dependencies from any file. Could use this is combination with fast-glob.

On component file change detected:

  1. use fg to get all the non-Cayo components.
  2. use precinct to get all the dependencies of the pages.
  • if one of these dependencies is one of the components we found, then rerender that page
  • also make sure that component dependency has a delete require.cache(...) added to pages.js for the component
@matthew-ia matthew-ia added enhancement New feature or updates to an existing feature feature and removed feature labels Jan 5, 2022
@matthew-ia
Copy link
Owner Author

Temp fix for this added in b7871af

@matthew-ia
Copy link
Owner Author

After using cayo for a real project, this is probably worth prioritizing. Dev can be a pain because of this. Even with the last fix, the .cayo.svelte components don't seem to refresh their parent page(s). E.g., if some some.cayo.svelte is changed, and it's on page.svelte, you have to save page.svelte even if you didn't change it so it gets re-prerendered. Otherwise the changes to some.cayo.svelte don't show.

@matthew-ia matthew-ia added the bug Something isn't working label Jan 15, 2022
matthew-ia added a commit that referenced this issue Oct 5, 2022
…ss (#59)

This compilation (bundling) is uses rollup instead of the Svelte API directly (`svelte/compile` and `svelte/preprocess`), as this was initially going to use. 

---

### Fixes: 
- fix #50 
- fix #49
- fix #47
- fix #46
- fix #44
- fix #58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or updates to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant