-
Notifications
You must be signed in to change notification settings - Fork 349
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: remove Long import statement when Long was unused #599
fix: remove Long import statement when Long was unused #599
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
const longInit = options.onlyTypes | ||
? code`` | ||
: code` | ||
const Long = conditionalOutput( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah neat! This is smart. @3846masa do you mind adding an in-source comment right before this:
// Instead of exposing `LongImp` directly, let callers think that they are getting the
// `imp(Long)` but really it is that + our long initialization snippet. This means the
// initialization code will only be emitted in files that actually use the Long import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'll add it 👍
@stephenh |
Looks great, thanks @3846masa ! |
## [1.115.5](v1.115.4...v1.115.5) (2022-06-22) ### Bug Fixes * remove Long import statement when Long was unused ([#599](#599)) ([58dc10c](58dc10c))
🎉 This PR is included in version 1.115.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Signed-off-by: Andrew Haines <haines@cerbos.dev>
* chore(deps-dev): Bump ts-proto from 1.115.4 to 1.115.5 Bumps [ts-proto](https://github.com/stephenh/ts-proto) from 1.115.4 to 1.115.5. - [Release notes](https://github.com/stephenh/ts-proto/releases) - [Changelog](https://github.com/stephenh/ts-proto/blob/main/CHANGELOG.md) - [Commits](stephenh/ts-proto@v1.115.4...v1.115.5) --- updated-dependencies: - dependency-name: ts-proto dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Remove ts-proto patch (merged in stephenh/ts-proto#599) Signed-off-by: Andrew Haines <haines@cerbos.dev> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Haines <haines@cerbos.dev>
Somethimes (e.g. when outputEncodeMethods=false), Long is not required, but included in generated codes.
This PR ensures that unused Long is not included in generated codes.
Releated: #330