More informative errors for HMR errors
Description
Implements a new error overlay to replace the default Vite HMR error overlays.
Catalogs errors in hmrErrorHandling.js in component-utilities.
The idea here is to receive a Vite error message, evaluate the content it shares with us, then make an inference and supply the user with a more informative message.
This is a manual and inaccurate way to do this, but it's better than the messages our users currently receive from Vite.
To do
- Tighten up some of the rules around “component was left open” - this is too eager a message at the moment
- Confirm that this approach doesn’t slow down HMR for users
- Check out what’s possible for logging - I don’t want to log the actual errors if we can avoid it…it’s a lot of text to the console and doesn’t contain much helpful info for a user (if any)
- I’d like to log our custom errors to the console if we can
Example
Checklist
- [x] For UI or styling changes, I have added a screenshot or gif showing before & after
- [x] I have added a changeset
🦋 Changeset detected
Latest commit: dce0c98e1451ec9c0ec3625582ce5b4126dc330a
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 5 packages
| Name | Type |
|---|---|
| @evidence-dev/component-utilities | Minor |
| @evidence-dev/core-components | Minor |
| @evidence-dev/components | Minor |
| @evidence-dev/evidence | Major |
| evidence-test-environment | 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
Deploy Preview for evidence-development-workspace ready!
| Name | Link |
|---|---|
| Latest commit | dce0c98e1451ec9c0ec3625582ce5b4126dc330a |
| Latest deploy log | https://app.netlify.com/sites/evidence-development-workspace/deploys/65e79048fb98ab000809843b |
| Deploy Preview | https://deploy-preview-1346--evidence-development-workspace.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Mar 5, 2024 9:36pm |
| evidence-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Mar 5, 2024 9:36pm |
in the most recent commit, a new line is added to the svelte config. Initially I tried to add this to the config for the svelte vite plugin in vite.config as shown here (which feels like a better place for it), but that didn't work.
When I tried to trace the path that a warning takes in the svelte vite plugin, I noticed that svelte-tiny-linked-charts seems to generate a lot of work/noise for the preprocessor. I don't know for sure, but I suspect this has an impact on performance of the initial page load since it's duplicating a bunch of the workflows
We should deprecate this feature I think - we've talked about it before
What's the story on this PR currently?
cc: @mcrascal @Winterhart
@ItsMeBrianD I can take a look. It was paused during the USQL release, but I suspect it's good to go.
@ItsMeBrianD It's not ready to go -- I'm getting URL.split is not a function when trying to boot it up.
This one seems to be working on my end