Git Product home page Git Product logo

http-link-header's People

Watchers

 avatar

http-link-header's Issues

convert source to TypeScript

Benefits:

  • users get autocomplete
  • easier to maintain

use deno bundle to generate a JavaScript file to be imported in the Browser (and other non-TS environments).

make it a dual module that can be imported into Browser (or Deno scripts) via CDN

title of issue says it all, using the body only to collect info on how to do it.

https://2ality.com/2019/10/hybrid-npm-packages.html seems to have the clearest explanation, but the core point is:

  • to be compatible with older versions of Node, we need to ship CommonJs and ESM versions of the JavaScript sources in the same package
  • it doesn't give any hints on how to build such packages, especially in our case of a project that does not use rollup or a transpiler. npm publish just publishes the source

This example project actually seems nice: https://github.com/dandv/local-iso-dt

  • edit your code as ES module and use babel to create a CommonJs version for backward compatibility
  • package both as described by duality above
  • if you write a new package, make it ESM only, because new projects can directly use that
  • is it so that TypeScript compiler or other tool in its ecosystem allows a CommonJs module to be imported via ES syntax? then maybe many users do that already and we can just switch to only support that โ€“ but I guess for any project with a lot of users, it would just break updateability for some people

other info for context, but doesn't seem to have the simplest information:

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.