You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: Allow models to be imported by Object reference:
importUserModelfrom'Models/User'ANT.init({models: {// Instead of modelsPaths to keep it compatibleUser: 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?
The text was updated successfully, but these errors were encountered:
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:
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?
The text was updated successfully, but these errors were encountered: