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

Restangular 2.0: Opinions and Recommendations #890

Open
mgonto opened this issue Sep 29, 2014 · 18 comments
Open

Restangular 2.0: Opinions and Recommendations #890

mgonto opened this issue Sep 29, 2014 · 18 comments

Comments

@mgonto
Copy link
Owner

mgonto commented Sep 29, 2014

Hey Everyone,

Sorry for not answering most of the issues lately, I've been working in creating a new version of Restangular. It'll be Restangular 2.0 and the idea is that it'll be easier to then move it to AngularJS 2.0.

I have an idea of what I want for Restangular 2.0 but wanted to get your feedback (the users feedback) on what APIs you like and which you don't as well as features that you'd like to be included.

Here is the main list I've got so far:

  • Implementing Restangularized objects as Prototypes
  • Implementing Method/Data extension with objects
  • Improving API to work with URLs instead of resources
  • Add request/response interceptors per resource
  • Improve the API for getting an element from the list
  • Add the posibility to inject any service to configurations on RestangularProvider
  • Make Restangular service based options. Make Restangular.service('users') work

As I said, feedback is welcomed. This is the right moment to make an impact in the future of Restangular :).

Thanks!

@jmaynier
Copy link

Great idea to ask for feedback!
First thanks for your good work.

My priority list would be:

  • work with stub objects: sometimes I retrieve a list of basic objects throught restangular, and if needed I want to retrieve the full object (extend the stub object), usually multiple fields containing sub lists of objects, but also single value fields.
  • better handling of related entities: maybe take some ideas from breeze.js. In particular having a single instance of a sub object that can be related to multiple entities is a challenge. Maybe is it outside the scope of Restangular and sounds more like an ORM feature.
  • Improve the API for getting an element from the list

@lucasconstantino
Copy link

Great! I think we should get each of these ideas/priorities and make an issue to discuss them separately, all tagged with a common tag (Think for Restangular 2.0?).

On my priority list, I would put the necessity to divide Restangular into stand-alone services. Say, one for what today is Path, BaseCreator, and others that probably should appear. This does not mean we would have the main Restangular object, but this one would then inject the others.

Also, I would recommend we make better use of Grunt (or even consider moving to Gulp, which I tend to love nowadays) to divide the code into minimal implementation parts. In my opinion, that would dramatically improve contributions.

Cheers! Congratulations for the project and for been so community focused.

@mgonto
Copy link
Owner Author

mgonto commented Oct 1, 2014

Hey guys,

You can see some of the work at https://github.com/mgonto/restangular/tree/2.0-wip

I'll be releasing the docs soon :).

Cheers!

@jmaynier
Copy link

jmaynier commented Oct 1, 2014

+1 to use Gulp, it is far better than Grunt

@lopesc
Copy link

lopesc commented Oct 1, 2014

OData support!

@jmaynier
Copy link

jmaynier commented Oct 2, 2014

OData is very .Net centric, there are few other server side implementations.

@jondthompson
Copy link

Make child objects of an array auto update the item in the parent array.

pseudo code
html
<.tr ng-repeat=item in items>
<.button ui-sref='item(itemId:itemId)'>Edit Item<./button>
<./tr>
js

$stateProvider.state(items, {
resolve:{
items: restangularArray
}
};
$stateProvider.state(item, {
url:':itemId',
resolve: {
    item: items.get(itemId)
}

I _think that's enough to get the gist of what I'm saying. Basically, if I change something in the item state, I would like to see restangular handle updating it in the items array. It doesn't currently, so I have to reload the array in the parent scope to do so manually.

@fzaninotto
Copy link

My #1 request would be to separate the pure HTTP client & resource configuration from the Angular part. Because I can't find any library with such a good API for requesting REST services, but I don't want to be tied to Angular.

The first step would be replacing $http with something independent of Angular.js (how about https://github.com/mzabriskie/axios ?)

@lucasconstantino
Copy link

Nice one, @fzaninotto. This could even lead to a separated project which would be a dependency for Restangular.

@j0hnsmith
Copy link

I'd like to see the restangular properties (eg restangularEtag, reqParams, fromServer etc etc) in a namespace so I can clearly see the properties that come from the api without the restangular stuff getting in the way.

Also all promises/enhanced promises should be fully chainable.

@MarkRBM
Copy link

MarkRBM commented Mar 5, 2015

@jondthompson +1

@fzaninotto
Copy link

Continuing on my previous comment, we've just released the framework agnostic library that builds up on axios, and provides similar features to Restangular, but without angular. It's called marmelab/restful.js. Comments re welcome!

@mmichaelbiz
Copy link

+1 for enabling easy auto updates to view data based on the response of further requests / the data is changed.

E.g. ng-repeat a list of items form a get, perform a (successful) post, remove, put etc request on those items, grab the response and auto update the view with the changes (item added, removed or updated)

Restangular will help bridge the real-time gap for api responses. No more manually pushing or splicing or .then required!

Add in your favorite socket service as well for complete real time goodness :)

@santialbo
Copy link

What is the state of 2.0? It's been almost half a year since the last commit to 2.0-wip. Do you need any help? Is the project abandoned? Is @mgonto MIA after ng-conf?

@sidoruk-sv
Copy link

up, any progress?

@bostrom
Copy link
Collaborator

bostrom commented Jan 13, 2017

@mgonto has more or less abandoned the project, at least for now. A handful of us collaborators try to keep the project afloat by merging PRs and answering issues, but any help is always welcome! See #1319

@bostrom
Copy link
Collaborator

bostrom commented Jan 19, 2017

It seems now that this project will continue to focus only on Angular 1 support, since there's ng2-restangular for Angular 2 support (see #1318).

Since @mgonto is the only one that really knows what the plans were for Restangular 2, and he is not longer mantaining this project, I made a proposal about the future versions of Restangular, implying to abandon the plans for Restangular 2 as we know them (full on rewrite and Angular 2 support) and instead continue the development of the current Restangular code according to semver, i.e. bumping the major version when breaking changes are introduced. This would mean a major version bump every now and then, instead of seeing the major version as a "software generation identifier".

Fixing bugs and introducing features is a brittle affair at the moment, so I'm now trying to decipher the codebase and restructure it to accommodate for more and better unit tests and, hopefully, some major refactoring at some point. With absolute minimum impact on the API. Easier said than done maybe...

@RodolfoSilva
Copy link

Hello guys, I'm rewriting the Restangular to work with Angular 2...

https://github.com/RodolfoSilva/rs-restangular

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests