Skip to content

Conversation

@chasenlehara
Copy link
Member

@chasenlehara chasenlehara commented Jul 3, 2017

This takes all of the Lunr code and moves it to a web worker, so the indexing and searching process doesn’t block the main thread. This also adds a loading indicator when a search is being performed, which isn’t visible if the main thread is locked, hence the need for using a web worker.

This is a WIP because:

  • the way the web worker is loaded is a terrible hack
  • the Safari exception is back 😢

Before:
before

After:
after

This takes all of the Lunr code and moves it to a web worker, so the indexing and searching process doesn’t block the main thread.

This is a WIP because the way the web worker is loaded is a terrible hack.
@imaustink
Copy link
Contributor

@chasenlehara Matthew said the proper way to setup the build file for the web worker is to just have multiple calls to stealTools in the same file, one for each output file. He also noted that we can't use an object for the stealTools config ☹️

@chasenlehara chasenlehara merged commit 4d0208f into master Jul 3, 2017
@chasenlehara chasenlehara deleted the 363-web-worker branch July 3, 2017 21:17
@chasenlehara chasenlehara changed the title WIP: Move search into a web worker Move search into a web worker Jul 3, 2017
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.

3 participants