Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): make npm linking work pt. 2 #16958

Merged
merged 2 commits into from
Oct 4, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Oct 4, 2021

SUMMARY

The recent upgrade to Webpack 5 in #16701 broke npm linking. While #16867 added watching for changed files, it still didn't update the browser with the new assets. This switches from using watchOptions.followSymlinks to the more conventional config.symlinks setting, and adds an alias for react to point to the one pulled in by the Superset application. This is necessary, as otherwise there will be two instances of React - one fro Superset, and one from superset-ui.

TESTING INSTRUCTIONS

  1. npm link a superset-ui package/plugin
  2. make code changes to the package/plugin
  3. watch the command line trigger the rebuild and the code changes reflected in the browser

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@@ -289,9 +289,10 @@ const config = {
APP_DIR,
'./node_modules/@superset-ui/chart-controls',
),
react: path.resolve('./node_modules/react'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should have react as peer dep in superset-ui then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's a very good point. Let me try that.

Copy link
Member Author

@villebro villebro Oct 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It apparently already is (superset-ui/core):
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, then it's rather strange that it requires resolving

},
extensions: ['.ts', '.tsx', '.js', '.jsx', '.yml'],
symlinks: false,
symlinks: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove that line, symlinks: true is the default

@villebro villebro force-pushed the villebro/webpack5-npm-link-pt2 branch from 4c149f2 to 7e36733 Compare October 4, 2021 16:10
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing that pesky stuff! ❤️

@villebro villebro merged commit 739d841 into apache:master Oct 4, 2021
@villebro villebro deleted the villebro/webpack5-npm-link-pt2 branch October 4, 2021 16:47
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* fix(build): make npm linking work pt. 2

* remove explicit symlinks conf
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* fix(build): make npm linking work pt. 2

* remove explicit symlinks conf
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset-io size/XS 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants