Skip to content

Commit

Permalink
Add polyfill for path to fix a bug that prevented the results view fr…
Browse files Browse the repository at this point in the history
…om being loaded (github#842)

* Add a polyfill for the Node.js path module

Webpack >v5 doesn't include polyfills for core modules from Node.js by
default. Since we use `path` in the results table UI, we need to include
our own polyfill. This commit adds `path-browserify` to the
distributed extension.

As future work, we could move SARIF location rendering into the core
extension so we don't need to use `path.basename` in the UI. This would
allow us to remove the polyfill.

* Add changelog note
  • Loading branch information
henrymercer authored and aofaof0907 committed Jul 27, 2021
1 parent 8c9cc0b commit c874740
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [UNRELEASED]

- Fix a bug that prevented the results view from being loaded. [#842](https://github.com/github/vscode-codeql/pull/842)

## 1.4.6 - 21 April 2021

- Avoid showing an error popup when running a query with `@kind table` metadata. [#814](https://github.com/github/vscode-codeql/pull/814)
Expand Down
2 changes: 1 addition & 1 deletion extensions/ql-vscode/gulpfile.ts/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const config: webpack.Configuration = {
resolve: {
extensions: ['.js', '.ts', '.tsx', '.json'],
fallback: {
path: false
path: require.resolve('path-browserify')
}
},
module: {
Expand Down
13 changes: 11 additions & 2 deletions extensions/ql-vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@
"js-yaml": "^3.14.0",
"minimist": "~1.2.5",
"node-fetch": "~2.6.0",
"path-browserify": "^1.0.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"semver": "~7.3.2",
Expand Down

0 comments on commit c874740

Please sign in to comment.