bigskysoftware / bigskysoftware/_hyperscript
ES Modules
- Lenguaje dominante
- JavaScript
- Estrellas
- 3.8k
- Forks
- 171
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
_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:
1. ES Modules require a server environment setup because of [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
1. Right now, hyperscript **just works** -- You can run plain `.html` files 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.
2. 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.html` and tweak it straight away.
3. 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.
3. ES Modules will break all sites currently using hyperscript: `` 👀 (modern browsers fail with an error unless you add `type="module"`)
1. It's worth noting this gotcha and `import` are extra knowledge not always known to newcomers outside of Node or Deno in general...
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Revisa la distribución actual de *.modern.js y el uso existente de . Compara el comportamiento del navegador descrito para archivos .html locales, CORS y type="module". El resultado debe ser una decisión del maintainer sobre si documentar o seguir adelante con una distribución ES-module o un cambio de nombre.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript
- Área
- web-dev
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100