instantsearch icon indicating copy to clipboard operation
instantsearch copied to clipboard

fix(dependencies): replace qs by neoqs

Open Haroenv opened this issue 1 year ago • 5 comments

Summary

Replace qs by neoqs. This doesn't have a bundlesize change, but it avoids us ever accidentally updating qs and having a big bump

Result

neoqs is API-compatible with qs in the legacy mode, and thus this isn't a breaking change. Of course if someone was already using qs and relying on it being deduplicated with the InstantSearch version.

URLs parsed and created by qs and neoqs are compatible

Haroenv avatar Jul 23 '24 10:07 Haroenv

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9f92e8c3b7fd59e23e3336ba0ffb109bad9a72f1:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

codesandbox-ci[bot] avatar Jul 23 '24 10:07 codesandbox-ci[bot]

Hmm bundle size is larger, doesn't seem to be due to non-working deduplication, maybe other features added since [email protected]? cc @puruvjdev is this expected?

Haroenv avatar Jul 23 '24 13:07 Haroenv

Hmm bundle size is larger, doesn't seem to be due to non-working deduplication, maybe other features added since [email protected]? cc @puruvjdev is this expected?

I am looking at bundlephobia to see if that's the case, but it seems to be down. I'll let you know if that's the case.

EDIT: well, its after 6.9.7 only that the library went crazy

CleanShot 2024-07-23 at 19 22 54

PuruVJ avatar Jul 23 '24 13:07 PuruVJ

Well the real thing is that /legacy is compiled to ES5, so it does add an extra 400bytes(min+br). That is the additional size we're seeing here. This is done so even very old libs and apps can use neoqs and avoid dependency hell. Also, there have been some additional features since 6.9.7 which do account for a few extra bytes here.

Only way the size would go down is by using the default build, which is ESM-only.

I'd suggest using neoqs/legacy now with the extra 1KB, if it's not too much, but whenever in future you decide to drop CJS support, switch to neoqs/modern(It's gonna be 3.4KB only 👀, releasing sometime next week).

Lemme know if that helps. And thanks for considering this lib

PuruVJ avatar Jul 23 '24 14:07 PuruVJ

Any update on this? 😁

PuruVJ avatar Aug 02 '24 14:08 PuruVJ