Skip to content

Allow model logic code from compiled function #98

Closed

Description

@shlomiassaf

At the moment, application logic for models is defined in static module files.
The executor loads the module in the process of defining a model.

This is the only way when models are defined using 'model-config.js`

Issue #49 suggests custom model definition loading.
PR #96 implements #49 using additional property that holds model definition objects instead of them being in modelDir/modelName.json. An additional property is used to define the sourceFile (logic) for each model.

This approach forces external packages to supply a path to a file that holds the model logic.

When using dynamic model-config one can use a file to hold the model logic, as used today AND can also hold the logic in a pre-loaded function/module/etc...

The 2nd approach is not supported and it is quite simple to support it simple by checking if 'sourceFile' is a string or a function and acting accordingly.

This improves control by many factors...

Model logic loading section, HERE

NOTE: If choosing to implement via the same parameter (sourceFile), make sure to change logic in complier so path verification is ignored if parameter is a function.

NOTE-2: This suggestion has no dependency with #49 or #96 since custom model-config is already supported, only custom model definition is not.

Activity

  1. bajtos commented on Nov 2, 2018

    @bajtos
    Member

    In October 2018, LoopBack 4.0 GA was released. LoopBack 3 and its supporting modules have entered LTS mode. Per our Long Term Support Policy, this means new features are no longer accepted.

    I am closing this GitHub issue as "wont fix".

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions