Provides a notebook-aware error overlay in VS Code notebooks built with the webpack-dev-server
Перейти к файлу
dependabot[bot] f1d6f7e9dc
build(deps): bump ajv from 6.12.2 to 6.12.6 (#5)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 08:05:07 -07:00
.github/workflows
src
.eslintrc.js
.gitignore
.npmignore
README.md
SECURITY.md
package-lock.json
package.json
result.json
tsconfig.json

README.md

vscode-notebook-error-overlay

This provides a Notebook-aware error overlay, somewhat like that which create-react-app provides. This is used in our renderer starter.

Usage

First, install it:

npm i --save-dev vscode-notebook-error-overlay

Then in your notebook's render function:

import errorOverlay from 'vscode-notebook-error-overlay';

function renderOutput(domNode) {
  // When you render in an element, install the overlay in it:
  errorOverlay.install(domNode);

  renderMyOutput(domNode); // then render your output
}

You can alternatively install and render in a wrapped function, which has the advantage of displaying any errors synchronously thrown from the render() function:

import errorOverlay from 'vscode-notebook-error-overlay';

const renderOutput = domNode => errorOverlay.wrap(domNode, () => {
  renderMyOutput(domNode);
});

If any build errors happen when running from the webpack-dev-server, an appropriate error message will be shown wherever the overlay is installed.