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

Publish as JavaScript module #65

Open
talentlessguy opened this issue Jun 15, 2019 · 2 comments
Open

Publish as JavaScript module #65

talentlessguy opened this issue Jun 15, 2019 · 2 comments

Comments

@talentlessguy
Copy link

Please include .mjs build so we can use it from unpkg with ?module suffix.

Example code with this module:

<script type="module">

// Import things
import htm from 'https://unpkg.com/htm?module'
import { React, ReactDOM } from 'https://unpkg.com/es-react-production'
import { Media, Player, controls } from 'https://unpkg.com/react-media-player?module'
const html = htm.bind(React.createElement)

const { Component } = React
const { render } = ReactDOM

class MediaPlayer extends Component {
  render() {
    return (
      html`<${Media}>
        <div className="media">
          <div className="media-player">
            <${Player} src="http://www.youtube.com/embed/h3YVKTxTOgU" />
          </div>
          <div className="media-controls">
            <${PlayPause} />
            <${MuteUnmute} />
          </div>
        </div>
      </Media>`
    )
  }
}


render(html`<${MediaPlayer} />`, document.getElementById('root'))
</script>

If this is will may take a long time, I can send a PR.

@souporserious
Copy link
Owner

Yes, if you can add a PR that would be greatly appreciated! 🙏

@talentlessguy
Copy link
Author

@souporserious ok, will do soon

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