superset/superset-frontend/temporary_superset_ui/superset-ui/docs/debugging.md
Krist Wongsuphasawat 97f18e686b build: migrate build tool to nimbus (#281)
* build: migrate to nimbus

* build: update gitignore

* build: update package.json

* build: update travis config

* build: lower engine requirements

* build: adjust typescript config

* fix: errors

* fix: change yarn run to yarn

* fix: lint

(cherry picked from commit 22328c349c9b987eecc5e46fb306e459b6a9cadc)

* fix: eslint rules

* fix: lint

* fix: setup file

* fix: more lint

* fix: lint - pass build and lint

* fix: test setup and babel transform runtime

(cherry picked from commit dd55fd88ced045a8f83ca771705721bf2f930ff0)

* fix: timeout issues

* fix: some broken test due to jest.setTimeout

* fix: computeMaxFontSize tests

* fix: createLoadableRenderer test

* fix: loadble and broken tests due to warnings

* fix: test coverage

* fix: coverage of generator tests

* fix: all unit tests pass

* fix: remove yeutech-lab/react-loadable
2021-11-26 11:45:00 +08:00

1.4 KiB

Debugging Superset plugins in Superset app

Activating plugins for local development

  1. Enable npm link for the package.
cd superset-ui
cd packages/superset-ui-chart
npm link
  1. Link the local package to incubator-superset.
cd incubator-superset
cd superset/assets
npm link @superset-ui/chart \# use package name in package.json, not directory name
  1. After npm link complete, update the import statements in Superset.

Instead of

import { xxx } from '@superset-ui/plugin-chart-horizon';

which will point to the transpiled code.

do refer to src

import { xxx } from '@superset-ui/plugin-chart-horizon/src';
  1. After that you can run dev-server as usual.
npm run dev-server

Now when you change the code in @superset-ui, it will update the app immediately similar to code inside incubator-superset.

Deactivating plugins for local development

  1. Change the import statements back.

  2. Unlink the package from incubator-superset.

cd superset/assets
npm unlink @superset-ui/chart

Note: Quite often, npm link mess up your node_modules and the unlink command above does not work correctly, making webpack build fails or other unexpected behaviors. If that happens, just delete your node_modules and npm install from scratch.

  1. Clean up global link.
cd superset-ui
cd packages/superset-ui-chart
npm unlink