ES Modules
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- web-dev
Research direction
Review the current *.modern.js distribution and existing <script src="hyperscript.js"> usage. Compare the browser behavior described for local .html files, CORS, and type="module". Done is a maintainer decision on whether to document or pursue an ES-module distribution or naming change.
Written by the indexing model from the issue text.
Description
Feel free to convert this into a Github Discussion.
Hello, you may be stumbling upon this thinking "why isn't the ES Module the main form of distribution for hyperscript?"
I want to have a public thread of the pitfalls for this as it will likely become re-occurring as other libraries experiment with this while hyperscript grows in popularity.
ES Modules are not a drop-in replacement for classic modules, and bring their own barriers to entry:
- ES Modules require a server environment setup because of CORS.
- Right now, hyperscript just works -- You can run plain
.htmlfiles directly off your local disk. No server setup requirement. This is a competitive advantage and makes us an easy recommendation to newcomers of web development. - Playing with real hyperscript is IMHO the quickest way to make a new user. Getting to that point needs to be friction free: the language is already different enough! Someone from reddit or the orange site can download a mindblowing example like
hyperwordle.htmland tweak it straight away. - It will be bad for growth of the language for users to get hung up on advanced topics like CORS-- We want them to see how awesome hyperscript is without putting immediate stumbling blocks in the way.
- Right now, hyperscript just works -- You can run plain
- ES Modules will break all sites currently using hyperscript:
<script src="hyperscript.js"></script>👀 (modern browsers fail with an error unless you addtype="module")- It's worth noting this gotcha and
importare extra knowledge not always known to newcomers outside of Node or Deno in general...
- It's worth noting this gotcha and
Personally I think it'd be smart to rename *.modern.js to *.module.js or *.mjs (or another standard), because its current form is misleading- and will lead to many fun "lets go to es modules" tickets in the future.
I love that Node / Deno got ES Modules in the browser (and its great when working in those stacks), but they are not a drop in replacement as implemented in the standard as of 2022.
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bigskysoftware/_hyperscript
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#678 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bigskysoftware/_hyperscript#676 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bigskysoftware/_hyperscript#695 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
bigskysoftware/_hyperscript#687 ·
All issues in bigskysoftware/_hyperscript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·