atomictech / aurelia-collection Goto Github PK
View Code? Open in Web Editor NEWAn opinionated collection of models abstraction for aurelia framework. (WIP)
License: MIT License
An opinionated collection of models abstraction for aurelia framework. (WIP)
License: MIT License
Update() method should merge attributes from newly fetch json, instead of replacing it.
In some case it causes problems when partial json is received, it then erase the model previously received data
sync and then _syncFrom are not syncing correctly. It only update previously undefined fields. I new data is available it is ignored due to _.defaults()
I'm submitting a bug report
Framework Version:
v0.4.9
Language:
ESNext
Current behavior:
When first get request is processed, models are not well processed and then referenced sub-models are not created.
Expected/desired behavior:
When requiring model for the first time we want sub-models to be well instantiated.
In fact issue seems to be somewhere related to the backendKey
to frontendKey
conversion.
aurelia-collection/src/collection.js
Line 317 in c65917e
model
the backendKey
while inside it is already converted to frontendKey
. As a result itemData
is undefined
and sub-models will not be instantiated.I'm submitting a feature request
Framework Version:
0.5.0
Current behavior:
When declaring refKey like this: some._ref_key
, actually we cannot address the use case where some
is an array and we want to rewrite refKeys inside each element of this array.
What is the motivation / use case for changing the behavior?
The need of handling association patterns in models. For example we want to associate BehaviorModel to an ActorModel in a specific PlayModel.
The easiest way to do it is to create an array in the PlayModel which possesses associations of ActorModel and BehaviorModels. Indeed the association of BehaviorModel and ActorModel is contextual to the PlayModel and I dont want to create another collection to handle this as an 1<=>1 association (1 PlayModel <=> 1 hypothetical PlayActorBehaviorAssociationModel).
aurelia-collection
should iterate over model arrays in order to rewrite refKeys.
When a newly model is created with an date attribute, the constructor transforms it in a Date() object. If update is called on this model, the date attribute is reset to string date, and the Date() object is destroyed.
I wonder if we shouldn't rename the collection
naming within that specific file to use a more explicit service
, such as registerService
or getService
. This is rather confusing with the Collection
class (and file) we provide for aurelia resolving mechanic.
Or did I miss something ?
Finish to set up Karma unit tests, and start a travis CI build setup.
We should implement a find method that allow to fetch upon custom field, that first check upon local models. It represent 80% of or custom methods in collections, and will avoid direct fetch in thoses.
We should complete unit test, and have a good (or event perfect) coverage before release 1.0 :)
Add an all() method that fetch all the models of a collection
We cannot use the same collection class multiple times. It's ok when we re-implement a specific collection class, but start to be anoying when using the generic one.
-> we should find a way to make it painless at configuration time for the devs
For now the update() method wait for backend response, and set the responded json to the model attributes.
It causes problem when backend response is not what the model expects.
For example Dates :
On the get from service the constructor method of a model can transform a date sent as string by the backend response.
But on the service update case, the model has no chance to transform the response from the backend and then have its date attributes overwriten by strings.
Maybe we should merge the local json (body argument of the update) instead of the response of the backend.
Would be nice to comment everything in order to prepare release 1.0.0
Update the readme.md with quick start usage, and examples.
also add badges (contributors, build success, npm etc)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.