-
Notifications
You must be signed in to change notification settings - Fork 334
"cleanup svg icon usage, types and href generation" once more #13771
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
Conversation
|
@vitvakatu could you also do a QA? I got a bit paranoic here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More recent versions of vite have a bugfix for no-inline with svg assets: vitejs/vite#19496 (apparently the change only affects prod builds though?)
This is fine too, though.
Yes, that matches our symptoms (I think dev buid was fine, and that's why @Frizi overlooked it). So I will try to bump vite version. That will make QA even more needed. |
|
Pushed changes. Indeed, bumping vite helped. |
on it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The application works, but unit and integration tests are not working locally because of vitejs/vite#20286
It works when using node 20.16, so I guess we should bump .node-version also.
Also there is a typecheck failure on CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually nevermind, it was misconfiguration of node version on my side. Everything seems to be working fine.
Pull Request Description
Restoring #13746
Practically, only 5021ed1 is to be reviewed.
Original description
Fixes #13712
Removed remains of svg embedding, as it turned out to not work reliably when combined with shadow-dom (i.e. in visualizations) and the exact behavior is browser dependent. I ended up just unifying all places that reference icon's href into a single function, and added a "missing icon" visual. Unfortunately that means the playwright test snapshots still attempt a potentially cross-origin fetch request to resolve the icons, which is cancelled before hitting playwright's service-worker fetch handler. Allowing cross-origin requests in svg is often possible, but for tags is not yet implemented anywhere. The only workaround that somewhat works is to run the test reporter on the same port as the app under test used to have. We unfortunately use two, so the icons will either show up in dashboard or in project-view tests.
Also deduplicated login logic in playwright tests and added extra agreement modal detection, since that modal often used to be a problem for me when running test suite locally.
The Fix
I don't know why, but adding?no-inlinesuffix made it not working.?inlinesuffix didn't work as well. Leaving now without suffix.Edit: There was a bug in vite (see comments below), so bumped vite version with some others to satisfy peer dependencies + applied some necessary changes.
Also restored the old way of documenting
SvgIconwith information why I did it that way.Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
[ ] Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
[ ] Unit tests have been written where possible.[ ] If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,or the Snowflake database integration, a run of the Extra Tests has been scheduled.