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

Process inline JS with SystemJS #2

Open
Hypercubed opened this issue Jul 13, 2015 · 7 comments
Open

Process inline JS with SystemJS #2

Hypercubed opened this issue Jul 13, 2015 · 7 comments

Comments

@Hypercubed
Copy link
Owner

No description provided.

@Hypercubed
Copy link
Owner Author

For reference: ModuleLoader/es-module-loader#95

@Hypercubed
Copy link
Owner Author

Inline js is now processed by SystemJS when the script tag type is module. For example:

  <script type="module">
    import 'polymer/polymer.html!html';
    import marked from 'marked';

    Polymer({
      is: 'dom-element-dep',
      properties: {
        greeting: {
          type: String,
          value: '*I\'m a DOM element. This is my local DOM!*'
        }
      },
      ready: function() {
        var markdown = marked(this.greeting);
        this.$.content.innerHTML = markdown;
      }
    });
  </script>

However, relative urls use the root document base url.

@Hypercubed
Copy link
Owner Author

@Hypercubed
Copy link
Owner Author

Currently only works for direct imports. Nested imports do not have script type="module" tags processed.

@Hypercubed
Copy link
Owner Author

@guybedford brought up a good point here: ModuleLoader/es-module-loader#95

What to do with <script type="module" src="filename.js"></script> tags.

@safizn
Copy link

safizn commented Aug 9, 2016

Any news on SystemJS.import for html or other plugin dependent imports ?

@Hypercubed
Copy link
Owner Author

I haven't had a chance. The html-import world is changing every day.

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