Skip to content

Commit

Permalink
feat(app): add renderer source maps (#17062)
Browse files Browse the repository at this point in the history
Closes EXEC-1046

Currently, whenever browser layer errors occur in an electron app production build, renderer process debugging is difficult, because production builds are minified. Enter source maps, which, when utilized alongside a library that provides stack trace support for V8, make error messaging much more useful.
  • Loading branch information
mjhuff authored Dec 12, 2024
1 parent 09febe7 commit 0713563
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"rxjs": "^6.5.1",
"semver": "5.7.2",
"simple-keyboard-layouts": "3.4.41",
"source-map-support": "0.5.10",
"styled-components": "5.3.6",
"typeface-open-sans": "0.0.75",
"uuid": "3.2.1"
Expand All @@ -75,6 +76,7 @@
"@types/jszip": "3.1.7",
"@types/mixpanel-browser": "^2.35.6",
"@types/node-fetch": "2.6.11",
"@types/source-map-support": "0.5.10",
"@types/styled-components": "^5.1.26",
"axios": "^0.21.1",
"electron-updater": "6.3.9",
Expand Down
1 change: 1 addition & 0 deletions app/src/App/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type * as React from 'react'
import { useSelector } from 'react-redux'
import 'source-map-support/register'

import { Flex, POSITION_FIXED, DIRECTION_ROW } from '@opentrons/components'

Expand Down
3 changes: 2 additions & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"outDir": "lib",
"paths": {
"/app/*": ["./src/*"]
}
},
"sourceMap": true,
},
"include": ["typings", "src"],
"exclude": ["**/*.stories.tsx"]
Expand Down
1 change: 1 addition & 0 deletions app/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig(
build: {
// Relative to the root
outDir: 'dist',
sourcemap: true
},
plugins: [
react({
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3684,6 +3684,7 @@
rxjs "^6.5.1"
semver "5.7.2"
simple-keyboard-layouts "3.4.41"
source-map-support "0.5.10"
styled-components "5.3.6"
typeface-open-sans "0.0.75"
uuid "3.2.1"
Expand Down Expand Up @@ -6122,6 +6123,13 @@
resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.8.tgz#518609aefb797da19bf222feb199e8f653ff7627"
integrity sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==

"@types/[email protected]":
version "0.5.10"
resolved "https://registry.yarnpkg.com/@types/source-map-support/-/source-map-support-0.5.10.tgz#824dcef989496bae98e9d04c8dc1ac1d70e1bd39"
integrity sha512-tgVP2H469x9zq34Z0m/fgPewGhg/MLClalNOiPIzQlXrSS2YrKu/xCdSCKnEDwkFha51VKEKB6A9wW26/ZNwzA==
dependencies:
source-map "^0.6.0"

"@types/styled-components@^5.1.26":
version "5.1.34"
resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-5.1.34.tgz#4107df8ef8a7eaba4fa6b05f78f93fba4daf0300"
Expand Down Expand Up @@ -20718,6 +20726,14 @@ source-map-resolve@^0.5.0:
source-map-url "^0.4.0"
urix "^0.1.0"

[email protected]:
version "0.5.10"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c"
integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"

source-map-support@^0.5.16, source-map-support@^0.5.19, source-map-support@^0.5.6, source-map-support@~0.5.12, source-map-support@~0.5.20:
version "0.5.21"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f"
Expand Down

0 comments on commit 0713563

Please sign in to comment.