Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

redesigned resource store #326

Closed
wants to merge 127 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
1eeea27
moved initial resource store redesign work
drewfish May 23, 2012
86f5514
cleanups
drewfish May 26, 2012
ace2ac8
reworked how resources are found by convention
drewfish May 27, 2012
78d3224
refactored to add a more efficient OO interface
drewfish May 27, 2012
8af6ca8
uses new OO interface to YCB
drewfish May 27, 2012
a7684e1
monster (but hopefully clean) resource resolution
drewfish May 28, 2012
04178f9
api docs update
drewfish May 28, 2012
6648748
moved archetypes/ and management/commands/ into app/
drewfish May 28, 2012
c37ff7d
fixed up paths from move
drewfish May 28, 2012
0d4f181
real addon location and management
drewfish May 29, 2012
d6765bc
resource and resource version getters
drewfish May 29, 2012
1f4b70b
routes addon
drewfish May 29, 2012
f563a9d
first phase of yui RS addon
drewfish May 30, 2012
55b7c4d
query for mojit resources also includes shared resources
drewfish May 30, 2012
4fde110
new store wired into index.js
drewfish Jun 6, 2012
65315ba
updated for new store.getAppConfig() API
drewfish Jun 6, 2012
ba50170
uses the public store API to get the framework config
drewfish Jun 6, 2012
325bb3f
`mojito test` runs (tests don't pass yet)
drewfish Jun 6, 2012
9f9f91f
delinted
drewfish Jun 6, 2012
5a7ccbc
updated to match new resource store API
drewfish Jun 7, 2012
8987a60
everyone who wants the contents of a JSON file gets their own copy, t…
drewfish Jun 7, 2012
0b4c8a2
start of config RS addon tests
drewfish Jun 7, 2012
69333e2
rest of tests for addon-rs-config
drewfish Jun 8, 2012
7b98d0b
unit test for addon-rs-routes
drewfish Jun 8, 2012
666de01
addon-rs-routes was a little silly, so moved back into the store core
drewfish Jun 9, 2012
1c22f25
unit test for addon-rs-selector
drewfish Jun 9, 2012
6e4c260
unit test for addon-rs-yui
drewfish Jun 10, 2012
cc73e60
addon-rs-url (and unit tests)
drewfish Jun 10, 2012
00730bb
reorganization and documentation
drewfish Jun 11, 2012
5dac772
beginning if instance methods, starting with getMojitTypeDetails()
drewfish Jun 11, 2012
e5734ea
a posl should only contain a selector that actually exists in the app
drewfish Jun 12, 2012
e7ee3e1
first real version of expanceInstanceForEnv(), more tests pass but mo…
drewfish Jun 13, 2012
17ee938
fixed addon-rs-selector unit test
drewfish Jun 13, 2012
36f9781
Merge branch 'develop' into redesign-rs
drewfish Jun 13, 2012
2be4a98
Merge remote-tracking branch 'origin/redesign-rs' into redesign-rs
drewfish Jun 13, 2012
7b5e08e
missing dependency on json-stringify
drewfish Jun 13, 2012
f6f0c2f
moved store.getYuiConfig*() to addon-rs-yui
drewfish Jun 13, 2012
310ffd8
lint
drewfish Jun 13, 2012
df5c010
store.setLogger() is gone
drewfish Jun 13, 2012
4300213
store._root is spelled differently now
drewfish Jun 13, 2012
9a1f889
done
drewfish Jun 13, 2012
eaf657a
fixed up call to store.getAppConfig()
drewfish Jun 13, 2012
74a3cf7
store.getAllMojits() no longer exists
drewfish Jun 13, 2012
a49fb86
store._staticURLs and store.fileFromStaticHandlerURL() now part of ad…
drewfish Jun 14, 2012
17e2617
more stubs for YUI when parsing a javascript file
drewfish Jun 15, 2012
fc23793
specs
drewfish Jun 15, 2012
acc7bc2
yui RS addon calculates yui module dependencies
drewfish Jun 26, 2012
33d984b
updated resource-store-adapter tests. fixed some RS regressions
drewfish Jun 26, 2012
fafc6dc
Merge branch 'develop' into redesign-rs
drewfish Jun 26, 2012
6332a05
implemented deferAllOptionalAutoloads
drewfish Jun 27, 2012
fb31cc0
lint
drewfish Jun 27, 2012
e729db8
expandInstanceForEnv() caching
drewfish Jun 27, 2012
3fa37b3
allow the RS to have a configurable mojitoRoot, mainly to get coverag…
drewfish Jun 27, 2012
b2ac142
reimplemented mojit package.json check. reimplemented publishing of …
drewfish Jun 28, 2012
a88b834
fixed a couple of low-hanging unit tests
drewfish Jun 28, 2012
4d69bfa
implemented serializeClientStore()
drewfish Jun 28, 2012
e33d110
small memory optimization
drewfish Jun 28, 2012
4a26c6e
fixed addon-rs-url tests
drewfish Jun 28, 2012
b49e501
optimized RS unit tests
drewfish Jun 28, 2012
dc4ade4
last RS unit test now passes
drewfish Jun 28, 2012
dd22147
delint
drewfish Jun 28, 2012
47485cb
guard against missing controller
drewfish Jul 1, 2012
e4c1cee
works with new resource store
drewfish Jul 1, 2012
bd15400
preliminaries of `mojito build html5app`
drewfish Jul 2, 2012
923980b
no longer need to fixup instance langs
drewfish Jul 2, 2012
e0b50c6
the binders. working.
drewfish Jul 2, 2012
bbc3c8b
fixed builds.html5app.forceRelativePaths
drewfish Jul 2, 2012
56d9567
more client-side fixes
drewfish Jul 2, 2012
ea24545
delint
drewfish Jul 2, 2012
d02ffeb
`mojito compile rollups` now works
drewfish Jul 3, 2012
5b063b6
fixed the tests (again)
drewfish Jul 3, 2012
5b67bf5
`mojito compile views` now works
drewfish Jul 3, 2012
43676e4
`mojito compile inlinecss` now works
drewfish Jul 4, 2012
2a82f8e
cleaned up metadata leak between resource versions
drewfish Jul 4, 2012
195bc87
binders shouldn't be a dependency for the controllers
drewfish Jul 4, 2012
d9594b4
fixed params handling of routes
drewfish Jul 4, 2012
91798e6
inlinecss is common
drewfish Jul 4, 2012
59f4dfd
`mojito compile json` somewhat working (significant legacy issues wit…
drewfish Jul 4, 2012
c2dbe60
delint
drewfish Jul 4, 2012
226a7fd
fixed store-server test
drewfish Jul 4, 2012
86c4504
small variable name cleanup
drewfish Jul 4, 2012
c33fe81
fixed `mojito test --coverage`
drewfish Jul 4, 2012
e9ab62e
documentation cleanup (using [email protected])
drewfish Jul 5, 2012
ca8e2ae
ack, I was wrong about toPreload being undefined
drewfish Jul 5, 2012
6863713
cleanups and renames inspired by writing the skeleton doc
drewfish Jul 6, 2012
8ae219e
store.getRoutes() returns the default route if none set by user
drewfish Jul 7, 2012
4decbc6
any AC addon can get the store if they define a setStore() setter
drewfish Jul 9, 2012
d7f12f8
addon-rs-url honors a URL set by another RS addon
drewfish Jul 9, 2012
330ac6d
use store.getAllURLs() instead of methods on store.url
drewfish Jul 9, 2012
9ad9965
dropped getSpecURL() from addons-rs-url
drewfish Jul 9, 2012
5d31f35
Merge branch 'develop' into redesign-rs
drewfish Jul 9, 2012
dde6bb8
fixed variable name error found by jenkins jslint
drewfish Jul 9, 2012
1ed0688
fixed `mojito test app`
drewfish Jul 9, 2012
07d92f3
Merge branch 'develop' into redesign-rs
drewfish Jul 10, 2012
f960e3e
fixed rollups
drewfish Jul 12, 2012
439905a
don't try to find the YUI module names of js files in the assets/ dirs
drewfish Jul 12, 2012
6584e52
when loading tests, also load "libs" tests
drewfish Jul 13, 2012
c2b29b9
fixed YCB tests
drewfish Jul 13, 2012
85f8ee1
delint
drewfish Jul 13, 2012
de06a82
optimization: only track those dimensions that are actually used in …
drewfish Jul 14, 2012
de3b709
renamed addon-rs-selector.getListFromContext() to getPOSLFromContext()
drewfish Jul 14, 2012
8beb315
created addon-rs-selector.getAllPOSLs(), and used for deep optimizations
drewfish Jul 15, 2012
96194ef
better test for if the controller exists on the client
drewfish Jul 17, 2012
8d4ce64
validate context agains dimensions.json, to guard against spurious va…
drewfish Jul 19, 2012
f58867c
resolved this.rs and destructor() question
drewfish Jul 19, 2012
9af3c55
Merge branch 'develop' into redesign-rs
drewfish Jul 19, 2012
7afaf7d
more lenient when interpretting user-provided dimensions.json files
drewfish Jul 19, 2012
b34c6b3
better context validation
drewfish Jul 19, 2012
fb1624e
guard against wierd files, mainly broken symlinks
drewfish Jul 20, 2012
118eb6c
nifty features
drewfish Jul 20, 2012
1aceed9
no longer trim .affinity and .selector from resolved resources, since…
drewfish Jul 20, 2012
dd74db4
rewrite to use much of the power of the new resource store
drewfish Jul 20, 2012
f1b1bf3
option --trace
drewfish Jul 20, 2012
fd870d2
tweaked traced edges a skosh
drewfish Jul 20, 2012
55c26ac
more styling tweaks
drewfish Jul 20, 2012
33670a9
app resources override framework resources
drewfish Jul 22, 2012
0b4d26c
resolved issue of mojits that come from multiple sources (such as HTM…
drewfish Jul 22, 2012
d020064
Merge branch 'develop' into redesign-rs
drewfish Jul 22, 2012
a76b935
delint
drewfish Jul 23, 2012
afa371c
don't generate a URL for the "shared" mojit
drewfish Jul 23, 2012
ee33039
optimization: don't make a new Y object every time we want to make a…
drewfish Jul 25, 2012
f16c783
updating examples, since selector no longer defaults to device
drewfish Jul 25, 2012
31c3939
clone the routes in store.getRoutes(), because the router modifies th…
drewfish Jul 26, 2012
1c3b7e3
Merge branch 'develop' into redesign-rs
drewfish Jul 26, 2012
66978de
more defensive about poluting internal structures
drewfish Jul 27, 2012
70cae36
even more defenses against poluting internal structures
drewfish Jul 29, 2012
f78f3bd
fallback when validating "lang" context key
drewfish Jul 29, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/developer-guide/device_assets/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
}
}
}
}
},
{ "settings": [ "device:iphone" ], "selector": "iphone" }
]
5 changes: 4 additions & 1 deletion examples/developer-guide/device_views/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"type" : "device"
}
}
}
},
{ "settings": [ "device:android" ], "selector": "android" },
{ "settings": [ "device:blackberry" ], "selector": "blackberry" },
{ "settings": [ "device:iphone" ], "selector": "iphone" }
]

33 changes: 17 additions & 16 deletions examples/developer-guide/scroll_views/application.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
[
{
"settings": [ "master" ],
"specs": {
"frame" : {
"type" : "HTMLFrameMojit",
"config": {
"deploy": true,
"child" : {
"type" : "scroll"
},
"assets": {
"top": {
"css":[
"/static/scroll/assets/index.css"
]
"settings": [ "master" ],
"specs": {
"frame" : {
"type" : "HTMLFrameMojit",
"config": {
"deploy": true,
"child" : {
"type" : "scroll"
},
"assets": {
"top": {
"css":[
"/static/scroll/assets/index.css"
]
}
}
}
}
}
}
}
},
{ "settings": [ "device:iphone" ], "selector": "iphone" }
]
12 changes: 12 additions & 0 deletions examples/getting-started-guide/part4/paged-yql/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,17 @@
"type": "PagedFlickr"
}
}
},
{
"settings": [ "device:iphone" ],
"selector": "iphone"
},
{
"settings": [ "device:android" ],
"selector": "droid"
},
{
"settings": [ "device:android", "environment:dev" ],
"selector": "devdroid"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@
"type": "FlickrDetail"
}
}
}
},
{ "settings": [ "device:iphone" ], "selector": "iphone" }
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"flickr_base": {
"verbs": ["get"],
"path": "/flickr",
"param": "page=1&image=0",
"params": "page=1&image=0",
"call": "flickr.index"
}

Expand Down
4 changes: 3 additions & 1 deletion examples/newsboxes/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@
}
}
}
}]
},
{ "settings": [ "device:opera-mini" ], "selector": "opera-mini" }
]
3 changes: 2 additions & 1 deletion examples/sandbox/ex1/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"action": "jsonReturn"
}
}
}
},
{ "settings": [ "device:iphone" ], "selector": "iphone" }
]
44 changes: 22 additions & 22 deletions source/lib/app/addons/ac/deploy.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {

var store = this.rs,
contextServer = this.ac.context,
appConfigServer = store.getAppConfig(contextServer,
'application'),
appConfigServer = store.getAppConfig(contextServer),
contextClient,
appConfigClient,
yuiConfig = {},
fwConfig,
yuiConfigEscaped,
yuiConfigStr,
yuiModules,
Expand All @@ -97,7 +97,6 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
binder,
i,
id,
instances = {},
clientConfig = {},
clientConfigEscaped,
clientConfigStr,
Expand All @@ -109,11 +108,12 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
type,
module,
path,
pathToRoot;
pathToRoot,
urls;

contextClient = Y.mojito.util.copy(contextServer);
contextClient.runtime = 'client';
appConfigClient = store.getAppConfig(contextClient, 'application');
appConfigClient = store.getAppConfig(contextClient);
clientConfig.context = contextClient;

if (appConfigClient.yui && appConfigClient.yui.config) {
Expand All @@ -137,8 +137,7 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
yuiConfig.loaderPath = appConfigClient.yui.loader;
}

clientConfig.store = store.serializeClientStore(contextClient,
instances);
clientConfig.store = store.serializeClientStore(contextClient);

usePrecomputed = appConfigServer.yui &&
appConfigServer.yui.dependencyCalculations && (-1 !==
Expand All @@ -154,6 +153,8 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
useOnDemand = true;
}

urls = store.store.getAllURLs();

// Set the YUI URL to use on the client (This has to be done
// before any other scripts are added)
if (appConfigClient.yui && appConfigClient.yui.url) {
Expand All @@ -176,6 +177,7 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
yuiModules = ['yui'];
yuiJsUrlContains.yui = true;
if (useOnDemand) {
fwConfig = store.store.getFrameworkConfig();
yuiModules.push('get');
yuiJsUrlContains.get = true;
yuiModules.push('loader-base');
Expand All @@ -184,10 +186,8 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
yuiJsUrlContains['loader-rollup'] = true;
yuiModules.push('loader-yui3');
yuiJsUrlContains['loader-yui3'] = true;
for (i = 0; i < store.store._fwConfig.
ondemandBaseYuiModules.length; i += 1) {
module =
store.store._fwConfig.ondemandBaseYuiModules[i];
for (i = 0; i < fwConfig.ondemandBaseYuiModules.length; i += 1) {
module = fwConfig.ondemandBaseYuiModules[i];
yuiModules.push(module);
yuiJsUrlContains[module] = true;
}
Expand All @@ -209,7 +209,7 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
path = binder.needs[module];
// Anything we don't know about we'll assume is
// a YUI library module.
if (!store.fileFromStaticHandlerURL(path)) {
if (!urls[path]) {
yuiModules.push(module);
yuiJsUrlContains[module] = true;
}
Expand Down Expand Up @@ -240,9 +240,9 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
// fw & app scripts.
if (useOnDemand) {
// add all framework-level and app-level code
this.addScripts('bottom', store.getYuiConfigFw('client',
this.addScripts('bottom', store.store.yui.getConfigFw('client',
contextClient).modules);
this.addScripts('bottom', store.getYuiConfigApp('client',
this.addScripts('bottom', store.store.yui.getConfigApp('client',
contextClient).modules);
}

Expand Down Expand Up @@ -312,7 +312,7 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {

// Add all the scripts we have collected
assetHandler.addAssets(
this.getScripts(appConfigServer.embedJsFilesInHtmlFrame)
this.getScripts(appConfigServer.embedJsFilesInHtmlFrame, urls)
);
// Add the boot script
assetHandler.addAsset('blob', 'bottom', initializer);
Expand Down Expand Up @@ -344,10 +344,12 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
* @private
* @param {bool} embed Should returned scripts be embedded in script
* tags.
* @param {object} urls mapping of URLs to filesystem paths
* @return {object} An object containing script descriptors.
*/
getScripts: function(embed) {
getScripts: function(embed, urls) {
var i,
path,
x,
assets = {},
blob = {
Expand All @@ -359,16 +361,14 @@ YUI.add('mojito-deploy-addon', function(Y, NAME) {
// Walk over the scripts and check what we can do
for (i in this.scripts) {
if (this.scripts.hasOwnProperty(i)) {
if (embed && this.rs._staticURLs[i]) {
//blob.content+= fs.readFileSync(this.rs._staticURLs[i],
// 'utf8');
//delete this.scripts[i];
path = urls[i];
if (embed && path) {
this.scripts[i] = {
type: 'blob',
position: 'bottom',
content: '<script type="text/javascript">' +
minify(fs.readFileSync(this.rs._staticURLs[i],
'utf8')) + '</script>'
minify(fs.readFileSync(path, 'utf8')) +
'</script>'
};
} else {
this.scripts[i] = {
Expand Down
Loading