syneticnl / hyral Goto Github PK
View Code? Open in Web Editor NEWHypermedia oriented Resource API Layer
License: MIT License
Hypermedia oriented Resource API Layer
License: MIT License
When updating a collection or resource the component does not react to changes.
It should not do so as this is used to detect changes on a resource.
ERROR [Vue warn]: Error in render: "TypeError: Cannot read property 'data' of undefined" 09:31:12
Seems to be related to the change on how resources are returned from the state now.
Research if/how (http/2) push can be implemented for Hyral.
At the moment a problem in loading a collection cannot be catched because it is catched in the load function of the collection.
It would be nice if this throws another exception (like loading error) so the calling code can react to problems. In the vuex implementation this exception could be catched and handled.
const numPages = parseInt(query.page.number, 10);
const numPerPage = parseInt(query.page.size, 10);
It tries to read the paging using the page query parameter, but jsonAPI returns page[offset] and page[limit]
Due to the way the parameterBag is stored in the Collection it cannot detect changes to the ParameterBag.
The computed properties are called before the created() lifecycle hooks.
Might be an option to switch to the beforeCreate() hook instead of the created() hook. If not the computed property should be able to handle a getter that returns null, now it crashes with a undefined function error.
Immutability issue while applying relationships to data.
Data should be replaced instead of appending to.
resource.data[field] = relationshipGetResource(resource.data[field], includedRelations);
Now it seems impossible to force a reload of the collection. If the state is loaded there is no simple method to reload the data from the server.
I would suggest to add a parameter to the collection load function:
collection.load(refresh=false)
Some api's like django rest framework don't include the resource type in the returned data by default. At this moment it is therefore not possible to create the proper responseNormalizer.
In my opinion the responseNormalizer should return items where the minimum required structure is data and an id.
Incorrectl, should use promise. Callback is not even supported
For:
Hi!
I've made a LoadingIndicator component which should display if the current collection is loading. I'm using collection.isLoading
in an v-if
to check if the loading indicator should show or not:
It looks like isLoading is returning false while it shouldn't when used inside a Vue <template>
, but I could be mistaken.
Tom
When cascaded persisting a resource with a removed one-to-one relation it should delete the dereferenced resource.
Repositories are now created via the repository manager. This should change to Repository.create and should use a default enabled decorator for the manager.
Same goes for HttpConnector, it should have a decorateable create factory method.
The created() method doesn't check if the component is actually using the mixin. This is a problem for when the mixin is added globally
"A “resource identifier object” MAY also include a meta member, whose value is a meta object that contains non-standard meta-information."
example
methods: {
loadResource() {
HyralResourceMixin.methods.loadResource.call(this).catch(() => {
console.log('error');
});
},
},
Create this as a separate package. The package should introduce a helper method that accepts a JSON schema and initializes the relationship and validator decorators on the Resource.
A one-to-one relationship can safely remove the referenced resource when deleting the original resource. It should be a separate function which makes it clear that a cascaded delete will be performed
Should the lazy-loading decorator be enabled by default? It forces you to do more configuration than you might otherwise need. This should only be required when you know you are going to use this behavior.
The Vuex implementation incorrectly alters the state, it should be implemented via a mutation.
Add documentation on contributing
it says run run test:coverage, but should be npm run test:coverage
Resources must be able to have different types on a single relationship as Drupal requires that feature.
Add support to:
Even when doing const connector = HttpConnector(axios.create({ headers: { Accept: 'text/xml', }, responseType: 'text', baseURL: url })
It forces the responseType to json in HttpConnector
The exceptions in the lazy-loader cannot be caught in the application and should therefore not be thrown at that stage.
Refactor into something that makes sense and is either catchable or change the implementation to something informative but not intrusive.
The current documentation leaves some things unclear (on how to register the Mixin / Store module). Expand the documentation to include a clear description on how to fully implement on this.
In nuxt i get a warning "Cannot stringify a function setMetadata". This function seems to come from Hyral.
Seems to be related to the issue described here: nuxt/nuxt#4424
I think the Vue dependency should be a peer-dependency. Check if it can be changed without breaking test-coverage
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.