#community-help

Discussing Increased Bundle Size in Typesense Versions

TLDR 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.

Powered by Struct AI

1

1

Oct 03, 2022 (15 months ago)
Tom
Photo of md5-2fa64626788fd6e3a12f8cdf96ea88bd
Tom
02:22 PM
Is there any way to import the adapter with a smaller size?

I've also noticed the bundle size has increased a lot in the last few versions? (from 63kb to over 100kb?): https://bundlephobia.com/package/[email protected] Any ideas whats in the new versions since 2.4.0 ?
02:37
Tom
02:37 PM
Using typesense directly is also fairly large.

Did something happen after 1.2.2 ? See: https://bundlephobia.com/package/[email protected] for increase
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:19 PM
Starting with typesense-js v1.3, we started targeting es5 (it used to be es6 and above before that). That seems to have increased the bundle size: https://github.com/typesense/typesense-js/releases/tag/v1.3.0

1

03:21
Jason
03:21 PM
We had to do this because of an incompatibility reported by a user… Can’t remember which incompatibility exactly. If your env can target a higher ES version, you could fork the typesense-js and change tsconfig to target a higher env and use those build artifacts
Tom
Photo of md5-2fa64626788fd6e3a12f8cdf96ea88bd
Tom
03:22 PM
I think my use case is fairly simple, I'll give calling TypeSense directly via HTTP using react-query (for that sweet, sweet retry) and see if that works out okay.

If not, I'll give the fork a go.

1