Giter VIP home page Giter VIP logo

Comments (3)

tonyxiao avatar tonyxiao commented on May 29, 2024 1

Great reasons though, thanks for writing it up!

from apollo-upload-client.

jaydenseric avatar jaydenseric commented on May 29, 2024

Sorry for the late reply.

One day I will write a detailed article to link people too whenever this topic comes up. Over the years I've made lots of detailed comments in various repos explaining why (e.g. jaydenseric/graphql-upload#282 (comment)), but it's not easy to dig them all up as a reference.

Of the many advantages, these ones stand out:

  1. No build step. Being able to directly edit and format the published modules is a fantastic simplification.
  2. The types are shipped inline within the published module. In Deno for example, when you import the module via a URL type safety just works without having to tell Deno to go get definitions over the network from a different URL.
  3. When users in their editor CMD+click on exported things of this package in their code, it takes them directly to the real code they are using instead of off to a seperate TS definitions file that doesn't contain the actual code. This is a great DX improvement.
  4. Significantly less bloated node_modules because you are not doubling the amount of files by having a companion .d.mts file for every .mjs file.

from apollo-upload-client.

tonyxiao avatar tonyxiao commented on May 29, 2024
  1. can be solved by publishing the source, but that worsens 4) because you'd be publishing 3x, the js code, the d.ts code AND the ts code. That's what I'm doing now though.

if only all js runtime support ts by default for future...

from apollo-upload-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.