tldraw/packages/assets
alex 719332d272
serve icons via a single merged .svg file (#4150)
We currently serve icons in the form of 141 separate svg files. This is
pretty inefficient: it results in 141 http requests each with its own
overheads and costs. Each one is generally less than 1kb of data.

This PR merges all of our icons into a single 44kb icon file. Each item
in the svg has an ID, and we use the ID in the asset url to target the
specific icon. This also fixes a lot of the icon preloading issues:
because the icon file is already loaded, there's no extra request needed
when panels open etc.

I was messing with this whilst killing time before a late meeting so
made a shitty overengineered code generator, dont at me

### Change type

- [x] `improvement`

### Release notes

- Serve icons more efficiently, and make sure they're still available if
tldraw goes offline.
2024-07-15 11:03:11 +00:00
..
api-extractor.json transfer-out: transfer out 2023-04-25 12:01:25 +01:00
CHANGELOG.md Update CHANGELOG.md [skip ci] 2024-06-25 13:27:57 +00:00
imports.d.ts Asset improvements (#1557) 2023-06-09 11:43:01 +00:00
imports.js serve icons via a single merged .svg file (#4150) 2024-07-15 11:03:11 +00:00
imports.vite.d.ts [dotcom] Delete service worker, cache tldraw assets (#2552) 2024-01-19 15:31:01 +00:00
imports.vite.js serve icons via a single merged .svg file (#4150) 2024-07-15 11:03:11 +00:00
LICENSE.md Change licenses to tldraw (#2167) 2023-12-19 10:41:01 +00:00
modules.d.ts transfer-out: transfer out 2023-04-25 12:01:25 +01:00
package.json Update CHANGELOG.md [skip ci] 2024-06-25 13:27:57 +00:00
README.md Update READMEs, add form link (#3741) 2024-05-12 20:48:07 +00:00
selfHosted.d.ts Asset improvements (#1557) 2023-06-09 11:43:01 +00:00
selfHosted.js serve icons via a single merged .svg file (#4150) 2024-07-15 11:03:11 +00:00
tsconfig.json Check tsconfig "references" arrays (#2891) 2024-02-21 13:07:53 +00:00
types.d.ts Add offline icon back (#4127) 2024-07-10 08:51:06 +00:00
urls.d.ts Asset improvements (#1557) 2023-06-09 11:43:01 +00:00
urls.js serve icons via a single merged .svg file (#4150) 2024-07-15 11:03:11 +00:00
utils.d.ts Asset improvements (#1557) 2023-06-09 11:43:01 +00:00
utils.js Asset improvements (#1557) 2023-06-09 11:43:01 +00:00

@tldraw/assets

This package contains assets that are used by tldraw, including icons and fonts.

Distributions

You can find tldraw on npm here.

Contribution

Please see our contributing guide. Found a bug? Please submit an issue.

License

The tldraw source code and its distributions are provided under the tldraw license. This license does not permit commercial use. To purchase a commercial license or learn more, please fill out this form.

Trademarks

Copyright (c) 2023-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.

Contact

Find us on Twitter/X at @tldraw.

Community

Have questions, comments or feedback? Join our discord or start a discussion. For the latest news and release notes, check out our Substack.