ember-cli / ember-cli/ember-cli-app-version

App version in Ember console debug statements

Ouverte
#13 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
55
Forks
42
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Just started using this in our app, so thanks :smile:

Since the addon defines an initializer that registers the app as an ember library, I was surprised to see that it wasn't listed in the normal [library version debug output](https://github.com/emberjs/ember.js/blob/v1.11.0-beta.4/packages/ember-application/lib/system/application.js#L1106-L1126). After a little digging it appears that initializers run after [that method is called](https://github.com/emberjs/ember.js/blob/v1.11.0-beta.4/packages/ember-application/lib/system/application.js#L282), so the app version isn't in the list when it's printed. Not a big deal, but I've definitely found it handy to find the version in the console without opening the ember inspector and clicking the info tab (I used to call `Ember.libraries.register` in `app/app.js` directly).

I would have opened a PR, but I can't figure out how to use addon hooks to run code before `Ember.Application#init` is called. The only thing I could think of was to add an inline script using the `contentFor` hook, but that ends up violating CSP. Do you have any idea how to do this?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par les sections liées de Ember application.js qui montrent la sortie de débogage de la bibliothèque et l’ordre d’appel de Application#init. Lisez le comportement de l’initialiseur de l’addon et du hook contentFor, ainsi que l’approche d’enregistrement existante dans app/app.js. Le travail est terminé lorsque la version de l’application apparaît dans la sortie normale de la bibliothèque dans la console sans enfreindre CSP.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
developer-experience
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

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