{"issue":{"created_at":"2011-11-29T14:45:19Z","state":"open","updated_at":"2011-11-29T18:38:18Z","user":{"gravatar_id":"da6d769a219551f618ed95bff2c36aca","id":199907,"url":"https://api.github.com/users/ochameau","avatar_url":"https://secure.gravatar.com/avatar/da6d769a219551f618ed95bff2c36aca?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"ochameau"},"comments":5,"body":"This work is meant to simplify multiple things:\r\n\r\n  * XPI generated by cfx\r\n  * manifest (i.e harness-options.json file)\r\n  * the module loader implementation\r\n\r\nFirst, instead of registering one resource domain for each package section,\r\nwe are now registering only one per addon by using \"unique_prefix\" as domain.\r\ni.e. we will use the following URL for all addon files:\r\n\r\n    resource://$(unique_prefix)/$(packageName)/$(section)/$(module)\r\nSo if the addon id is \"my-addon@mozilla.com\", we will have following url for module cuddlefish:\r\n\r\n    resource://my-addon-at-mozilla.com/api-utils/lib/cuddlefish.js\r\n`unique_prefix` is computed by cfx and given to `bootstrap.js` that is going to register the resource domain by reading `unique_prefix` from the manifest.\r\n\r\nIn order to do register only one resource, we changed the XPI file layout a bit and simplified it. We still put all files into `resources` folder, but instead of having folders containing the jetpack id, we simply put packages folders. Here is an example of resources folder:\r\n\r\n    resources/\r\n      api-utils/\r\n         lib/\r\n           cuddlefish.js\r\n           file.js\r\n         data/\r\n           content-script.js\r\n         tests/\r\n           test-main.js\r\n      my-addon/\r\n        lib/\r\n          main.js\r\n        data/\r\n          panel.html\r\n        tests/\r\n          test-main.js\r\n\r\nSo `resources` folder contains packages folders with package name, all these package folders contains section folders (i.e test, data, lib, locale, ...). Finally section folders contains module files, static files, locale files, ...\r\n\r\nI end up removing various unused manifest attributes: bundle_id (equal to jetpackID), resources, resourcePackages, packageData, rootPaths.\r\n`manifest` attribute is now indexed with module path from `resource` folder (instead of module resource URL):\r\n\r\n     \"manifest\": {\r\n        \"addon-kit/lib/panel.js\": {\r\n            ...\r\n        },\r\n        ...\r\n      }\r\n","assignee":null,"id":2385100,"number":276,"pull_request":{"patch_url":"https://github.com/mozilla/addon-sdk/pull/276.patch","html_url":"https://github.com/mozilla/addon-sdk/pull/276","diff_url":"https://github.com/mozilla/addon-sdk/pull/276.diff"},"labels":[],"title":"Bug 660629 - Simple XPI file layout","closed_at":null,"html_url":"https://github.com/mozilla/addon-sdk/issues/276","url":"https://api.github.com/repos/mozilla/addon-sdk/issues/276","milestone":null},"action":"created","comment":{"created_at":"2011-11-29T18:38:18Z","updated_at":"2011-11-29T18:38:18Z","user":{"gravatar_id":"da6d769a219551f618ed95bff2c36aca","id":199907,"url":"https://api.github.com/users/ochameau","avatar_url":"https://secure.gravatar.com/avatar/da6d769a219551f618ed95bff2c36aca?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"ochameau"},"body":"I don't think that @ is allowed in domains so that resource://my-addon@mozilla.org/ won't work.\r\n(But I haven't checked that, I just supposed that we did that for the URL)\r\n","id":2940706,"url":"https://api.github.com/repos/mozilla/addon-sdk/issues/comments/2940706"}}