Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More visible explanation of mholt#163 in the docs
  • Loading branch information
nathancahill committed May 22, 2015
1 parent 9218c0a commit 4602d05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs.html
Expand Up @@ -414,7 +414,7 @@ <h5 id="config-details">Config Options</h5>
<code>worker</code>
</td>
<td>
Whether or not to use a <a href="/faq#workers">worker thread</a>. Using a worker will keep your page reactive, but may be slightly slower.
Whether or not to use a <a href="/faq#workers">worker thread</a>. Using a worker will keep your page reactive, but may be slightly slower. Web Workers also load the entire Javascript file, so be careful when <a href="/faq#combine">combining other libraries</a> in the same file as Papa Parse.
</td>
</tr>
<tr>
Expand Down
5 changes: 5 additions & 0 deletions faq.html
Expand Up @@ -203,6 +203,11 @@ <h6>How do I use a worker?</h6>
Just specify <code>worker: true</code> in your <a href="/docs#config">config</a>. You'll also need to make a <code>complete</code> callback (unless you're streaming) so that you can get the results, because using a worker makes the parse function asynchronous.
</p>

<h6>Can I use a worker if I combine/concatenate my Javascript files?</h6>
<p>
Probably not. It's safest to concatenate the rest of your dependencies and include Papa Parse in a seperate file. Any library that expects to have access to the <code>window</code> or DOM will crash when executed in a worker thread. Only put <a href="/faq#combine">other libraries in the same file</a> if they are ready to be used in worker threads.
</p>

<h6>When should I use a worker?</h6>
<p>
That's up to you. The most typical reason to use a web worker is if your web page becomes unresponsive during parsing. In other words, if it freezes and you can't click things or the scrolling becomes choppy. If that happens, some browsers (like Firefox) will warn the user that a script has become unresponsive or is taking a long time (even if it's working properly). If this happens to you or some of your users, consider using a web worker, at least for the large inputs.
Expand Down

0 comments on commit 4602d05

Please sign in to comment.