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

feat(jsx-email): reimplement template dependency watching in preview #286

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

shellscape
Copy link
Owner

Component / Package Name:

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

This reimplements the template dependency watching that was rolled back in #256. Proper checks to filter out node_modules and non-template files, where the watch directory is calculated to be a directory in which node_modules or other source files exist or will be created.

The primary scenario for this is where a user has email components in a monorepo package, elsewhere in the repo, and by way of analyzing all dependencies and making sure that they're in the set of files we care about, we can avoid trying to build invalid files.

There's one small caveat on this: any templates with dependencies in node_modules will be ignored on this iteration, and will have to be rebuilt, and the preview server restarted when changed. This is intentional and incremental to assert that we aren't inserting new instability into the preview server. We'll follow up with another patch PR to re-enable template rebuild on dependency change in node_modules down the road.

@shellscape shellscape requested a review from lordelogos January 20, 2025 04:49
Copy link
Collaborator

@lordelogos lordelogos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments for you on Discord.
Works as expected.

@shellscape shellscape merged commit c5daa3b into main Jan 28, 2025
6 checks passed
@shellscape shellscape deleted the feat/jsx-email/reimpl-dep-watch branch January 28, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants