Giter VIP home page Giter VIP logo

Comments (7)

43081j avatar 43081j commented on May 25, 2024

I have opened #7419 to fix the entrypoints at least, though i still think that is the wrong way around until we move to being esm-first ("type": "module"). so i have left it as a draft for now until i get feedback here on direction

from rxjs.

kwonoj avatar kwonoj commented on May 25, 2024

This is expected; our esm output is currently not a spec compliant esm and to support tree shaking only for bundlers. There is ongoing effort to make these output into real esm in a major / breaking changes. Before then if node.js resolves to current esm it'll fail to load (since it's not a real esm). Please search existing issues for details / history.

from rxjs.

43081j avatar 43081j commented on May 25, 2024

Do the current issues take the nodenext problems into account? Any references would be helpful as I didn't find any pointing that out so far.

There are two problems here:

  • the map always resolves to cjs
  • nodenext resolution will fail even if you fix this

So if you can point me at the "ongoing efforts", I'll write that problem up in the same tracking issue, and will be happy to help those efforts

from rxjs.

kwonoj avatar kwonoj commented on May 25, 2024

Ongoing effort -> the plan we turn our esm into spec complaint esm eventually. If you search esm in gh issues there are discussions / histories..

So yes, map always resolves to cjs is problem. It is coming from we are yet to support spec complaint esm. It is known.

from rxjs.

43081j avatar 43081j commented on May 25, 2024

Problem one of two, yes. If you can point me at the right issue for tracking this overall, I can explain the nodenext issues there instead. Otherwise I can open a separate issue only for the nodenext problem.

Even when you fix these mappings, it will fail in typescript because of the problems I mentioned in the original post. Specifically you will need to ship two sets of types if you insist on a dual package still.

Where would you rather that discussion/issue live? It is not the same as fixing this export map

from rxjs.

kwonoj avatar kwonoj commented on May 25, 2024

If you're referring this

when using nodenext resolution in typescript, the above map will be considered an error ("masquerading" modules). this is because CJS and ESM entrypoints shouldn't have the same type definitions.

It is also known. We are aware of those recommendation from https://arethetypeswrong.github.io/ as well, and the way we accept for now is pretty much similar to https://blog.isquaredsoftware.com/2023/08/esm-modernization-lessons/#typescript-declarations.

This may need to be fixed one day, but it's not an immediate priority.

I'm going to close this issue for now; there's a couple of spec compliant esm support tracking issue. Please feel free to append into existing comment. For me both belongs to esm support umbrella issue.

from rxjs.

43081j avatar 43081j commented on May 25, 2024

Yes exactly that, it does need fixing once the exports map and file extensions have also been fixed.

I was hoping you had one umbrella issue for this stuff but maybe not. I'll have another dig around unless you can point me at the issue for tracking esm support. No worries if you don't know off the top of your head.

I'll write up this stuff into the right one when I find it. I'm here offering to help whatever these ongoing efforts are.

from rxjs.

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.