Skip to content
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

chore(major): leave major comments on how to improve highlighting #5648

Merged
merged 1 commit into from
May 25, 2023

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented May 25, 2023

Summary

A problem we currently have (see #5237) is that escapeHTML is one of the slower parts of InstantSearch.

With `html``/jsx rendering without dangerousInnerHtml, we no longer need to escape by default, but for that to work, escaping and not escaping should both leave the "placeholders" in the final output.

Current workaround for the performance impact: pass escapeHTML={false} to every Hits/infiniteHits etc. and <Configure highlightPreTag={TAG_REPLACEMENT.highlightPreTag} highlightPostTag={TAG_REPLACEMENT.highlightPostTag} />

Result

@MAJOR comments on how to avoid the need for escapeHTML for hits. Facets can also be done at the same time.

A problem we currently have (see #5237) is that escapeHTML is one of the slower parts of InstantSearch.

With `html``/jsx rendering without dangerousInnerHtml, we no longer need to escape by default, but for that to work, escaping and not escaping should both leave the "placeholders" in the final output.

Current workaround for the performance impact: pass `escapeHTML={false}` to every Hits/infiniteHits etc. and `<Configure highlightPreTag={TAG_REPLACEMENT.highlightPreTag} highlightPostTag={TAG_REPLACEMENT.highlightPostTag} />`
@Haroenv Haroenv requested review from a team, dhayab and aymeric-giraudet and removed request for a team May 25, 2023 08:26
@codesandbox-ci
Copy link

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

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
algolia/instantsearch Configuration
algolia/instantsearch Configuration

Copy link
Member

@aymeric-giraudet aymeric-giraudet left a comment

Choose a reason for hiding this comment

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

Nice anticipation !
Wasn't aware of this issue, I'll make sure to mention it for the migration of RIS to RISH :)

@Haroenv Haroenv merged commit 14f1235 into master May 25, 2023
4 checks passed
@Haroenv Haroenv deleted the chore/major-markers-highlight branch May 25, 2023 08:54
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.

None yet

2 participants