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

Surface compiler warnings/errors in the UI #17

Open
Rich-Harris opened this issue May 25, 2022 · 7 comments
Open

Surface compiler warnings/errors in the UI #17

Rich-Harris opened this issue May 25, 2022 · 7 comments
Milestone

Comments

@Rich-Harris
Copy link
Member

Errors will be shown in the error overlay, but it's not the friendliest thing in the world (hard to know where the error is without sourcemaps/code frame). Warnings won't be shown at all.

Realistically this means doing analysis in a separate worker, which will be finicky

@dummdidumm
Copy link
Member

dummdidumm commented May 27, 2022

Would be solved as part of #26 if we get language tools to work in the browser - except you want a more prominent display similar to what the current REPL does.

@Rich-Harris Rich-Harris added this to the Demo milestone Jun 9, 2022
@Rich-Harris
Copy link
Member Author

It occurs to me that since compiler errors are being surfaced via the Vite overlay, warnings probably should be too. @dominikg do you know if that's possible?

@dominikg
Copy link
Member

dominikg commented Jun 9, 2022

Possible from v-p-s via custom message on vite websocket. Either from onwarn or directly in compile util.

Needs a new config option (disabled by default) and possibly some ui/console.log implementation so it makes sense outside of learn.svelte.dev

@dominikg
Copy link
Member

dominikg commented Jun 9, 2022

We already have some treatment for onwarn so adding it isn't a big deal. sveltejs/vite-plugin-svelte#372

@dominikg
Copy link
Member

dominikg commented Jun 9, 2022

From a ux perspective it doesn't make sense to use a blocking overlay for warnings.

Not sure how to get these displayed directly in the editor pane but as long as the sourcemaps are ok it should work. Unfortunately preprocessor sourcemaps are hit and miss, so ymmv.

Rich-Harris pushed a commit that referenced this issue Mar 14, 2023
Rich-Harris added a commit that referenced this issue Mar 14, 2023
Co-authored-by: Rich Harris <git@rich-harris.dev>
@Rich-Harris
Copy link
Member Author

Implemented inline warnings. Errors are still a TODO, but warnings were the priority since these don't surface in the Vite overlay, and the tutorial text refers to a11y warnings very early on. This now appears on hover:

image

@dominikg
Copy link
Member

ohhh, this is nice!

Idea: would it be possible to have a similar style for the warning on left and right pane so that the user immediately recognizes it?
The left (orange border, dark bg) is a bit more visually appealing to me but the borderless light orange bg might work better for the linine case on the right.

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

No branches or pull requests

3 participants