Skip to content

Publish with ecmascript module exports #3182

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
tracker1 opened this issue Nov 25, 2020 · 4 comments
Closed

Publish with ecmascript module exports #3182

tracker1 opened this issue Nov 25, 2020 · 4 comments

Comments

@tracker1
Copy link

tracker1 commented Nov 25, 2020

I'm wanting to reference the modules directly via unpkg and was trying to use module imports in a browser JS module...

import { Terminal } from 'https://unpkg.com/[email protected]/lib/xterm.js';
import { WebLinksAddon } from 'https://unpkg.com/[email protected]/lib/xterm-addon-web-links.js';
import { FitAddon } from 'https://unpkg.com/[email protected]/lib/xterm-addon-fit.js';

However, the esm export statements aren't part of the published modules. Would be nice to ether have .mjs references or include them in the published module(s).

@tracker1 tracker1 changed the title Publish with echmascript module exports Publish with ecmascript module exports Nov 25, 2020
@jerch
Copy link
Member

jerch commented Nov 26, 2020

Plz read this document about possible security implications with CDNs.

@tracker1
Copy link
Author

@jerch It's less about the security implications as being able to use this directly in the browser without having to use a separate bundler.

Using unpkg isn't significantly better/worse than using npm to receive these modules. From the POV of this project, it's likely a small configuration change.

@jerch
Copy link
Member

jerch commented Jan 14, 2021

Using unpkg isn't significantly better/worse than using npm to receive these modules.

I strongly disagree. NPM is the package repo we directly push our builds to, the service itself is an important and well-tested part of the whole JS ecosystem. These 2 facts make it much more trustworthy than some random CDN. For xterm.js normal web dev security standards are not enough, dealing with shell access raises the bar significantly.

Ofc this is only loosely coupled to your issue topic (which raises a valid point), still I think we should not feed a bad habit by making the insecure way even easier.

@Tyriar
Copy link
Member

Tyriar commented Jan 14, 2021

duplicate of #2878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants