Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable typescript sourcemaps for debugging locally installed labextensions #7541

Merged

Conversation

telamonian
Copy link
Member

Our webpack config for the release build is currently broken w.r.t. source maps in labextensions. Effectively, what happens right now is that even if an extension ships it's own typescript source maps in perfect working order, when jupyter lab build is run those .js.map files will be thrown out in favor of (javascript, not typescript) source maps produced by the source map tool in webpack.

This is a minimal fix that just covers the case of a locally installed extension. There are other use cases that we should maybe support (normally installed extensions, core packages in a release build), but we should definitely support typescript source maps for labextensions under active development (ie locally installed extensions).

References

This issue has been fixed and was rebroken at least once before. I think the complexity of having two source map tools (one in tsc and one in webpack) in the build chain, each with their own arcane set of options, probably has something to do with it.

refs:
#2922 (original fix)
#3093 (rebreak)
jupyterlab/jupyterlab-git#447 (example of PR to correctly configure ts source maps in an extension)

Code changes

Made needed tweaks to jupyterlab/staging/webpack.config.js and copied them over to dev_mode/webpack.config.js

User-facing changes

Extension devs will get typescript source maps to use when debugging local extensions in eg DevTools, given the correct config . Easiest config is to make sure the following is in tsconfig.json:

{
  "compilerOptions": {
    "inlineSources": true,
    "sourceMap": true,
    ...
  },
  ...
}

Backwards-incompatible changes

None

@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@blink1073 blink1073 added this to the 2.0 milestone Nov 21, 2019
@blink1073 blink1073 merged commit 908ec55 into jupyterlab:master Nov 21, 2019
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Dec 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Build System
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants