Skip to content

Should the SDKs prioritize DX or flexibility? #8689

Closed

Description

@shykes

Problem

We don't clearly answer the question: should we optimize for the best DX, or for flexibility?

  • Best DX: one package manager, one runtime, one way to organize your files. Probably customizable, but not infinitely so. Probably easier to learn, easier to develop, and faster. But won't "blend in" with the surrounding project; and maybe harder to import code from app into the module or vice-versa

  • Flexibility: adapt to your existing package manager, runtime, and layout as much as possible. Will blend in more easily with any project, but will be more complicated to learn and slower.

Solution

Consult the community, debate the tradeoff, make a decision, and document it clearly.

What are everyone's thoughts on this tradeoff?

Activity

  1. smolinari commented on Oct 12, 2024

    @smolinari
    Contributor

    I'm not seeing how the one should be exclusive to the other.

    So, here is my 2 cents.

    For sure the most used package managers should be supported. npm, yarn, pnpm. If only one has to be picked, it should be pnpm IMHO. I'm not seeing the reasons why choice of package manager can be problematic though either. 🤔

    I wouldn't say customizability is necessary per se. But, extensibility is for sure. But, I understand it is hard for SDKs like Dagger offers. I'm also wondering what customizability could look like. Not sure this should even be a target. 🤔

    Project "blendability" is interesting. To me, Dagger is a controller. And as a controller, it must stand out. So, I don't think I understand the SDK "blending in" bit or why it matters. So, to me another non-target. But, that is just me. 😊

    Cognitive load should always be as low as possible. Hurdles to start should be as low as possible. So, Dagger SDK usage should make sense, be easy to run with, which for the most part, I believe it does. I have to be honest, I dove into Dagger learning Go and using the Go SDK and haven't (yet) used the TypeScript SDK. So, that makes my reply less valuable, granted. Still, I believe what I'm suggesting has merit via experience. 😄

    Performance shouldn't be so poor as to be annoying. And, it doesn't need to be wicked fast to blow minds either. Performance as a feature should be "good enough" to make the experience be acceptable. This is a subjective and hard moving target and why I said, performance just needs to avoid being annoying. Most people can agree on what annoying might be. That should be the goal. 😁

    Hope this helps in some small way.

    Scott

    PS: The other question that comes to my mind is, why is this a discussion only for TypeScript? Are the possible discrepancies only in this SDK? Don't they all have them? Hmmm. The title does say "SDKs" (plural), but it is only called out on Discord for TypeScript. So, I guess that is confusing me, I guess. 🤷

  2. TomChv commented on Oct 14, 2024

    @TomChv
    Member

    @shykes

    Best DX: one package manager, one runtime, one way to organize your files. Probably customizable, but not infinitely so. Probably easier to learn, easier to develop, and faster. But won't "blend in" with the surrounding project; and maybe harder to import code from app into the module or vice-versa

    I personnally prefer this option since we can really focus on making the best out of our choice of runtime, configuration etc...
    We can make our choice based on few points like speed, simpleness, ecosystems, but that's the way to go IMO.

    Flexibility: adapt to your existing package manager, runtime, and layout as much as possible. Will blend in more easily with any project, but will be more complicated to learn and slower.

    I'm not sure being more flexible would impact the learning curve but it would definitely make the path less straight forward and harder to make it work. You'll have to check the docs to see how to make the runtime using your specific package manager, because the they're more possibilities, you can get lost for a while, hitting strange dependency issues that could be avoided...

    A trace off we could do, to avoid frustration because a user cannot use its favorite tool, is to change the default runtime/config to what we think is the best DX, the faster, and the easier but provide options (like we got now) to let the user customize the runtime the way he wants, however if something breaks, it would be harder for us to help because it's not the recommanded configuration.

    WDYT of this?

    @smolinari

    For sure the most used package managers should be supported. npm, yarn, pnpm. If only one has to be picked, it should be pnpm IMHO. I'm not seeing the reasons why choice of package manager can be problematic though either. 🤔

    This is valid if we choose to adopt Node as runtime, but what if we choose Bun? Or Deno? Then you will not have that list of choices for your package manager. I think that's what @shykes meant by "DX over flexibility". We could choose a runtime that doesn't support your usual packager manager, would that be an issue for you or it's okay since dagger modules are separate from your original codebase?

    Performance shouldn't be so poor as to be annoying. And, it doesn't need to be wicked fast to blow minds either. Performance as a feature should be "good enough" to make the experience be acceptable. This is a subjective and hard moving target and why I said, performance just needs to avoid being annoying. Most people can agree on what annoying might be. That should be the goal. 😁

    Totally agree with you on that, do you have a suggestion of what time per run is "good enough"?

    PS: The other question that comes to my mind is, why is this a discussion only for TypeScript? Are the possible discrepancies only in this SDK? Don't they all have them? Hmmm. The title does say "SDKs" (plural), but it is only called out on Discord for TypeScript. So, I guess that is confusing me, I guess. 🤷

    That's because I mentioned to @shykes on day: "what if we dropped Node in favor of Bun since Bun is waaay faster than Node in our benchmark" (Bun initialization is always <10s while Node is >15 uncached). So basically adopting Bun as our only runtime would solve our performances issues and simplify the DX + code maintainance because we would not have to support all theses package managers, with edges cases and specificities.

    But it's a trade off, because we would lose flexibility which is the reason of this issue, we want to know what the community thinks :D

    Cognitive load should always be as low as possible. Hurdles to start should be as low as possible. So, Dagger SDK usage should make sense, be easy to run with, which for the most part, I believe it does. I have to be honest, I dove into Dagger learning Go and using the Go SDK and haven't (yet) used the TypeScript SDK. So, that makes my reply less valuable, granted. Still, I believe what I'm suggesting has merit via experience. 😄

    No matter the runtime or configuration options, the DX should be pretty much the same, but we can spend more time & effort on supporting more features like #8676 if we don't spend it on flexibile features like: #8146

  3. smolinari commented on Oct 14, 2024

    @smolinari
    Contributor

    @TomChv -

    This is valid if we choose to adopt Node as runtime, but what if we choose Bun? Or Deno?

    "what if we dropped Node in favor of Bun since Bun is waaay faster than Node in our benchmark" (Bun initialization is always <10s while Node is >15 uncached).

    What is being done at initialization? I mean, is transpilation and type checking happening? I guess I need to work with the TypeScript SDK. 😝

    Totally agree with you on that, do you have a suggestion of what time per run is "good enough"?

    Not really. I've not gotten into Dagger too deep (with Go), so I'm the wrong person to ask for my full impressions. From what I was doing though, Dagger was responsive enough to not be annoying. 😁

    Scott

  4. Xiot commented on Oct 14, 2024

    @Xiot

    I agree that the two options aren't quite mutually exclusive, but it is a bit of a balancing act.

    I'm not sure being more flexible would impact the learning curve but it would definitely make the path less straight forward and harder to make it work. You'll have to check the docs to see how to make the runtime using your specific package manager, because the they're more possibilities, you can get lost for a while, hitting strange dependency issues that could be avoided...

    Personally, I've always liked a blend of both. Having sensible defaults would allow people to get up and running quickly, and then if they want to customize their configuration let them do that. If you wanted to get a little fancier, you could have the initialization script prompt for some of these configurations.

    In terms of the package managers, it depends on how strict you want to be with where dagger modules live. If you go down the road of only supporting bun (for instance), you will pretty much requiring people to have a separate repo for their dagger modules, as it would likely clash with any monorepo setup.

    If only one has to be picked, it should be pnpm IMHO

    As much as I love pnpm, I don't think that it should be the default since the way that it handles peer dependencies can be a little frustrating in certian circumstances.

    simplify the DX + code maintainance because we would not have to support all theses package managers, with edges cases and specificities.

    Those are slightly different goals based on who is looking at the issue. The DX from someone that uses pnpm as a package manager would be better if dagger used pnpm as well. But the maintanence from the dagger team side of things from supporting multiple package managers is definitely a concern that needs to be considered, but I don't it directly applies to the developers DX. Indirectly it does though, since at least some of your time would be spent on making sure that all of the combinatinos work rather than building new features.

  5. TomChv commented on Oct 15, 2024

    @TomChv
    Member

    In terms of the package managers, it depends on how strict you want to be with where dagger modules live. If you go down the road of only supporting bun (for instance), you will pretty much requiring people to have a separate repo for their dagger modules, as it would likely clash with any monorepo setup.

    But the dagger module is supposed to be in a different directory of your monorepo and ignore by the root tsconfig so it shouldn't clash.

    Those are slightly different goals based on who is looking at the issue. The DX from someone that uses pnpm as a package manager would be better if dagger used pnpm as well. But the maintanence from the dagger team side of things from supporting multiple package managers is definitely a concern that needs to be considered, but I don't it directly applies to the developers DX. Indirectly it does though, since at least some of your time would be spent on making sure that all of the combinatinos work rather than building new features.

    Yes that's exactly my concerns, when I work a new feature, I need to make sure it works for all package mananger & runtime which slows me down..

  6. charjr commented on Oct 16, 2024

    @charjr
    Contributor

    Coming from PHP, there is basically just a single, de facto, package manager; my opinion may be bias.

    Flexibility: adapt to your existing package manager, runtime, and layout as much as possible. Will blend in more easily with any project, but will be more complicated to learn and slower.

    For me, one of the selling points of Dagger is that it makes CI less complicated. Reducing the number of intricacies one has to learn.

    Less complicated is an extremely valuable feature.

    So basically adopting Bun as our only runtime would solve our performances issues and simplify the DX + code maintainance because we would not have to support all theses package managers, with edges cases and specificities.

    Probably easier to learn, easier to develop, and faster. But won't "blend in"

    If you go down the road of only supporting bun (for instance), you will pretty much requiring people to have a separate repo for their dagger modules, as it would likely clash with any monorepo setup.

    Run locally or in CI.
    Iterate in seconds, not minutes.

    Parity between local and CI is an extremely valuable feature.

    So let me pose a question: How often do you experience that value?

    EDIT: What characteristics would encourage you to experience that value more:

    • Faster and more featureful
    • Tighter integration with surrounding project
  7. Vanuan commented on Jul 7, 2025

    @Vanuan

    So let me pose a question: How often do you experience that value?

    I'd say this value can be experienced only when the CI takes so long it makes sense to endure the pain of dagger setup and runtime to run a small set of failing pipeline locally or avoid initial setup cost. Because any CI tool will always be slower than just running without a tool.

    So CI tool should balance laziness and impatience. Should be easier than setting up and maintaining a local environment. Should be fast enough for that local environment setup investment to not make sense. Parity is not complete without considering the performance.

  8. locked and limited conversation to collaborators on Mar 24, 2026
  9. converted this issue into a discussion #12151 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions