Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App version in Ember console debug statements #13

Open
slindberg opened this issue Mar 9, 2015 · 6 comments
Open

App version in Ember console debug statements #13

slindberg opened this issue Mar 9, 2015 · 6 comments

Comments

@slindberg
Copy link

Just started using this in our app, so thanks 😄

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. After a little digging it appears that initializers run after that method is called, 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?

@taras
Copy link
Contributor

taras commented Mar 9, 2015

Seeing version number in the console would be very nice, but it would only be available in development because production build suppresses debug messages.

With contentFor, you the version number might get lost when deploying without using generated index.html. Initializer works in that respect, because it's always included as part of app code.

Let's see what others have to say about this.

@lukemelia
Copy link

How about proposing Ember move logLibraryVersions to an initializer?

@taras
Copy link
Contributor

taras commented Mar 9, 2015

@lukemelia great idea!

@rwjblue
Copy link
Member

rwjblue commented Mar 12, 2015

I'm fairly sure that we can just do this before app boot via one of the JS context contentFor hooks.

Something conceptually like: https://github.com/jkarsrud/ember-cli-defeatureify/blob/master/index.js#L20-L22

@rwjblue
Copy link
Member

rwjblue commented Mar 12, 2015

This would remove the need for the guard added in #14, and remove the need for an initializer at all.

@MichaelVdheeren
Copy link

This would be neat and help to push the version together with the error to i.e. bugsnag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants