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

Add ES module export version #2112

Closed
porsager opened this issue Mar 29, 2018 · 4 comments · Fixed by #2194
Closed

Add ES module export version #2112

porsager opened this issue Mar 29, 2018 · 4 comments · Fixed by #2194
Labels
Type: Enhancement For any feature request or suggestion that isn't a bug fix

Comments

@porsager
Copy link
Contributor

porsager commented Mar 29, 2018

Until/if Mithril switches to ES modules, and eg. rollup, it would be nice to have an ES module bundle for mithril and mithril/stream.

My suggestion is a simple addition in the form of a new bundle, based on the current one, but changed to use export default m and export { stream } instead and then add "module": "mithril.mjs" to package.json

I've just finished support for ES modules in flems (not deployed to main yet), and thought it would be great to be able to do

import m, { stream } from 'mithril'

Here is a flems example using bss

Would a pull request for this be welcomed?

@futurist
Copy link
Contributor

+1 for this, very needed for a modern application.
Any response? @lhorie @pygy @tivac @barneycarroll

@barneycarroll
Copy link
Member

I would love to see that PR!

@dead-claudia dead-claudia added the Type: Enhancement For any feature request or suggestion that isn't a bug fix label Oct 28, 2018
@dead-claudia
Copy link
Member

Duplicate of #1886

@dead-claudia dead-claudia marked this as a duplicate of #1886 Nov 13, 2018
@dead-claudia
Copy link
Member

Just found the dupe...sorry!

dead-claudia pushed a commit that referenced this issue Nov 14, 2018
…2194)

* output mithril, stream and ospec esm versions on build

* Add esm bundles

* [request] Clearer error message for JSON deserialization failure (#2195)

* Bundled output for commit fd7cf80 [skip ci]

* Fix #1714 conditionally halting stream (#2200)

* Fix #1714 conditionally halting stream

* Add note in changelog

* Do not include stream as named export in mithril.esm.js

* Rename mithril.min.esm.js to mithril.esm.min.js

* Add esm files to eslintignore

* Add named exports

* Add hyperscript `m` as named export

* Add builds with export changes

* checkout regular bundled files

* Change .esm.js to .mjs

* Update pkg module to point to .mjs

* Fix for export names to avoid collision

* Updated bundled files
@dead-claudia dead-claudia moved this to Completed/Declined in Feature requests/Suggestions Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement For any feature request or suggestion that isn't a bug fix
Projects
Status: Completed/Declined
Development

Successfully merging a pull request may close this issue.

4 participants