Document the support of transpiled code#277
Conversation
matthewloring
left a comment
There was a problem hiding this comment.
Looks good with a few nits.
README.md
Outdated
|
|
||
|  | ||
|
|
||
| Note that the directory layout of the code that is being debugged does not have to exactly match the source code specified in the Debug UI. In particular, if a snapshot is specified in a file in the Debug UI, a breakpoint is set in the corresponding file in the code of the running instance that matches the most path components of the file specified in the Debug UI starting from the rightmost path component and working left. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
| /running/instance/a/index.js | ||
| /running/instance/b/a/index.js | ||
| ``` | ||
| Now suppose on your device you have a copy of the code as follows, and you have selected the local `/your/device` directory in the Debug UI as the directory containing the code to debug. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
|
||
| In this case, if you specify a snapshot in file `/your/device/b/a/index.js` in the Debug UI, the debugger will identify that that file corresponds to the file `/running/instance/b/a/index.js` of the code on the running instance, and the breakpoint will hit when the specified line of `/running/instance/b/a/index.js` is reached. | ||
|
|
||
| Note, however, if a snapshot is specified for the file `/your/device/a/index.js` in the Debug UI, then the debugger would not know whether this file corresponds to the file `/running/instance/a/index.js` or `/running/instance/b/a/index.js`. If such an ambiguity occurs, a message will be displayed in the Debug UI. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
|
||
| The debugger supports the use of transpiled code, whether it be Javascript to Javascript transpilation or transpilation from another language (such as Typescript) to Javascript. In order to use transpiled code with the debugger, sourcemaps need to be generated with the transpiled code. The sourcemaps can either be included inline in the transpiled code or provided in separate `.js.map` files. | ||
|
|
||
| To use the debugger, the only files that are needed at runtime are the transpiled files as well as the generated sourcemap files (if the sourcemaps are not inlined). In particular, the original source does not need to be available to the debugger at runtime. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
|
||
| ## Support for Transpiled Code | ||
|
|
||
| The debugger supports the use of transpiled code, whether it be Javascript to Javascript transpilation or transpilation from another language (such as Typescript) to Javascript. In order to use transpiled code with the debugger, sourcemaps need to be generated with the transpiled code. The sourcemaps can either be included inline in the transpiled code or provided in separate `.js.map` files. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
| ``` | ||
| Now suppose on your local machine you have a copy of the code as follows, and you have selected the `/local/machine` directory in the Debug UI as the directory containing the code to debug. | ||
| ``` | ||
| /local/machine/package.json |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
| /local/machine/b/a/index.js | ||
| ``` | ||
|
|
||
| In this case, if you specify a snapshot in file `/local/machine/b/a/index.js` in the Debug UI, the debugger will identify that that file corresponds to the file `/running/instance/b/a/index.js` of the code on the running instance, and the breakpoint will hit when the specified line of `/running/instance/b/a/index.js` is reached. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
|
||
| Note, however, if a snapshot is specified for the file `/local/machine/a/index.js` in the Debug UI, then the debugger would not know whether this file corresponds to the file `/running/instance/a/index.js` or `/running/instance/b/a/index.js`. If such an ambiguity occurs, a message will be displayed in the Debug UI. | ||
|
|
||
| In this case, the `appPathRelativeToRepository` configuration option can be used to specify the directory containing the application's `package.json` file to help resolve the ambiguity. In the example above, if the `appPathRelativeToRepository` configuration option is set to `/local/machine`, the debugger would be able to identify `/running/instance/a/index.js` as the file where the breakpoint should be set. See the [Debugger Agent Settings](#debugger-agent-settings) section for more information on configuring the debugger. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ofrobots
left a comment
There was a problem hiding this comment.
LGTM with some copy edits.
README.md
Outdated
|
|
||
|  | ||
|
|
||
| Note that the directory layout of the code that is being debugged does not have to exactly match the source code specified in the Debug UI. In particular, if a snapshot is specified in a file in the Debug UI, a breakpoint is set in the deployed file with the longest matching path suffix. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
|
||
| The debugger supports the use of transpiled code, whether it be Javascript to Javascript transpilation or transpilation from another language (such as Typescript) to Javascript. In order to use transpiled code with the debugger, sourcemaps need to be generated with the transpiled code. The sourcemaps need to be provided in `.js.map` files. | ||
|
|
||
| To use the debugger, the only files that are needed in the deployment environment are the transpiled files as well as the generated sourcemap files. In particular, the original source does not need to be available to the debugger in the deployment environment. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
|
||
| To use the debugger, the only files that are needed in the deployment environment are the transpiled files as well as the generated sourcemap files. In particular, the original source does not need to be available to the debugger in the deployment environment. | ||
|
|
||
| Instead, the original source code is provided to the Debug UI to specify snapshots. When specifying a snapshot in an original source file in the Debug UI, the corresponding file and line in the transpiled code is automatically determined based on the sourcemap files provided with the transpiled code at runtime. See the [Using the Debugger](#using-the-debugger) section for more information about using the Debug UI. In addition, the exact directory layout of the original source is somewhat flexible, just as it is with the use of non-transpiled code as described in the [Using the Debugger](#using-the-debugger) section. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
|
|
||
| In this case, if you specify a snapshot in file `b/a/index.js` in the Debug UI, the debugger will identify that that file corresponds to the file `/running/instance/b/a/index.js` of the code on the running instance, and the breakpoint will hit when the specified line of `/running/instance/b/a/index.js` is reached. | ||
|
|
||
| Note, however, if a snapshot is specified for the file `a/index.js` in the Debug UI, then the debugger would not know whether this file corresponds to the file `/running/instance/a/index.js` or `/running/instance/b/a/index.js`. If such an ambiguity occurs, a message will be displayed in the Debug UI. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
No description provided.