Skip to content

Commit

Permalink
fixed debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckJonas committed Apr 18, 2019
1 parent 800e15f commit 5b1a86c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
9 changes: 7 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
"type": "chrome",
"request": "launch",
"sourceMaps": true,
"url": "http://localhost:8080",
"url": "https://c.na73.visual.force.com/apex/app?local=1",
"webRoot": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"node_modules/**"
],
"runtimeArgs": [
"--remote-debugging-port=9222", //Open in port 9222 (standard chrome debug port)
"--allow-insecure-localhost=1"
],
"sourceMapPathOverrides": {
"webpack:///*": "${webRoot}/*"
}
},
"smartStep": true
}
]
}
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,16 @@ Unfortunately the port isn't currently managed from a single point and must be u
1. in `package.json`, under the `config` section, update `PORT` constant
2. in `/force-app/main/default/pages/App.Page`, update the "Local Asset" panel: `https://localhost:XXXX/app.js`

### vscode Chrome Debugger

It is possible to debug right from vscode. To do so:

1. install [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome)
2. update `.vscode/launch.json` -> `url` to reference the url you want to debug
3. `npm start`
4. `f5` or launch `debug locally` configuration
5. you may need to Enable [Allow Insecure Localhost](chrome://flags/#allow-insecure-localhost) again if it opens in a different instance of chrome

## OTHER USEFUL STUFF

### vscode
Expand All @@ -152,12 +162,10 @@ Highly recommend using vscode (typescript code completion, in editor terminal, e

plugins:

* [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome): Allows debugging in vscode
*
* [Editor Config](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig): auto-set formatting options for everyone
* [TSlint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint): green squigglies everywhere!
* [Salesforce Extensions for VS Code](https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode): gives your code completion on your `force-app` and ability to excute commands against the CLI
* [Auto Close Tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag)
* [Typescript Hero](https://marketplace.visualstudio.com/items?itemName=rbbit.typescript-hero): auto-imports, etc
* [Jest](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest): run tests on save

### helpful linkies
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = (env: any = {}) => {
const config: webpack.Configuration = {
mode,
cache: true,
devtool: isBuild ? 'source-map' : 'eval-source-map',
devtool: isBuild ? 'source-map' : 'source-map',
devServer,
context: PATHS.root,
entry: {
Expand Down
13 changes: 0 additions & 13 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ class App extends React.Component<{}, AppState> {
if (accs.length > 0) {
this.setState({ acc: accs[0] });
}

}

private showDrawer = () => {
this.setState({
drawerVisible: true,
});
}

private hideDrawer = () => {
this.setState({
drawerVisible: false,
});
}

public render() {
Expand Down

0 comments on commit 5b1a86c

Please sign in to comment.