Code Monkey home page Code Monkey logo

ant-orm's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

caiovalentim

ant-orm's Issues

Suggestions for Workers and Models

When using ant with systems like VueJS in a component structure, it's hard to use fixed paths to models and workers. The workers have to be copied, then imported, and models are always loaded by file path.

ANT plays nice with module a node module system, however still relies on these paths. This causes issues when used with a compiler like Webpack or such. The way these are imported, it's also simply not possible to use something like worker-loader to compile an application into a production ready, minimised file, hence there's always a need to add the 4 separate files into the project as uncompiled code. This also makes updating the package harder in the future as the files need to be copied on every build to ensure it's the latest version.

Suggestion: Use Freelancer, Blobs or this SO post to create service workers without needing a file path.

Suggestion: Allow models to be imported by Object reference:

import UserModel from 'Models/User'
ANT.init({
  models: { // Instead of modelsPaths to keep it compatible
    User: UserModel
  }
})

I currently haven't had the time to dig through all the code, but I'd love to try and improve on it. I'll make a PR if I've made some progress. Are you able to provide a test script of sorts I can use as a verification that everything still works as required?

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.