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

Bump types package to 2.0.0 #467

Merged
merged 1 commit into from
Nov 11, 2021
Merged

Bump types package to 2.0.0 #467

merged 1 commit into from
Nov 11, 2021

Conversation

ejizba
Copy link
Contributor

@ejizba ejizba commented Nov 10, 2021

Haven't had any issues with the beta version since releasing last week, so let's get the real version out!

Related to #398

Copy link
Contributor

@hossam-nasr hossam-nasr left a comment

Choose a reason for hiding this comment

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

Looks good! Let's get the real version out

@ejizba ejizba merged commit bf431d8 into v2.x Nov 11, 2021
@ejizba ejizba deleted the ej/bump branch November 11, 2021 19:15
@glasser
Copy link

glasser commented Nov 12, 2021

Hi! We maintain a package (apollo-server-azure-functions) that defines code that our users can use in their Node Azure Functions. We import the types Context, HttpRequest, and AzureFunction from @azure/functions (and use them only as compile-time TS types). We are admittedly not huge Azure Functions experts — our project integrates with a variety of web frameworks and serverless environments.

Can you help me understand the impact of upgrading our dependency on @azure/functions from v1 to v2? I see that the README says that users should choose a version that matches their worker version. If we start publishing our package with a dependency on v2, will it break users who haven't upgraded their worker to v2 yet? Should we make our dependency be on "@azure/functions": "1.x || 2.x"?

@ejizba
Copy link
Contributor Author

ejizba commented Nov 13, 2021

In terms of the types package, there were no breaking changes between v1 and v2. Since "@azure/functions" is strictly for TypeScript types, I would actually recommend you make it a devDependency in your project, which means the version you choose wouldn't affect your users at all. This would also prevent the package from being included as a "production" dependency when deployed to Azure.

@glasser
Copy link

glasser commented Nov 13, 2021 via email

@ejizba
Copy link
Contributor Author

ejizba commented Nov 15, 2021

Yeah I couldn't find any clear answer/recommendation for handling that. IMO, however, it's more important to prioritize the production-scenario, meaning we don't want to include any dev-like dependencies (TypeScript stuff definitely fit in this category) in our production app.

Here are a few arguments for including "@azure/functions" as a non-dev dependency and why I still do not think it's worth it:

  • Users leveraging your package will automatically get the "@azure/functions" package when doing npm install, meaning the TypeScript build will never fail because it's missing.
    • All TypeScript projects get the "@azure/functions" package by default and even if it's missing, the error is pretty clear/fixable.
  • You can enforce the version of "@azure/functions" that you support.
    • I actually don't think this is true at all - if the version you specify is different than the version specified directly in the user's package.json, they will just get 2 installs of "@azure/functions" in the "node_modules" folder like this ("npmtypesref" is the name of my test npm package - aka it's analogous to your package):
      Screen Shot 2021-11-15 at 9 19 26 AM

Lastly, my recommendation is based on patterns I see for other packages. For example, I couldn't find any package depending explicitly on "@types/node" even though I'm sure plenty of packages references that in the exports for their types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants