popcodeorg / popcodeorg/popcode

Stop using bower

Abierto
#1,442 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Nadie ha tomado este issue todavía.

code quality
Lenguaje dominante
JavaScript
Estrellas
191
Forks
143
Merge medio
4 d 11 h
PR fusionados (30 d)
5

Descripción

We currently use Bower to install the libraries that are available to project code, e.g. jQuery, lodash, etc. This is a good fit since Bower by default ships packages in the old “put a global variable on window” form, which is exactly what Popcode projects expect.

However, Bower itself discourages people from using it, so we should probably migrate away from it. Ideally, we could just install the same packages via npm and load the pre-built standalone script into the preview frame. But there’s no guarantee that’s possible—lodash, for instance, does not appear to ship with a pre-built standalone script in its npm package.

A couple of other options (all kind of complicated and not terribly appealing) come to mind:

  • Create a webpack entrypoint for each library, then load the desired ones directly from the preview frame using <script> tags. This has the advantage of maintaining the expected behavior associated with loading scripts the old-fashioned way
  • Bundle all the libraries as part of the preview support script, but have the preview expose only the ones that are enabled as properties on window. This might get tricky with evaluation order, but has the advantage of not creating a proliferation of webpack entrypoints, and avoids the possibly vexing task of capturing the right reference to a bundle entrypoint to use in the <script> tag

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.