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

Remove all remaining references to JSTree #664

Closed

Conversation

graygilmore
Copy link
Contributor

This commit continues the cleanup that was accomplished when we moved from JSTree to jQuery UI Sortable in this PR: #569

Closes #194

@Senjai
Copy link
Contributor

Senjai commented Jan 7, 2016

👍 :shipit:

@jhawthorn
Copy link
Contributor

Thank you Gray.

I believe there is also a api/app/views/spree/api/taxons/jstree.rabl file which can be removed.

There was some concern raised last time this was brought up that this is an incompatibility and should be deprecated instead. I feel otherwise and am fairly confident nobody would use these routes. The data format they return is only useful when using jstree (possibly only the really old version we had installed)

@jhawthorn jhawthorn added the changelog:solidus_api Changes to the solidus_api gem label Jan 7, 2016
Now that we're editing our taxonomies with jQuery UI Sortable we no
longer need to have these hanging around. We've actually already
completely removed the JSTree library.
@graygilmore
Copy link
Contributor Author

@jhawthorn thanks, forgot about those. Fixed the commit.

I had considered the incompatibility issue but considering the fact that we've nuked jstree from the project anyways it makes sense that this would need to be a customization for somebody to take on in their own project.

@jhawthorn
Copy link
Contributor

👍

@cbrunsdon
Copy link
Contributor

@jhawthorn I'm generally opposed to this as more people were using it than I expected (from a poke around of people/projects). I would want us to find a way to deprecate it for 1.2 and remove it at a later date.

Is there another way to get the same structure of data out of our public API?

@jhawthorn
Copy link
Contributor

Is there another way to get the same structure of data out of our public API?

No, but it's a trivial transformation.

// /api/taxonomies/1/taxons/1/jstree
[{"data":"Bags","attr":{"id":3,"name":"Bags"},"state":"closed"},{"data":"Mugs","attr":{"id":4,"name":"Mugs"},"state":"closed"},{"data":"Clothing","attr":{"id":5,"name":"Clothing"},"state":"closed"}]

Compared to the proper route

// /api/taxonomies/1/taxons/1
{"id":1,"name":"Categories","pretty_name":"Categories","permalink":"categories","parent_id":null,"taxonomy_id":1,"taxons":[{"id":3,"name":"Bags","pretty_name":"Categories -\u003e Bags","permalink":"categories/bags","parent_id":1,"taxonomy_id":1},{"id":4,"name":"Mugs","pretty_name":"Categories -\u003e Mugs","permalink":"categories/mugs","parent_id":1,"taxonomy_id":1},{"id":5,"name":"Clothing","pretty_name":"Categories -\u003e Clothing","permalink":"categories/clothing","parent_id":1,"taxonomy_id":1}]}

Here's my go at a transform in js

$.map(data.taxons, function(t){
  return {"data": t.name, "attr": {"id": t.id, "name": t.name}, "state": "closed"};
})

get :jstree
end
end
resources :taxons
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎 since API removals are a major change for people. Anyone who has an iOS or Android app using these endpoints are going to get stuck on previous versions of Solidus unless they code their own.

Maybe provide a gem for this so that way we don't leave anyone in the dust and just provide deprecation warnings that it'll be removed in 2.0?

@jhawthorn
Copy link
Contributor

I'm still in favour of removing this as I don't expect anyone to use the jstree specific route of the api, but discussion seems to have stalled.

Closing this issue for now.

@jhawthorn jhawthorn closed this Feb 26, 2016
kennyadsl added a commit to nebulab/solidus that referenced this pull request Oct 4, 2017
We are not using JSTree anymore (solidusio#569) but we still have these
routes available for stores that used it outside JSTree scopes.

We decided to deprecate these routes long time ago but we never did it.
See also #194.

Once we've deprecated this enough we can probably just resurrect solidusio#664.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_api Changes to the solidus_api gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants