chore(docs): refactor the docs app search for better bootup time

This commit refactors how the search index is built. The docsSearch service
is now defined by a provider, which returns a different implementation of
the service depending upon whether the current browser supports WebWorkers
or now.

* **WebWorker supported**: The index is then built and stored in a new worker.
The service posts and receives messages to and from this worker to make
queries on the search index.

* **WebWorker no supported**: The index is built locally but with a 500ms
delay so that the initial page can render before the browser is blocked as
the index is built.

Also the way that the current app is identified has been modified so we can
slim down the js data files (pages-data.js) to again improve startup time.

Closes #9204
Closes #9203
This commit is contained in:
Peter Bacon Darwin
2014-09-23 18:43:08 +01:00
parent fd8997551f
commit ace40d5526
19 changed files with 259 additions and 212 deletions

View File

@@ -26,6 +26,7 @@ module.exports = function debugDeployment(getVersion) {
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
'js/versions-data.js',
'js/pages-data.js',
'js/nav-data.js',
'js/docs.js'
],
stylesheets: [

View File

@@ -26,6 +26,7 @@ module.exports = function defaultDeployment(getVersion) {
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
'js/versions-data.js',
'js/pages-data.js',
'js/nav-data.js',
'js/docs.js'
],
stylesheets: [

View File

@@ -30,6 +30,7 @@ module.exports = function jqueryDeployment(getVersion) {
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
'js/versions-data.js',
'js/pages-data.js',
'js/nav-data.js',
'js/docs.js'
],
stylesheets: [

View File

@@ -29,6 +29,7 @@ module.exports = function productionDeployment(getVersion) {
'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/lang-css.js',
'js/versions-data.js',
'js/pages-data.js',
'js/nav-data.js',
'js/docs.js'
],
stylesheets: [