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

Create a js: URL Scheme #55

Open
jridgewell opened this issue Jul 24, 2019 · 2 comments
Open

Create a js: URL Scheme #55

jridgewell opened this issue Jul 24, 2019 · 2 comments

Comments

@jridgewell
Copy link
Member

This is overflow question from the July 2019 meeting, particularly adressing @ljharb's importing concerns:

What if we created a js: URL scheme? We could then import builtin modules in two ways:

  1. Import (sync or async) script

    <script src="js:temporal"></script>
  2. Import module

    import Temporal from 'js:temporal';

When you import the script, you get some global added (eg, window.Temporal). This could be done sync (no attributes on the <script>), or async (<script async>).

When you import the module, you get the module.

@jhpratt
Copy link

jhpratt commented Jul 24, 2019

How would this work for any standard library platforms (like Node or the web) might want to add on?

@jridgewell
Copy link
Member Author

That's an entire other discussion we have to have. This is just an attempt to allow both script and module loading.

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

No branches or pull requests

2 participants