Reducing Bundle Size of Typesense-instantsearch-adapter
TLDR David raised concern about the large size of the typesense-instantsearch-adapter. Jason suggested enabling tree shaking to reduce the size and also recommended using an existing axios installation.
1
Oct 24, 2022 (12 months ago)
David
11:03 AMJason
02:59 PMMay I know what you used to generate this graphic? I can take a closer look
David
03:26 PMJason
04:00 PM1
Jason
09:28 PMwebpack-bundle-analyzer
is analyzing the full contents of your node_modules folder, which by definition doesn’t use tree shaking.Could you try turning on tree shaking in your webpack config, and then analyze the JS bundle file produced by webpack?
Separately, in your graph above, you want to include the contents of both algoliasearch-helper and instantsearch for comparison.
I also see that you already have axios installed, so I’m wondering if there’s some webpack config you could turn that just uses that axios instead of the one that’s mentioned in the typesense-js as a depenedency. That should reduce bundle size even further
Typesense
Indexed 2779 threads (79% resolved)
Similar Threads
Discussing Increased Bundle Size in Typesense Versions
Tom notices an increase in adapter and typesense bundle sizes, prompting a discussion with Jason. The latter explains a version upgrade targeting ES5 led to the increase. Tom plans to try calling TypeSense directly or using a fork.
Troubleshooting TypesenseInstantSearchAdapter without Node.js
John wanted to use TypesenseInstantSearchAdapter without Node.js. Jason helped by instructing to reference dist files directly, then fixing a bug that caused errors when doing so.
Issue Resolution on Typesense's Slack channel
Alex transferred issues from GitHub to Slack regarding a large package. Jason suggested a solution and released a reduced version. After testing, Alex confirmed the new version works well.