Last active
August 29, 2015 13:56
-
-
Save commadelimited/8918473 to your computer and use it in GitHub Desktop.
Ember / Managing dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Right now we have one main application file, all of our Ember code, and a utils file which | |
contains a number of helper functions. Those files, along with an assortment of 3rd party libs, | |
and our "core" libs (Ember (and Data), Handlebars), etc. | |
``` | |
<script type="text/javascript"> | |
head.js( | |
// Ember (and Data), Handlebars | |
"https://emma-social.s3.amazonaws.com/assets/js/libs/min/core.libs-min.js", | |
// application code | |
"https://emma-social.s3.amazonaws.com/assets/js/es/min/application.utils.js", | |
"https://emma-social.s3.amazonaws.com/assets/js/es/min/application.activity.js", | |
// head.js callback, executes after all scripts are loaded | |
function(){ | |
// pass for now | |
} | |
); | |
</script> | |
``` | |
We're implementing a widget on a stand-alone page that completely duplicates the functionality | |
of one part of our app. So we're looking for an idiomatic way to manage distinct portions of | |
our Ember code to avoid duplication. We have the most experience with Require so we're looking | |
at that, but Ember seems to have trouble playing nicely with Require. We're considering breaking | |
down models, views, controllers, etc. into distinct pieces then reassembling them via Grunt | |
concat, but there's trouble there as well since we might end up with a weird circular dependency | |
in file ordering. | |
So I guess we're asking what the most efficient way of splitting out code is. We're also hoping | |
that the work we do for this problem with help us get set up to start writing tests for our Ember | |
code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment