Skip to content

tech-debt: Make framework more "composable" #36

@brent-hoover

Description

@brent-hoover

One of the goals of the framework is to be "batteries included" but I think you should be able to have more flexibility in what you want so you want so you are not carrying around a lot of extra dependencies for features you don't want or use. Obviously plugins would be the way you should be able to add those in. Features that should probably be plugins are:

  • The event system
  • The RBAC

That said I don't have any plans on supporting other dbs besides Mongo, at least not for a while. I think one of the reasons you would come to this framework is that you want Mongo to be a first-class citizen

We have a fair amount of dependencies already and I think we should try to keep this list very small and internal

For example when you bootstrap an Adonis project this is your package.json:

"dependencies": {
    "@adonisjs/auth": "^9.2.3",
    "@adonisjs/core": "^6.12.1",
    "@adonisjs/cors": "^2.2.1",
    "@adonisjs/lucid": "^21.1.0",
    "@vinejs/vine": "^2.1.0",
    "better-sqlite3": "^11.1.2",
    "luxon": "^3.4.4",
    "reflect-metadata": "^0.2.2"

You are just getting their own core packages plus database support

Ours looks like:

  "dependencies": {
    "@typegoose/typegoose": "^12.5.0",
    "apollo-server-express": "^3.13.0",
    "bcrypt": "^5.1.1",
    "bullmq": "^5.8.2",
    "casbin": "^5.30.0",
    "casbin-mongoose-adapter": "^5.3.1",
    "dotenv": "^16.4.5",
    "envalid": "^8.0.0",
    "express": "^4.19.2",
    "graphql": "^16.8.1",
    "jsonwebtoken": "^9.0.2",
    "kafkajs": "^2.2.4",
    "mongoose": "^8.4.1",
    "reflect-metadata": "^0.2.2",
    "type-graphql": "^2.0.0-rc.1",
    "typedi": "^0.10.0",
    "winston": "^3.13.0",
    "winston-daily-rotate-file": "^5.0.0"
  },

Which is a much greater spread. I think Kafka especially is a pretty big extra burden but I have a separate ticket to move that event system to be backed by Redis pubsub

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtJust my catch-all term for work that makes the app better but doesn't add a user feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions