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

fix: Added a build:dev yarn task to PVA Publish to create source maps #4831

Merged
merged 10 commits into from
Nov 17, 2020

Conversation

tonyanziano
Copy link
Contributor

Description

Webpack-generated source maps for the node-side code of the PVA publish extension do not work inside of VS Code and are not recognized by the debugger.

I have added a yarn build:dev task that will skip webpack when compiling the node code and will instead pass it to tsc to be compiled. The tsc-generated source maps do work with the debugger.

This should have no effect on the current production environment, and the developer will have to explicitly opt-in to this mode by calling yarn build:dev.

#minor

@coveralls
Copy link

coveralls commented Nov 16, 2020

Coverage Status

Coverage decreased (-0.009%) to 54.456% when pulling 2d2dafc on toanzian/fix/pva-sourcemaps into 6cf259a on main.

entry: './src/node/index.ts',
mode: isDevelopment ? 'development' : 'production',
target: 'node',
devtool: isDevelopment ? 'source-map' : undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be the other way around?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want it to behave like this:

if (isDevelopment)
  // generate source maps
else 
  // don't generate source maps

Copy link
Contributor

Choose a reason for hiding this comment

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

interesting. it's usually the other way around. until we start reporting errors, I guess it doesn't matter too much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would think you would want source maps when developing so you can step through your code and work out any bugs, and then you would not want them in production to reduce size and because you aren't often debugging the production code.

We also don't copy the source files of the extensions into the production app so the source maps wouldn't even work would they?

Copy link
Contributor

Choose a reason for hiding this comment

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

Normally, you would use something like cheap-eval-source-map for dev because of build speed. In this case, we aren't concerned as much with build speed.

@tonyanziano
Copy link
Contributor Author

The source mapping might actually be a little wonky... I need to investigate and see if the breakpoints are being hit properly

@tonyanziano
Copy link
Contributor Author

I tested the branch with a clean build and the source maps are working as expected 👍

@a-b-r-o-w-n a-b-r-o-w-n merged commit f9c6e5e into main Nov 17, 2020
@a-b-r-o-w-n a-b-r-o-w-n deleted the toanzian/fix/pva-sourcemaps branch November 17, 2020 23:20
EricDahlvang pushed a commit that referenced this pull request Nov 27, 2020
…#4831)

* Added a build:dev yarn task to create working node-side sourcemaps

* Added missing newline

* Fixed up dev config

Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
benbrown pushed a commit to benbrown/BotFramework-Composer that referenced this pull request May 24, 2021
…microsoft#4831)

* Added a build:dev yarn task to create working node-side sourcemaps

* Added missing newline

* Fixed up dev config

Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
benbrown pushed a commit that referenced this pull request Jun 11, 2021
…#4831)

* Added a build:dev yarn task to create working node-side sourcemaps

* Added missing newline

* Fixed up dev config

Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…microsoft#4831)

* Added a build:dev yarn task to create working node-side sourcemaps

* Added missing newline

* Fixed up dev config

Co-authored-by: Andy Brown <asbrown002@gmail.com>
Co-authored-by: Soroush <hatpick@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants