Skip to content
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

Browser-friendly ES modules #3858

Closed
sliekens opened this issue Jun 24, 2018 · 2 comments
Closed

Browser-friendly ES modules #3858

sliekens opened this issue Jun 24, 2018 · 2 comments

Comments

@sliekens
Copy link

Feature Request

RxJs is very useful in browser apps but unless you're using a bundler it's kind of hard to use the esm2015 version in the browser.

The reason why it's difficult is that all the import/export statements are extensionless:

// rxjs/_esm2015/index.js
export { Observable } from './internal/Observable';

In the browser that translates to an extensionless GET, which fails on naive HTTP servers.

GET /rxjs/_esm2015/internal/Observable
Referer: /rxjs/_esm2015/index.js

404 Not Found

Extensionless imports could work on a less naive server that knows how to resolve modules. I don't know of any HTTP server that does this and honestly I don't expect there to be one because that's terribly inefficient.

GET /rxjs/_esm2015/internal/Observable
Referer: /rxjs/_esm2015/index.js

302 Found
Location: /rxjs/_esm2015/internal/Observable.js

GET /rxjs/_esm2015/internal/Observable.js
Referer: rxjs/_esm2015/index.js

200 OK

So my feature request is to add js extensions to the imports and exports in the ESM build output.

@kwonoj
Copy link
Member

kwonoj commented Jun 24, 2018

Closing as dupe of #2858 . We are aware but need to decide which way to correctly produce desired build. No exact eta unfortunately at this moment.

@kwonoj kwonoj closed this as completed Jun 24, 2018
@sliekens
Copy link
Author

Thanks for the link.

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

No branches or pull requests

2 participants