Skip to content

Deprecate Require plugin? #1611

@jimmywarting

Description

@jimmywarting

when fixing sync loading in #1610 (specifically test 298) i tough: isn't it best if developers load plugins themself instead?
it's not so hard to just do something like:

import('path-to-plugin') // when necessary

where the plugin assign itself into alasql

import alasql from 'alasql'

class Echo {
  constructor (params) {
    Object.assign(this, params)
  }

  toString () {
    var s = 'TEST ' + this.expr.toString()
    return s
  }

  execute (databaseid, params, cb) {
    var fn = new Function('params, alasql', 'return ' + this.expr.toJS())
    var res = fn(params, alasql)
    if (cb) res = cb(res)
    return res
  }
}

alasql.yy = Echo

i really do not think it's up to alasql to handle the loading of plugins. what do you think?

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