web-bundle: remote plugin imports are found by regex, so a computed import() is missed
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, node.js, typescript
- Área
- frontend
Línea de trabajo
Start in apps/web-bundle/src/loader.js, where SPEC_RE finds imports and rewrites relative ones to blob URLs, then compare with apps/cli/remote-loader.js, whose header explains why resolving as the module system requests avoids the regex's failure modes. Reproduce a computed import(variable) of a sibling file in the browser and an import text inside a string or comment. Done means the browser loads both cases as Node does, but the fix needs a design choice between a real parse with sucrase and a service worker, so confirm the approach with the maintainer first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
In the browser, a remote plugin's computed dynamic import (import(variable)) of one of its own files fails, and an import inside a string, comment or template literal can be rewritten. The same plugin works on Node.
Why
apps/web-bundle/src/loader.js finds imports with a regex (SPEC_RE) and rewrites the relative ones to blob URLs before the module runs. A computed specifier is invisible to it and is left to resolve against the module's blob: URL, which cannot resolve a relative reference. The regex also cannot tell an import from the same text inside a string or comment.
Node stopped predicting the graph this way: apps/cli/remote-loader.js resolves each import as the module system actually requests it, and its header gives the regex scan's failure modes as the reason.
Notes toward a fix
The browser has no resolve hook for blob modules, so the options are a real parse (sucrase is already loaded for type stripping and can give import positions) plus a runtime helper for computed specifiers, or a service worker serving the plugin under its real URL so the browser resolves natively. The second would also fix root-relative imports and import.meta.url, at the cost of the in-memory, no-service-worker design.
Found while reviewing #93.
- Lenguaje dominante
- TypeScript
- Estrellas
- 5
- Forks
- 2
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 11
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MatAtBread/matbot
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
MatAtBread/matbot#99 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MatAtBread/matbot#95 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
MatAtBread/matbot#94 ·
Los mantenedores suelen responder en 1 día
-
http: ToolContracts arm duplicates HttpInput inline — named references now expand on the wireAbierto
Dificultad 3/5 Medio día Aptitud para principiantes 66/100
MatAtBread/matbot#100 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
plugin add/remove: nothing records what an install created, so the undo and the uninstall both guessPosiblemente ocupada @MatAtBread la tomó hoy. Abiertobug
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
MatAtBread/matbot#98 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de MatAtBread/matbot
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
one-zero-eight/apply-bot#39 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bigbluebutton/bbb-ui-components-react#108 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
high priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
CI-CMG/deep-sea-corals-exb#84 · 1 comentario ·