-
Notifications
You must be signed in to change notification settings - Fork 443
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
imgbundler and CLI fixes #278
Conversation
Example: scriptserver: {
shape: image
icon: https://iconss.terrastruct.com/tech/022-server.svg
}
github: {
shape: image
icon: https://icon2.terrastruct.com/dev/github.svg
}
tri: {
shape: image
icon: /tmp/jingle.png
}
server -> github watch terminalwatch renderprod terminalprod renderthoughtsnot a fan of the prod render, maybe we ought to include the error within the svg just like I was doing before. |
I opened #280 |
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.
👏 . imgbundler code so much cleaner.
add in the release notes that the bundle flag now works.
removing the conversion from text/xml
to image/svg+xml
would cause issues viewing in browser i think. it's why i did it in the first place: https://stackoverflow.com/questions/31755822/why-does-this-svg-work-being-viewed-raw-in-the-browser-but-not-in-a-webpage
@alixander what's your d2 text there? |
test: {
icon: https://no.com
}
test2: {
icon: https://no.com
}
works: {
icon: https://www.howtogeek.com/wp-content/uploads/2018/06/shutterstock_1006988770.png
}
test -> test2 |
yeah, maybe some SVG thing. we'll just note in that issue. |
cc @alixander this has been broken for so long lol From when the code was in the monorepo.
- Make bundle flag work - Display error and update render at the same time in watch mode. Before we would just display the render and not show the error. - Rename imgbundler.InlineX functions to BundleX - Print imgbundler fetch/readFile errors as they happen in the workers instead of coalescing and printing at the end. - Minor performance improvements by using []byte everywhere possible. - Improved symbol naming in imgbundler code - **major**: Ignore already bundled images instead of trying to os.ReadFile them.
The order of priority in detecting the mime type is now: - Content-Type response header - File path extension - http.DetectContentType
See individual commits.
And please test @alixander