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

Fix icon reloading logic to only trigger for relevant file changes #258

Merged
merged 2 commits into from
Dec 26, 2024

Conversation

maxchang3
Copy link
Contributor

@maxchang3 maxchang3 commented Dec 3, 2024

Description:

This PR resolves #257, where unnecessary reloads are triggered when files in unrelated directories are modified (#251). It also fixes the issue where new files added to the iconDir directory do not trigger a reload due to the watcher only listening to change events.

Changes:

  • Listens to all events to ensure that any file creation, modification, or deletion is captured.
  • Ensures that only changes within the iconDir (specifically .svg files) or the astro.config file triggers the reload event.

Testing:

Before:

image

before.mov.out.mp4

After:

image

after.mov.out.mp4

Related PR: #251

Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: 032f7d9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro-icon Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-astroicon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 10:13am
astroicon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 10:13am

@maxchang3 maxchang3 changed the title Optimize icon reloading logic to only trigger for relevant file changes Fix icon reloading logic to only trigger for relevant file changes Dec 3, 2024
@codenomnom
Copy link

@natemoo-re any chances this gets merged? It's pretty important. Thanks!

@arch-fan
Copy link
Contributor

Please merge this

@codenomnom
Copy link

@stramel sorry to bother you, but this is important, as it makes the entire library unusable.

Happy holidays! 🎈

@stramel
Copy link
Collaborator

stramel commented Dec 26, 2024

@stramel sorry to bother you, but this is important, as it makes the entire library unusable.

Happy holidays! 🎈

Happy Holidays! Apologies for not getting to this before the holiday. I will work on getting this done in the next couple days. Hoping to have a release out before the new year.

@stramel stramel added the bug Something isn't working label Dec 26, 2024
@stramel stramel merged commit 61d5da6 into natemoo-re:main Dec 26, 2024
4 checks passed
@stramel
Copy link
Collaborator

stramel commented Dec 26, 2024

Thanks!

@github-actions github-actions bot mentioned this pull request Dec 26, 2024
@stramel
Copy link
Collaborator

stramel commented Dec 26, 2024

Released in v1.1.5

@codenomnom
Copy link

@stramel thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icon reloading logic problem
4 participants