Coder Social home page Coder Social logo

import-as-and-html-modules's People

Contributors

ashleyscirra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

import-as-and-html-modules's Issues

Expressions as `Type` problematic?

Related to #4

The example from the README uses globals like JSON which are expected to be already available when the module is instantiated. I don't know if that's the case, but even if it was: what about expressions in general?

Something like

const Something = ...;

import "xx" as Something;

would not work because Something has not been initialized yet.

Possible alternatives:

import "xx" as "something";
// or
import Something from "something";
import "xx" as Something;

Additional arguments to Type[Symbol.importer](url)

Will it be possible to pass additional arguments to the Symbol.importer method? This could be necessary in order to support some Web Assembly use-cases (#3) where someone wants to pass an importObject to the underlying WebAssembly.instantiate().

The tricky part here is to figure out in which phase of the module graph initialization Symbol.importer would get executed.

Script not executed

Super initiative to refresh the whole HTML Imports!
However, to really copy the behavior of HTML Imports, the inline script tags should execute upon loading of the HTMLModule. This is not the case in this implementation or am i missing something?

I really like the approach taken here..

Future of this library

Hey @AshleyScirra , super cool concept. We're wondering if you plan on continuing with development, or what other solutions to this problem you've come across.

We've got a ton of polymer 3 elements we've created and it would be super cool if we could use something like this to code split out the individual parts. Since you've coded this I'm guessing you have thought about the problem quite a bit. Could we get some of your thoughts? Right now we bundle everything with webpack using static ES6 imports. My email is [email protected].

Use-case for web assembly

Hey @AshleyScirra ๐Ÿ‘‹,

I really like your proposal. I think this would allow us to substitute webpack loaders in the long run.

Another use case I see (and I was surprised not to find in the README) is Web Assembly support:

import {myRustFunction} from "./my-rust-function.wasm" as WasmModule;

where WasmModule would do the WebAssembly.instantiateStreaming() dance.

Would do you think?

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.