Browse Source

Add documentation for JavaScript hot-swapping

workspaces
Nicolas Petton 4 years ago
parent
commit
0581101880
2 changed files with 71 additions and 6 deletions
  1. +48
    -6
      doc/Indium.texi
  2. +23
    -0
      sphinx-doc/code-evaluation.rst

+ 48
- 6
doc/Indium.texi View File

@ -21,7 +21,7 @@
@copying
@quotation
Indium 0.3.3, Apr 18, 2017
Indium 0.4.1, May 12, 2017
Nicolas Petton
@ -128,6 +128,7 @@ Interaction in JS buffers
* Evaluating and inspecting::
* Switching to the REPL buffer::
* Adding and removing breakpoints::
* Live code update (hot-swapping JavaScript sources): Live code update hot-swapping JavaScript sources.
The inspector
@ -507,6 +508,7 @@ add or remove breakpoints from your buffers.
* Evaluating and inspecting::
* Switching to the REPL buffer::
* Adding and removing breakpoints::
* Live code update (hot-swapping JavaScript sources): Live code update hot-swapping JavaScript sources.
@end menu
@ -530,7 +532,7 @@ The entire buffer can be evaluated with @code{M-x indium-eval-buffer}.
Press @code{C-c C-z} from any buffer with @code{indium-interaction-mode} turned on to
switch back to the REPL buffer (see @ref{11,,The REPL}).
@node Adding and removing breakpoints,,Switching to the REPL buffer,Interaction in JS buffers
@node Adding and removing breakpoints,Live code update hot-swapping JavaScript sources,Switching to the REPL buffer,Interaction in JS buffers
@anchor{code-evaluation adding-and-removing-breakpoints}@anchor{1e}
@subsection Adding and removing breakpoints
@ -571,13 +573,53 @@ updated automatically. You can either refresh the page or evaluate
@end quotation
@end cartouche
@node Live code update hot-swapping JavaScript sources,,Adding and removing breakpoints,Interaction in JS buffers
@anchor{code-evaluation live-code-update-hot-swapping-javascript-sources}@anchor{20}
@subsection Live code update (hot-swapping JavaScript sources)
Indium supports live code updates without the need to reload the browser tab or
restart the nodejs process.
This feature works with by hot-swapping the script source, and works even with
lexical closures.
@cartouche
@quotation Note
This feature currently in only available for Chrome & Chromium.
@end quotation
@end cartouche
@cartouche
@quotation Warning
Stability issues have been reported when using this feature with
Chrome 57 and earlier. We strongly encourage you to use Chrome >=
58 when using live code updates.
@end quotation
@end cartouche
To enable live updates, make sure Indium is set up to use local files (see
@ref{e,,Using local files when debugging}).
@itemize -
@item
@code{C-c u}: Updates the runtime JavaScript source with the contents of the
current buffer.
@item
@code{(setq indium-update-script-on-save t)}: Automatically update the runtime
script JavaScript source after each buffer save.
@end itemize
@node The stepping debugger,The inspector,Interaction in JS buffers,Table of contents
@anchor{debugger doc}@anchor{20}@anchor{debugger debugger}@anchor{1f}@anchor{debugger the-stepping-debugger}@anchor{21}
@anchor{debugger doc}@anchor{21}@anchor{debugger debugger}@anchor{1f}@anchor{debugger the-stepping-debugger}@anchor{22}
@section The stepping debugger
@node The inspector,,The stepping debugger,Table of contents
@anchor{inspector the-inspector}@anchor{22}@anchor{inspector inspector}@anchor{14}@anchor{inspector doc}@anchor{23}
@anchor{inspector the-inspector}@anchor{23}@anchor{inspector inspector}@anchor{14}@anchor{inspector doc}@anchor{24}
@section The inspector
@ -597,7 +639,7 @@ object links from the REPL buffer.
@end menu
@node Using the inspector,,,The inspector
@anchor{inspector using-the-inspector}@anchor{24}
@anchor{inspector using-the-inspector}@anchor{25}
@subsection Using the inspector
@ -657,7 +699,7 @@ Jump to the previous object in the inspector
@node Indices and tables,,Table of contents,Top
@anchor{index indices-and-tables}@anchor{25}
@anchor{index indices-and-tables}@anchor{26}
@chapter Indices and tables


+ 23
- 0
sphinx-doc/code-evaluation.rst View File

@ -51,3 +51,26 @@ Indium debugger pops up (see :ref:`debugger`).
updated automatically. You can either refresh the page or evaluate
``indium-reload``.
Live code update (hot-swapping JavaScript sources)
--------------------------------------------------
Indium supports live code updates without the need to reload the browser tab or
restart the nodejs process.
This feature works with by hot-swapping the script source, and works even with
lexical closures.
.. Note:: This feature currently in only available for Chrome & Chromium.
.. Warning:: Stability issues have been reported when using this feature with
Chrome 57 and earlier. We strongly encourage you to use Chrome >=
58 when using live code updates.
To enable live updates, make sure Indium is set up to use local files (see
:ref:`local-files`).
- ``C-c u``: Updates the runtime JavaScript source with the contents of the
current buffer.
- ``(setq indium-update-script-on-save t)``: Automatically update the runtime
script JavaScript source after each buffer save.

Loading…
Cancel
Save