Add a Codex build that contains only the TypeaheadSearch component and its dependencies, like in WVUI.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| build: Add the @wikimedia/codex-search package | design/codex | main | +620 -114 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Duplicate | None | T299666 Add TypeaheadSearch component to Codex | |||
| Resolved | • Sarai-WMDE | T297025 Add TypeaheadSearch to Codex | |||
| Resolved | Catrope | T303569 Add TypeaheadSearch-only build |
Event Timeline
Change 769811 had a related patch set uploaded (by Catrope; author: Catrope):
[design/codex@main] build: Add a separate build for TypeaheadSearch
File sizes:
70323 dist/codex.es.js 40015 dist/codex.umd.js 25187 dist/codex.style.css 25205 dist/codex.style-rtl.css 42288 dist/codex-typeaheadSearch.es.js 23585 dist/codex-typeaheadSearch.umd.js 11680 dist/codex-typeaheadSearch.style.css 11682 dist/codex-typeaheadSearch.style-rtl.css
(note that the .umd.js files are minified, the .es.js files are not)
Comparing to WVUI (where commonjs2 is unminified and the other ones are minified):
30791 dist/wvui.js 185771 dist/commonjs2/wvui.commonjs2.js 22075 dist/wvui.css 26285 dist/commonjs2/wvui.css 19837 dist/wvui-search.js 12391 dist/wvui-search.css 14635 dist/commonjs2/wvui-search.css
So is the appropriate comparison codex-typeaheadSearch.umd.js (at 23.5KB) vs wvui-search.js (at 19.8KB)?
I hope an extra 4KB is not a dealbreaker. I wonder why the Codex version of this feature is larger since both versions externalize their dependencies? Differences in template compilation?
Yes. I just managed to shave 1KB off the Codex one by removing comments (which wasn't happening because Vue didn't realize it was supposed to be in production mode, due to my mode hack; I'll probably restructure this to use a separate Vite config file rather than a mode). Not sure where the rest of the difference is coming from, I think it might just be from Codex having more layers of abstraction (including the Menu component), and perhaps composition API code being a bit more verbose than option API code.
Change 769811 merged by jenkins-bot:
[design/codex@main] build: Add the @wikimedia/codex-search package