Skip to content

Publish different transpilation targets to different npm packages #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeffbcross opened this issue Nov 18, 2015 · 12 comments
Closed

Publish different transpilation targets to different npm packages #751

jeffbcross opened this issue Nov 18, 2015 · 12 comments
Assignees
Labels
feature PRs and issues for features
Milestone

Comments

@jeffbcross
Copy link
Contributor

In order to have nicer import paths, without dist and module/language directories, we should publish the different outputs (CJS, ES6, TS) as different npm packages: rxjs for CJS, rxjs-es6 for ES6, rxjs-ts for TypeScript. It would also be nice to drop the @reactivex scoping in the process, since that causes issues for users with older npm versions.

Before:

import {map} from '@reactivex/rxjs/dist/cjs/operators/map';

After (though #750 will move the operators even further up the export tree)

import {map} from 'rxjs/operators/map';
@jeffbcross jeffbcross added the feature PRs and issues for features label Nov 18, 2015
@jeffbcross jeffbcross added this to the Initial Beta milestone Nov 18, 2015
@benlesh
Copy link
Member

benlesh commented Nov 18, 2015

This is a great idea. It would solve some of the other issues we've seen with people on older versions of npm as well.

@benlesh
Copy link
Member

benlesh commented Nov 18, 2015

So I think rxjs, rxjs-es6 and rxjs-ts would do, where rxjs is the CJS version of the library.

@jeffbcross
Copy link
Contributor Author

Awesome, unless someone has already started work on this (@robwormald), I'll get to work once I wrap up another issue I'm working on in angular.

@jeffbcross jeffbcross self-assigned this Nov 18, 2015
@robwormald
Copy link
Contributor

i can do this if you like @jeffbcross

@robwormald
Copy link
Contributor

i dont think we need the TS distro either - just distribute the .d.ts files alongside the ES6 and CJS output (like we do already)

@benlesh
Copy link
Member

benlesh commented Nov 18, 2015

Perhaps it should be rxjs-es ... because some day it will be es7 or es2025 or whatever. But hopefully by then the module wars will be over.

@benlesh
Copy link
Member

benlesh commented Nov 18, 2015

... then again that could imply es3 haha. I give up. What makes sense?

@robwormald
Copy link
Contributor

SystemJS et al refer to it as esm - https://github.com/systemjs/systemjs/blob/master/docs/module-formats.md

@trxcllnt
Copy link
Member

What about rxjs-node, rxjs and rxjs-ts for CJS, ES6+, and TS respectively?

@benlesh
Copy link
Member

benlesh commented Nov 20, 2015

@trxcllnt: I discussed this on Slack with @jeffbcross, and he brought up a good point on the rxjs-node front, which is that CJS isn't really node specific. Many developers use CJS for their client-side bundling processes.

@jeffbcross
Copy link
Contributor Author

I also like the idea of CJS being the default, non-suffixed (rxjs) distribution, since it is in the current native format of node modules (CJS).

@jeffbcross
Copy link
Contributor Author

Closed by @robwormald in 185abdf

(Issues have been opened to fix bugs introduced in the new process)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature PRs and issues for features
Projects
None yet
Development

No branches or pull requests

4 participants