Skip to content

Conversation

@Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Nov 4, 2025

Did not remove the umd file yet, as it's used by vue instantsearch and algolia-experiences bundles, which didn't get a change in setup.

Summary

Result

Did not remove the umd file yet, as it's used by vue instantsearch and algolia-experiences bundles, which didn't get a change in setup.
@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 4, 2025

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 b7e1292:

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

@aymeric-giraudet aymeric-giraudet marked this pull request as ready for review December 30, 2025 16:53
@aymeric-giraudet aymeric-giraudet requested review from a team, aymeric-giraudet and shaejaz and removed request for a team December 30, 2025 16:53
@aymeric-giraudet
Copy link
Member

aymeric-giraudet commented Dec 30, 2025

Got it to work and tested on ecommerce-with-umd, works fine even with this minimal zod implem for what we're doing.
May still need some testing.
Also this increases the bundle size by 35% even without zod :/

@Haroenv
Copy link
Contributor Author

Haroenv commented Dec 31, 2025

That's a much larger impact than I expected for chat. Is it all because of the dependencies or also because the chat widget/connector uses a lot of local code?

default as defaultConstructor,
} from 'algoliasearch/lite';
import instantsearch from '../../src';
import type instantsearch from '../../src';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instantsearch is used as more than a type, maybe the import needs to be the umd version for storybook to avoid chat?

@Haroenv Haroenv force-pushed the master branch 3 times, most recently from c1fa2e8 to 9af869e Compare December 31, 2025 14:19
export const ZodFirstPartyTypeKind = {};
export const toJSONSchema = {};
export const safeParseAsync = {};
export const z = new Proxy(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at which point is this evaluated? do we need to check if proxy exists first in case it gets evaluated in IE11?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with chat not working in IE11, but just ensuring that the entire InstantSearch doesn't throw

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the constructor does get called directly. There are polyfills though if we still actually care about the tests passing ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to do typeof Proxy === 'object' ? new Proxy : null or similar to at least not have a global error thrown then? not sure how to check tbh, just asking

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would still throw though cause zod schemas are created when the script is evaluated... so we'd have to define all those functions just for IE11 to work and make the bundle bigger

Copy link
Contributor Author

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ but I can't approve it as I initially opened the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants