-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Move config into meta. #2086
Move config into meta. #2086
Conversation
Nice @lukemelia thoughts? |
2ba5f0e
to
ecd38b6
Compare
ecd38b6
to
f00df08
Compare
😍 Very happy with where this ended up. Nice work! |
@tchack - All you need to do is provide a |
@stefanpenner - I'll make it an option. 'embedConfig' and default to false. |
configAsModule:true|false ? |
@stefanpenner - it is always a module (in both scenarios), the question is whether we add the module to load from meta or just contain static compiled info at build time. |
ah true. |
Awesome! |
@rwjblue are you working a PR for |
@joostdevries - I'm working on it, but would appreciate it if you could make an issue (and I can close that issue with my PR). |
@rwjblue - We load our ember app inside an iframe and we are getting the following error: Uncaught SyntaxError: Unexpected token u Inside the following function: define('client/config/environment', ['ember'], function(Ember) { return { 'default': config }; The 'rawConfig' is undefined. It works fine if we don't load it inside an iframe. Hope the option to disable it gets added in the next release. Thanks for all your effort. Ember CLI is awesome! |
I'm initialising Mixpanel and GA scripts in my index.html template and for that I need to fetch tokens from my ENV. Which I can't do from the controller property, because as far as I know the Ember is not yet initialised when rendering the index.html. Currently I'm doing it like this (index.html):
And, for example, using it later like this:
Is there a better way to fetch ENV variables from config/environment.js in the index.html, to be used for inline JS scripts? |
@matixmatix I think you'll want to take a look at #2221 where some approaches for this are discussed. |
{{CONFIG_META}}
to theapp/index.html
andtests/index.html
.<my-app-name>/config/environment
that simply reads the current meta value.<my-app-name>/config/environments/*
from module system output.Closes #2059.