Skip to content

Commit

Permalink
esbuild for main bundle (#14599)
Browse files Browse the repository at this point in the history
* esbuild for all bundles

* Remove console.error and define jQuery on top in
data-explorer.

* Update build and webview directories

* Remove compile-viewers-watch task and update
compile and compile-dev tasks

* Update compile-release task to use esbuild instead
of webpack

* Update package.json and launchWebUtils.js for
better logging and testing

* oops

* Add npm tasks for updating package.json entry
points and fix package.json entry points for
production build

* Add preprePublishBundle and preprePublishNonBundle
scripts

* oops

* Fix build task command in CONTRIBUTING.md and
update package.json paths.

* Updates

* wip

* Update user authentication logic to use bcrypt
hashing algorithm.

* Fix issue with ZeroMQ context blocking process
exit

* No updates to package.json

* Update tasks.json and package.json, remove
updatePackageJsonEntry.js and modify
extension.node.proxy.ts and standardTest.node.ts
  • Loading branch information
DonJayamanne authored Oct 31, 2023
1 parent 226adb0 commit 928520c
Show file tree
Hide file tree
Showing 27 changed files with 441 additions and 387 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.huskyrc.json
dist
out
*.exe
log.log
Expand Down Expand Up @@ -58,7 +59,8 @@ src/test/datascience/.venv*
*.nls.*.json
*.i18n.json
l10n/

# Esbuild files
**/*.esbuild.meta.json
# Compilation of less to css
src/webviews/webview-side/interactive-common/variableExplorerGrid.css
src/webviews/webview-side/interactive-common/variableExplorerGrid.css.map
Expand Down
36 changes: 5 additions & 31 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--enable-proposed-api"],
"smartStep": true,
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"outFiles": ["${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"preLaunchTask": "Compile",
"skipFiles": ["<node_internals>/**"],
"env": {
Expand All @@ -34,7 +34,7 @@
"debugWebWorkerHost": true,
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentKind=web"],
"outFiles": ["${workspaceFolder}/out/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"outFiles": ["${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"preLaunchTask": "Compile Web Extension",
"presentation": {
"group": "1_extension",
Expand All @@ -47,7 +47,7 @@
"debugWebWorkerHost": true,
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentKind=web"],
"outFiles": ["${workspaceFolder}/out/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"outFiles": ["${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"presentation": {
"group": "1_extension",
"order": 1
Expand All @@ -61,7 +61,7 @@
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--enable-proposed-api"],
"smartStep": true,
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"outFiles": ["${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"skipFiles": ["<node_internals>/**"],
"env": {
// Disable this to turoff on redux & console logging during debugging
Expand All @@ -86,7 +86,7 @@
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/data"],
"smartStep": true,
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"outFiles": ["${workspaceFolder}/dist/**/*", "!${workspaceFolder}/**/node_modules**/*"],
"preLaunchTask": "Compile",
"presentation": {
"group": "1_extension",
Expand Down Expand Up @@ -157,32 +157,6 @@
"order": 10
}
},
{
"name": "Perf Tests (*.perf.test.ts)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"${workspaceFolder}/src/test/testMultiRootWkspc/perfTests",
"--enable-proposed-api",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/index.node.js"
],
"env": {
"CI_PYTHON_PATH": "<Python Path>",
"VSC_JUPYTER_PERF_TEST": "1",
"TEST_FILES_SUFFIX": "notebookCellExecution.perf.test",
"VSC_JUPYTER_TEST_TIMEOUT": "60000"
},
"sourceMaps": true,
"outFiles": ["${workspaceFolder}/out/**/*.js", "!${workspaceFolder}/**/node_modules**/*"],
"preLaunchTask": "Compile",
"skipFiles": ["<node_internals>/**"],
"presentation": {
"group": "2_tests",
"order": 12
}
},
{
"name": "Jedi LSP tests",
"type": "extensionHost",
Expand Down
10 changes: 6 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"out": false,
"dist": false,
"**/*.pyc": true,
".nyc_output": true,
"obj": true,
Expand All @@ -17,7 +18,8 @@
"**/.ropeproject/**": true
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"out": true,
"dist": true,
"**/node_modules": true,
"coverage": true,
"**/.venv/**": true,
Expand All @@ -30,11 +32,11 @@
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"git.branchProtection": ["main", "release*"],
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
Expand Down
37 changes: 2 additions & 35 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,6 @@
"isDefault": true
}
},
{
"label": "Compile Viewers",
"type": "npm",
"script": "compile-viewers-watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$esbuild-watch"]
},
{
"label": "Compile Web Extension",
"type": "npm",
"script": "compile-web-watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$ts-webpack-watch"]
},
{
"label": "compile-web-test",
"type": "npm",
"script": "compile-web-test",
"dependsOrder": "sequence",
"dependsOn": ["Compile"],
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$ts-webpack-watch"]
},
{
"label": "Run Unit Tests",
"type": "npm",
Expand All @@ -71,13 +36,15 @@
{
"type": "npm",
"script": "launchWebExtension",
"dependsOn": ["package.json.entry.dist"],
"problemMatcher": [],
"label": "Launch Web Extension (Chrome)"
},
{
"type": "shell",
"problemMatcher": [],
"command": "npm",
"dependsOn": ["package.json.entry.dist"],
"args": ["run", "launchWebExtension", "--", "--browser=webkit", "--port=3111"],
"label": "Launch Web Extension (Safari)"
},
Expand Down
27 changes: 2 additions & 25 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**/*.map
**/*.analyzer.html
!out/webviews/webview-side/common/node_modules/**/*
**/*.esbuild.meta.json
images/**
docs/**
*.vsix
Expand Down Expand Up @@ -81,30 +81,7 @@ i18n/**
node_modules/**
obj/**
logs/**
out/**/*.stats.json
out/**/*.analyzer.html
out/coverconfig.json
out/webviews/webview-side/**/*.analyzer.html
out/webviews/webview-side/common/**
out/webviews/webview-side/**/*.js.LICENSE
out/webviews/webview-side/data-explorer/**
out/webviews/webview-side/webviews/webview-side/**
out/webviews/webview-side/history-react/**
out/webviews/webview-side/interactive-common/**
out/webviews/webview-side/ipywidgets/**
out/webviews/webview-side/native-editor/**
out/webviews/webview-side/notebook/webviews/webview-side/**
out/webviews/webview-side/notebook/ipywidgets/**
out/webviews/webview-side/notebook/index.*.html
out/webviews/webview-side/plot/**
out/webviews/webview-side/react-common/**
out/webviews/webview-side/viewers/webviews/webview-side/**
out/webviews/webview-side/viewers/ipywidgets/**
out/webviews/webview-side/viewers/index.*.html
out/webviews/webview-side/widgetTester/**
out/pythonFiles/**
out/src/**
out/test/**
out/**
precommit.hook
pythonFiles/**/*.pyc
pythonFiles/lib/**/*.dist-info/**
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --

### Incremental Build

Run the `Compile`, `Compile Web Views`, and `Compile Web Extension` build Tasks from the [Run Build Task...](https://code.visualstudio.com/docs/editor/tasks) command picker (short cut `CTRL+SHIFT+B` or `⇧⌘B`). This will leave build tasks running in the background and which will re-run as files are edited and saved. You can see the output from either task in the Terminal panel (use the selector to choose which output to look at).
Run the `Compile` build Tasks from the [Run Build Task...](https://code.visualstudio.com/docs/editor/tasks) command picker (short cut `CTRL+SHIFT+B` or `⇧⌘B`). This will leave build tasks running in the background and which will re-run as files are edited and saved. You can see the output from either task in the Terminal panel (use the selector to choose which output to look at).

You can also compile from the command-line. For a full compile you can use:

Expand All @@ -58,10 +58,9 @@ For incremental builds you can use the following commands depending on your need

```shell
npm run compile
npm run compile-viewers-watch # For Plot, Data Frame, Variable & IPyWidget Viewer
```

Sometimes you will need to run `npm run clean` and even `rm -r out`.
Sometimes you will need to run `npm run clean` and even `rm -r out dist`.
This is especially true if you have added or removed files.

### Errors and Warnings
Expand Down
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
dist
out
**/node_modules
bin/**
Expand Down
Loading

0 comments on commit 928520c

Please sign in to comment.