Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to independent service provider architecture #25

Open
amilajack opened this issue Mar 9, 2018 · 0 comments
Open

Migrate to independent service provider architecture #25

amilajack opened this issue Mar 9, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@amilajack
Copy link
Member

amilajack commented Mar 9, 2018

The current api requires all the service providers to be loaded when falcon-core is imported. falcon-core currently takes about an entire second to load. Each provider requires its own native dependency. For example, the SqliteProvider depends on sqlite3, which is a native dep. Webpack can't work with native deps yet so this really hurts our perf of importing native deps (which includes falcon-core). We should migrate to an api which allows users of falcon-core to import only the providers they need like so:

async function main() {
  const  { SqliteProvider } = import('falcon-core')
  const serverInfo = {...};
  const serverSession = db.createServer(SqliteProvider, serverInfo);
  const connection = await serverSession.createConnection('demo.sqlite');
  await connection.connect();
  const schema = await connection.getSchema('tracks');
}
@amilajack amilajack added the enhancement New feature or request label Mar 9, 2018
@amilajack amilajack self-assigned this Mar 9, 2018
@amilajack amilajack mentioned this issue Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant