Skip to content

Commit

Permalink
Fix issues with missing sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
somebody1234 committed May 5, 2023
1 parent 402c95b commit 639cb7f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/ide-desktop/lib/client/esbuild-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function bundlerOptions(
PROJECT_MANAGER_IN_BUNDLE_PATH: JSON.stringify(projectManagerInBundlePath),
/* eslint-enable @typescript-eslint/naming-convention */
},
sourcemap: true,
sourcemap: 'inline',
external: ['electron'],
}
}
9 changes: 3 additions & 6 deletions app/ide-desktop/lib/client/src/bin/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ const HTTP_STATUS_OK = 200
// === URL Parameters ===
// ======================

/** Construct URL query with the given parameters. For each `key` - `value` pair,
/** Construct a URL query string with the given parameters. For each `key` - `value` pair,
* `key=value` will be added to the query. */
export function urlParamsFromObject(obj: Record<string, string>) {
const params = []
for (const [key, value] of Object.entries(obj)) {
params.push(`${key}=${encodeURIComponent(value)}`)
}
return params.length === 0 ? '' : '?' + params.join('&')
const params = new URLSearchParams(obj).toString()
return params ? '?' + params : ''
}

// ==============
Expand Down
1 change: 1 addition & 0 deletions app/ide-desktop/lib/content/esbuild-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export function bundlerOptions(args: Arguments) {
loader: {
'.html': 'copy',
'.css': 'copy',
'.map': 'copy',
'.wasm': 'copy',
'.svg': 'copy',
'.png': 'copy',
Expand Down
5 changes: 3 additions & 2 deletions build/build/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
gui/:
assets/:
dynamic-assets/: # Assets used by the WASM application.
pkg.js: # The `pks.js` artifact of wasm-pack WITH bundled snippets.
pkg.js: # The `pkg.js` artifact of wasm-pack WITH bundled snippets.
pkg.js.map: # The sourcemap mapping to `pkg.js` generated by wasm-pack.
pkg-opt.wasm: # The optimized WASM artifact.
index.js:
Expand All @@ -60,7 +60,8 @@
index.js: # The main JS bundle to load WASM and JS wasm-pack bundles.
index.d.ts: # TypeScript types interface file.
index.js.map: # The sourcemap mapping to `index.js`.
pkg.js: # The `pks.js` artifact of wasm-pack WITH bundled snippets.
pkg.js: # The `pkg.js` artifact of wasm-pack WITH bundled snippets.
pkg.js.map: # The sourcemap mapping to `pkg.js` generated by wasm-pack.
pkg.wasm: # The `pks_bg.wasm` artifact of wasm-pack.
pkg-opt.wasm: # The optimized `pks_bg.wasm`.
distribution/:
Expand Down
8 changes: 7 additions & 1 deletion build/build/src/project/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,16 @@ impl Artifact {
index_d_ts: _,
index_js_map: _,
pkg_js,
pkg_js_map,
pkg_wasm: _,
pkg_opt_wasm,
} = &self.0;
vec![dynamic_assets.as_path(), pkg_js.as_path(), pkg_opt_wasm.as_path()]
vec![
dynamic_assets.as_path(),
pkg_js.as_path(),
pkg_js_map.as_path(),
pkg_opt_wasm.as_path(),
]
}

pub fn symlink_ensogl_dist(&self, linked_dist: &RepoRootTargetEnsoglPackLinkedDist) -> Result {
Expand Down

0 comments on commit 639cb7f

Please sign in to comment.