popcodeorg / popcodeorg/popcode

Stop using bower

Ouverte
#1,442 2 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Personne n'a encore pris cette issue.

code quality
Langage dominant
JavaScript
Étoiles
191
Forks
143
Merge moyen
4 j 11 h
PR mergées (30 j)
5

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.