Skip to content

Ideas for v3.0 #2

Closed
Closed

Description

@bajtos

Copy of comment by @raymondfeng:

  1. I think we need to organize the boot into multiple phases, such as:
    • discover/load: Find and load configurations
    • resolve/wire: Resolve the references (such as model.dataSource) and wire them together
    • startup: Initialize the datasources/models (model class can potentially have lifecycle event listeners)
    • shutdown: Emit events to notify model classes of system shutdown
    • refresh/update: React to config changes, especially additions
  2. How do we load plugin modules, for example, loopback-passport, loopback-push-notification which typically has dependencies to app and also contributes middlewares/models/datasources? See https://github.com/strongloop/loopback-example-component/issues/4
  3. Do we want to support both sync and async booting? Or eager/lazy booting? See Add support async scripts #50 for implementation of async boot scripts.

Activity

  1. changed the title [-]Ideas for v2.0[/-] [+]Ideas for v3.0[/+] on Jul 24, 2014
  2. Coobaha commented on Aug 2, 2014

    @Coobaha

    you should add support for custom coffeescript model files, in common/models
    like customer.json and customer.coffee
    in compiler.js .coffee is mentioned, but this file extension is not supported.

  3. offlinehacker commented on Aug 2, 2014

    @offlinehacker

    Also support for having multiple model JavaScript files for same model in multiple folders, and all of which getting run at boot, so you could separate some logic for client and server.

  4. bajtos commented on Aug 11, 2014

    @bajtos
    MemberAuthor

    Also support for having multiple model JavaScript files for same model in multiple folders, and all of which getting run at boot, so you could separate some logic for client and server.

    You should be able to create client-only and server-only models by extending the shared model:

    common/models/product.json
    {
      "name": "ProductBase",
      // properties, relations, etc.
    }
    
    common/models/product.js
    // shared code
    
    server/product.json
    {
      "name": "Product",
      "base" : "ProductBase"
    }
    
    server/models/product.js 
    // server-only code
    
  5. bitmage commented on Oct 14, 2014

    @bitmage
    Contributor

    @Coobaha I've submitted a pull request for this:

    #55

  6. bajtos commented on Oct 14, 2014

    @bajtos
    MemberAuthor

    @offlinehacker Also support for having multiple model JavaScript files for same model in multiple folders, and all of which getting run at boot, so you could separate some logic for client and server.

    See this discussion in LoopBack: strongloop/loopback#397

  7. bajtos commented on Oct 14, 2014

    @bajtos
    MemberAuthor

    How do we load plugin modules, for example, loopback-passport, loopback-push-notification which typically has dependencies to app and also contributes middlewares/models/datasources?

    We have discussed the component architecture here: https://github.com/strongloop/loopback-example-component/issues/4

    Do we want to support both sync and async booting?

    #50 implemented support for async boot scripts.

  8. added this to the LoopBack 3.0 milestone on Nov 26, 2014
  9. bajtos commented on May 24, 2016

    @bajtos
    MemberAuthor

    I am afraid we don't have bandwidth to follow up on this discussions in v3.0. @raymondfeng is working on some related changes to loopback-boot in #181, that's all we can get now. I am closing this issue in favour of the other issues mentioned in the description at the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions