-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
[Feature] Create small .js file conaining ONLY search-related functionality (for use in browser) #222
Comments
There's a If you import that class (instead of `Client), your bundler should automatically tree-shake and only include a smaller subset of the files just required for search in your final build. |
OK, I did it:
And analyzer tells us this: 69 KB altogether, plus 71 KB "unknown sources" (correct me if i wrong. The sizes this analyzer shows - are they minimized sizes or not?) |
UPDATE: Running
About 10 screens of such messages. |
Yes, I fully agree, the bundle size should really be optimized. For browser use I am not even sure we need axios at all? Given that nodejs has a ntive fetch implementation by now, IMHO this should be completely removed. To clarify, I compared the file size of our bundle with SearchClient and Client and there was no difference in kb size. |
Description
Having full functionality of Typeset API in one file (typesense.min.js, about 95 kB) is great - when you need this functionality. But when your code works in web browser - all you do is something like this:
I mean - the end-user is not creating collections/documents/synonyms/aliases...
The end-user just searching.
Expected Behavior
There is a need for something like
typesense-search.js
.It should contains Typesense.SearchClient and ... basically that's it.
Should have enough functionality to do search in browser.
Should be... I would say... less than 30 kB
The text was updated successfully, but these errors were encountered: