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 Elastic DSL / bodybuilder from frontend #2167

Closed
pkarw opened this issue Jan 11, 2019 · 5 comments
Closed

Remove Elastic DSL / bodybuilder from frontend #2167

pkarw opened this issue Jan 11, 2019 · 5 comments
Assignees
Labels
5: Complex feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can vs-hackathon Tasks for the Hackathon
Milestone

Comments

@pkarw
Copy link
Collaborator

pkarw commented Jan 11, 2019

What is the motivation for adding/enhancing this feature?

This is related to #2166
bodybuilder is about 200KB - and in fact the Elastic query DSL could be constructed 100% in the vue-storefront-api

In that case the catalog.js endpoint no longer will be raw proxy but it will do the logic which is currently done on frontend.

So, the thing is that vue-storefront-api should get the simple query object and build DSL itself. It will also make vue-storefront-api ... in fact simpler. Because being partially a proxy to Elastic and partially a REST API isn't easy to understand.

What are the acceptance criteria

  • bodybuilder removed from vue-storefront dependencies
  • we should have this as an config option - as some other implementations can base even directly on bodybuilder we should have an option in both: vue-storefront and vue-storefront-api configs to switch this new mode on/off (default is: on)

@patzick and @mdanilowicz let me know what do You think on that?

@pkarw pkarw added feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can vs-hackathon Tasks for the Hackathon labels Jan 11, 2019
@pkarw pkarw changed the title Remove Elastic DSL / bodybuilder from frontend RFC: Remove Elastic DSL / bodybuilder from frontend Jan 11, 2019
@patzick patzick added the RFC Request for comments label Feb 17, 2019
@patzick
Copy link
Collaborator

patzick commented May 13, 2019

I would consider Elasticsearch JS library for that as replacement for bodybuilder.
https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/introduction.html

@pkarw
Copy link
Collaborator Author

pkarw commented May 13, 2019

We removed elasticsearch-js as a bundle size optimization - it's not a way to go for sure.

@pkarw
Copy link
Collaborator Author

pkarw commented Aug 13, 2019

Its all about sending the SearchQuery object in plain json to /api/catalog and then construct elasticsearch query in API instead of constructing it in the client.

The SearchAdapter and ElasticsearchQuery classes should be refactored simplified
It should be kept as an option to have the current behavior (building queries in client) for backward compatibility but it should be disabled by default

@pkarw
Copy link
Collaborator Author

pkarw commented Aug 13, 2019

@andrzejewsky can you please take care of this one after finishing the tasks from 1.11 please?

@pkarw pkarw added 5: Complex and removed RFC Request for comments labels Aug 13, 2019
@pkarw pkarw added this to the 2.0-rc milestone Aug 13, 2019
@pkarw pkarw changed the title RFC: Remove Elastic DSL / bodybuilder from frontend Remove Elastic DSL / bodybuilder from frontend Aug 13, 2019
@pkarw pkarw assigned andrzejewsky and unassigned mdanilowicz Aug 20, 2019
@andrzejewsky
Copy link
Contributor

@pkarw yeah, sure 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5: Complex feature request Requests for new features. Please be as specific as possible and provide proposal API if it you can vs-hackathon Tasks for the Hackathon
Projects
None yet
Development

No branches or pull requests

4 participants