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

chore: moving all @types dependencies to dev dependencies #10750

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Sep 1, 2020

SUMMARY

As per a chat with @etr2460 I figured it's worth trying to move all these to dev dependencies and see if CI explodes :)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

🤞 CI

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@rusackas
Copy link
Member Author

rusackas commented Sep 1, 2020

Welp, this seems to work so it passes the curiosity test. Wondering if @ktmud or @suddjian or anyone else with more miles clocked on their TypeScipt odometer would consider this PR a good or bad idea. ¯\_(ツ)_/¯

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

i think this is fine as the types should only be required for development and running build scripts.

But i agree, @ktmud or @kristw might know better what's best here

@ktmud
Copy link
Member

ktmud commented Sep 1, 2020

My understanding is @types/* should always be in dependencies for libraries because you don't want your dependent package to not have out-of-the-box typing---it may be hard for library users to keep track of which additional @types/* are needed.

Since all NPM packages are presumed to be a "library" if they are going to be published, we always put @types in dependencies by default.

For the superset-frontend app though, or any other npm-managed frontend apps for that matter, is not going to be published as a library, so it's OK to put @types in either place. In fact, one may even argue it's probably preferred to put all dependencies (including babel, webpack, jest, etc) in only one of dependencies or devDependencies, since

  1. If we consider the source code the published product of the app, we may want NODE_ENV=production npm install && npm build to work as well. So dependencies is preferred.
  2. If we consider the built assets the published product of the app, we may want to put them all in devDependencies for consistency and simplicity.

@rusackas
Copy link
Member Author

rusackas commented Sep 1, 2020

My understanding is @types/* should always be in dependencies for libraries because you don't want your dependent package to not have out-of-the-box typing---it may be hard for library users to keep track of which additional @types/* are needed.

Since all NPM packages are presumed to be a "library" if they are going to be published, we always put @types in dependencies by default.

For the superset-frontend app though, or any other npm-managed frontend apps for that matter, is not going to be published as a library, so it's OK to put @types in either place. In fact, one may even argue it's probably preferred to put all dependencies (including babel, webpack, jest, etc) in only one of dependencies or devDependencies, since

  1. If we consider the source code the published product of the app, we may want NODE_ENV=production npm install && npm build to work as well. So dependencies is preferred.
  2. If we consider the built assets the published product of the app, we may want to put them all in devDependencies for consistency and simplicity.

I'm inclined to go with #2 for the time being. We can always adjust later if the game changes. At least they should all be in one spot, to avoid further confusion, so it's a step in A direction ;)

@rusackas rusackas merged commit 5a106eb into apache:master Sep 1, 2020
@rusackas rusackas deleted the moving-types-to-devdependencies branch September 1, 2020 22:32
@villebro villebro added the v0.38 label Sep 10, 2020
villebro pushed a commit to preset-io/superset that referenced this pull request Sep 11, 2020
villebro pushed a commit that referenced this pull request Sep 11, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 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 size/S v0.38 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants