What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi everybody, since there are often questions in our teams when it comes to asynchronous calls from
Hi everybody,
since there are often questions in our teams when it comes to asynchronous calls from yves frontend to the zed backend (using ajax etc.) … “glue” is meant almost everytime and i am a bit unsure now^^
Does it make sense to involve the glue API here when we use yves general but want to make some of the parts of the page async loaded? For my understanding, when we use yves anyway it would make sense to stick to a controller in yves to render json for the frontend. Just to be sure: are there any cases/experiences when it make sense to involve the glue API? For my understanding not really, since glue is at the same level as yves on architecture, it should not be “mightier” than the yves framework, or am i completely wrong? In case of a product detail page for example i would render just json with the data that is required in the frontend instead of the whole html … on the other side, glue does have a “standardized” request/response flow which i can imagine would be easier to implement … any experiences here?
Best regards
Comments
-
for what I know, glue is more for separate apps (eg mogile app, or single page application frontend). If you are using yves and doing just "API" calls for the "yves part" json, then they should be still in the yves
0 -
I think i asked similar question some time ago and one of the Spryker architects responded with similar answer
0 -
yeah, thats the question … i mean i could also do a SPA completely rendered in yves … so just some kind of index controller would provide the SPA and the data is fetched via other controllers …
I was just wondering if glue is in some way more advanced than yves since it already provides data in the way, some external app would prefer it … while in yves we have to do a lot more than in glue. But as i said, in the moment i don’t see any advantages0 -
thanks a lot for your answer 😉
0 -
if you use Yves already as a frontend - then use it for ajax queries as well. Glue - is a separate Application to be taken care of. From infrastructure and maintenance perspective that’s a bit of an overkill for your case IMO
0 -
Yes okay, so my feelings were still right, but just wanted to proof it. Thanks for your answers 🙂 Have a nice day!
0 -
@UKJSE6T47 To be concrete: We would like to have a controller for the product detail page that returns the product once as HTML and once as JSON. Do you have any ideas on how we can best implement this?
We currently see three possibilities:
1: Logic in the ProductDetailController that returns either HTML or JSON based on the "Accept" header. (Simple if-block)
2: A stand-alone parameterised controller that accesses the Redis and than doing the same stuff like the ProductDetailControllers.
3: An additional URL for each product, with a matching ResourceCreatorPlugin and a controller that returns just JSON.Do you see another possibility?
0 -
could be also
4: another action of the ProductDetailController that would return you the json..
Any option would do, I’m not sure I understood the 3rd one, but I think it’s enough to have 1, 2 or 40 -
As far as i see the corresponding ProductDetailPageResourceCreatorPlugin does only allow one action … or how to add another action for the same controller using the ressourcreatorplugin? 🤔
0 -
ah, sorry, I meant the
ProductController
. We used the approach I mentioned above in an older version of Spryker, maybe that won’t work through ProductDetailPageResourceCreatorPlugin.0 -
Thank you for your Feedback, @UKJSE6T47
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random