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(package): add @octokit/core as peer dependency #130

Merged
merged 2 commits into from Aug 26, 2020

Conversation

gr2m
Copy link
Contributor

@gr2m gr2m commented Aug 5, 2020

fixes #124

@ghost ghost added this to Inbox in JS Aug 5, 2020
@gr2m gr2m added bug typescript Relevant to TypeScript users only labels Aug 5, 2020
@ghost ghost moved this from Inbox to Bugs in JS Aug 5, 2020
@gr2m
Copy link
Contributor Author

gr2m commented Aug 5, 2020

@AArnott you can test this PR by doing the yarn counterpart of npm install https://github.pika.dev/octokit/plugin-paginate-rest.js/pr/130

@AArnott
Copy link

AArnott commented Aug 5, 2020

Yes, I'll test this out and if it doesn't work I'll give you repro steps. My GitHub username ends with two "t"s by the way, so you mentioned someone else.

Copy link

@AArnott AArnott left a comment

Choose a reason for hiding this comment

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

Based on #124 (comment) and my local testing of the workaround, it appears this fix will work.

@gr2m gr2m changed the title 🚧 fix(package): add @octokit/core as peer dependency fix(package): add @octokit/core as peer dependency Aug 26, 2020
@gr2m gr2m merged commit ebb1854 into master Aug 26, 2020
JS automation moved this from Bugs to Done Aug 26, 2020
@gr2m gr2m deleted the add-octokit-core-as-peer-dependency branch August 26, 2020 17:26
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@timocov
Copy link
Contributor

timocov commented Sep 8, 2020

This fix just dropped support for packages/libraries with TypeScript below 3.8 version... Is there a difference between using import and import type here? Why can't we use just import instead?

@timocov
Copy link
Contributor

timocov commented Sep 8, 2020

@gr2m I mean, this was released as a patch release, but contains breaking changes. Is that okay?

@gr2m
Copy link
Contributor Author

gr2m commented Sep 8, 2020

My understanding is that import type will make sure that no code will be imported into the final code. I don't consider TypeScript changes breaking changes because you don't use it in production, only in development. TypeScript itself does not follow semver with its releases.

Is there a reason you are stuck with TypeScript below 3.8?

@timocov
Copy link
Contributor

timocov commented Sep 8, 2020

Is there a reason you are stuck with TypeScript below 3.8?

Some of our branches are still on 3.7. Is that really problem and too outdated? I don't think so. It's just around 1yo version though 😂

My understanding is that import type will make sure that no code will be imported into the final code

The same as import if you'll use imported reference as type and in types only. So if you don't use it anywhere else from types, they are completely the same. But in d.ts files (which you provide with the npm package to consumers) they are always the same, because d.ts is used for the type checking stage only (d.ts files doesn't produce any output).

I don't consider TypeScript changes breaking changes because you don't use it in production, only in development

But this changes might accidentally break any build (development as well) without any reason, just because there is the new patch version of the library, and if you don't use lock files (there might be some reasons why you don't/can't use them) you'll have "happy morning" by fixing compilation errors, even if you didn't do any change in your code.

TypeScript itself does not follow semver with its releases.

And you? I don't think that versioning of this package is related to TypeScript's versioning system.

This looks similar to if you published the new boost/Qt patch version of the library and have started to use new features from the new C++ standard. I believe in this case it should be the new major version at least to avoid confusing and inconvenience.

@timocov
Copy link
Contributor

timocov commented Sep 8, 2020

@gr2m I don't say that you don't need to use features from the new TypeScript version, but if someone has consumers, they should worry about it. In this case, my personal opinion that using import type isn't necessary, but if you decided to use it - please bump a major version instead to avoid breaking code. Or declare that all libraries doesn't follow semver (but I guess it requires more changes, because they need to change dependencies and devDependencies lists). Please don't get me wrong.

@gr2m
Copy link
Contributor Author

gr2m commented Sep 8, 2020

can you send a PR to change the import type to just import?

@timocov
Copy link
Contributor

timocov commented Sep 9, 2020

Sure #160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Relevant to TypeScript users only
Projects
No open projects
JS
  
Done
Development

Successfully merging this pull request may close these issues.

[yarn 2] Cannot find module '@octokit/core' or its corresponding type declarations
3 participants