Git Product home page Git Product logo

Comments (1)

devinivy avatar devinivy commented on September 21, 2024

Been thinking about this. My original thought was that dogwater would be able to be registered multiple times. Each time would simply aggregate options (models, connections, adapters, defaults, etc.) until the server was initialized, at which point it would also initialize waterline with all the aggregated options.

This sounds great, and allows plugins to independently register dogwater as needed, without having to think about what other plugins are doing. The downside, however, is that dogwater would never get access to its parent plugin's realm. And that means dogwater has no way to track which collections belong to which plugin! Until hapijs/hapi#3066 is considered, the only way for a plugin to utilize another plugin's realm is with server decorations (like loveboat's server.routeTransforms()).

So my thought is to,

  1. Make dogwater a connectionless plugin that gets registered once– this registration could provide some global connections and collections. Think of this as a top-level plugin on your server– all other plugins that want to use it must declare dogwater as a dependency.
  2. Provide a server decoration that can be used to register collections that are sandboxed to the current realm/plugin. E.g. server.dogwater({ connections, models, adapters }).

What confuses me is that I could also allow dogwater to be registered multiple times and keep the server decoration. But then I could only sandbox models registered using the decoration, and folks would surely use dogwater all sorts of different bizarro ways.

CC @mattboutet

from dogwater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.