Skip to content

Work to reduce transitive dependencies#1206

Merged
jamietanna merged 10 commits intomasterfrom
chore/reduce-deps
Aug 28, 2023
Merged

Work to reduce transitive dependencies#1206
jamietanna merged 10 commits intomasterfrom
chore/reduce-deps

Conversation

@jamietanna
Copy link
Copy Markdown
Member

As a step towards #1142.

@jamietanna jamietanna added this to the v1.14.0 milestone Aug 23, 2023
As part of #1142, we want to reduce the transitive dependencies of
oapi-codegen.

We can start by breaking some dependencies between packages that don't
make sense.
As part of #1142, we want to reduce the transitive dependencies of
oapi-codegen.

We can start by breaking some dependencies between packages that don't
make sense.
@jamietanna jamietanna force-pushed the chore/reduce-deps branch 4 times, most recently from c89e459 to f7982cf Compare August 28, 2023 20:18
jamietanna and others added 7 commits August 28, 2023 21:28
These appear to be existing issues with the code, but are only flagged
up once we migrate `examples` to its own Go module, so we can
preemptively fix them before hand.
As part of #1142, we want to reduce the transitive dependencies of
oapi-codegen, which we can start with by removing unnecessary
dependencies on `echo` from the `pkg/codegen` project.
As part of #1142, we want to reduce the transitive dependencies of
oapi-codegen, which requires creating a multi-module Go project.

Before we can do this, we can make sure that we have set up our Makefile
and `tidy` workflow to be module-aware via steps in [0].

[0]: https://www.jvt.me/posts/2023/08/18/go-multi-module-execute/
As part of #1142, we want to reduce the transitive dependencies of
oapi-codegen, which requires creating a multi-module Go project.

We can start with the `examples` project, which definitely shouldn't be
pulled by consumers.

The fake module version updates across all files due to the way that
multi-module Go projects work, but should be a one-time update.
As part of #1142, we want to reduce the transitive dependencies of
oapi-codegen, which requires creating a multi-module Go project.

We can migrate `internal/test` to its own module, as it shouldn't be
(nor could it be) pulled by consumers.

The fake module version updates across all files due to the way that
multi-module Go projects work, but should be a one-time update.
As part of #1142 we can start to reduce our transitive dependencies
by refactoring the `pkg/runtime` as it exists in
deepmap/oapi-codegen.

This allows us to introduce a breaking change (tweaking the structure of
this package, including moving the `strictmiddleware` concepts) by
creating a fresh package. This does require we tweak the way that our
imports and generated code works.

By moving `runtime` to a separate package, we can allow more frequent
updates to the runtime-specific code, without tying it directly to the
version of the code generator in use.
As we're now using the oapi-codegen/runtime package for this, we should
mark the existing functionality as deprecated.

This also ignores any internally flagged deprecation warnings, as we
know we're calling deprecated functions from within our own (deprecated)
packages.
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.

1 participant