Skip to content
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

Generate a manifest file per project version #22

Closed
toddjordan opened this issue Mar 6, 2017 · 5 comments
Closed

Generate a manifest file per project version #22

toddjordan opened this issue Mar 6, 2017 · 5 comments
Assignees

Comments

@toddjordan
Copy link
Contributor

toddjordan commented Mar 6, 2017

This file will be a guide to what files exist in a given project version.

It will be used by the client for 2 purposes:

  1. To get a list of files and relationships for the navigation menu, according to Add concept of Package to the left nav ember-api-docs#131
  2. To get a list of total files to download via service worker/app cache, according to Store Application assets using Service Workers ember-api-docs#134

I think these might need to be 2 separate files.

One file can list all the files, the other can be used for relationships. Here's a proposal (open for suggestions)

List (manifest.json):

{
       "namespaces": [ { "name": "Ember.FEATURES",
                                      "url": "URL_TO_NAMESPACE_JSON" } ],
       "modules": [ {"name": "ember-debug",
                              "url": "URL_TO_MODULE_JSON"} ],
       "classes": [ {"name":  "Ember.Engine",
                            "url": "URL_TO_CLASS_JSON"} ] 
}

A relationship tree would be interesting... it would be used to populate the left nav and have enough info to specify the route we would go to if we clicked on the item.
pre-javascript module rfc Relationships (nav.json):

{
    "packages": [
        {
         "name": "ember",
         "type": "module",
         "children": [
              {     
                 "name": "ember-application",
                 "type": "module",
                 "children": [
                      {
                           "name": "Ember.ApplicationInstance",
                           "type": "class"
                      },
                      {
                           "name": "Ember.ApplicationInstance.BootOptions",
                           "type": "class"
                      },
                      {
                           "name": "Ember.Application",
                           "type": "class"
                      }, ...
                 ]
            }
         ]
    }]
    
}

This would allow both Classes and submodules/packages to be children, which wouldn't be an issue pre-js module rfc, but would after, and would allow eventually for classes, method, and properties to be listed.

@sivakumar-kailasam
Copy link
Member

@toddjordan You can assign this to me since I'm anyway restructuring the folders & generation logic

@toddjordan
Copy link
Contributor Author

toddjordan commented Mar 6, 2017

I could be talked out of splitting the manifest.json into namespaces, modules, and classes. We'd be providing this info in the nav.json.

Really the manifest.json would be used for hydrating the cache, and would be store by a key composed of an aggregate project-version-name (and possibly type)

{
       "items": [ { "name": "Ember.FEATURES",
                          "type": "namespace",
                          "url": "URL_TO_NAMESPACE_JSON" },
                       { "name": "ember-debug",
                          "type": "module",
                          "url": "URL_TO_MODULE_JSON"},
                       { "name":  "Ember.Engine",
                         "type": "class",
                         "url": "URL_TO_CLASS_JSON"}
        ]
}

@sivakumar-kailasam
Copy link
Member

sivakumar-kailasam commented Mar 6, 2017

in its current form a gzipped manifest of ember 2.11 comes up to 1kb. So we might be good for now to stick to the collated form. The manifest contains all the info mentioned in nav.json as well. Here's one in its existing form - https://gist.github.com/sivakumar-kailasam/07f33517f440bfd9a8dc417efa98383d.

@toddjordan
Copy link
Contributor Author

toddjordan commented Mar 6, 2017

I don't think that removing classes/namespaces/modules will make it bigger. Looks bigger above because we added type (not sure we'll need yet). I'd rather design the json for use by the client rather than size, as I don't think the peformance difference between 1 and 10kb will be noticable. also, the "types" may change with js modules rfc.

@acorncom
Copy link
Member

Fixed by #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants