You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
OK, so at the very least can we not expose this feature unless users set a config flag? I understand that we need this for certain low level libraries when we don't have control over the user bootstrap, but we should discourage the use of this in most cases.
we should discourage use of it but we do need escape hatches. It's easier for demos and starting off with Universal. We should recommend how to refactor services/etc into the correct universal patterns
Actually, to this point, I think during our last call, @gdi2290, you seemed to have an idea of how you wanted to implement this, but we never said it explicitly. There are really two approaches here:
Have user pass in some value to Universal at build time that specifies the environment.
Have Universal infer the environment based on some global known factor (ex. if (!window))
It would seem like the first option is preferable which would mean we would be modifying the Universal API to accept in an environment value which is then stored at the platform level and is accessible through getters in the Universal API. If that lines up with what you are thinking, then the only question is whether the user should be able to check arbitrary environment values (ex. if (universal.isEnvironment('server'))) or if we want to just have a boolean isNode/isBrowser. I think you were leaning toward the later on this one, but that approach is less flexible.
Activity
jeffwhelpley commentedon May 10, 2016
Nooooooooooooooooooooo.
OK, so at the very least can we not expose this feature unless users set a config flag? I understand that we need this for certain low level libraries when we don't have control over the user bootstrap, but we should discourage the use of this in most cases.
PatrickJS commentedon May 10, 2016
we should discourage use of it but we do need escape hatches. It's easier for demos and starting off with Universal. We should recommend how to refactor services/etc into the correct universal patterns
JohnGorter commentedon May 30, 2016
Patrick,
Talked about taking on this feature, tell me (here or slack) what needs to be done :-)
jeffwhelpley commentedon May 31, 2016
Actually, to this point, I think during our last call, @gdi2290, you seemed to have an idea of how you wanted to implement this, but we never said it explicitly. There are really two approaches here:
It would seem like the first option is preferable which would mean we would be modifying the Universal API to accept in an environment value which is then stored at the platform level and is accessible through getters in the Universal API. If that lines up with what you are thinking, then the only question is whether the user should be able to check arbitrary environment values (ex. if (universal.isEnvironment('server'))) or if we want to just have a boolean isNode/isBrowser. I think you were leaning toward the later on this one, but that approach is less flexible.
PatrickJS commentedon May 31, 2016
I ended up doing it via 2bdeb32
angular-automatic-lock-bot commentedon Sep 4, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.