Trying to run @plone/client locally (but not able to)

I am trying to improve my proposal of Modernize Data Fetching API. I need to run @plone/client locally on my windows machine. But since this library talks directly with plone.restapi, I have to run the server on my machine locally as well. Now, I have run the server on on my machine locally before in the docker-compose file which shipped to me with the Plone's volto front-end.

But it gives me the following error,


Now, I know why this is for. This is because mismatch of URLs. Have a look:
The url in the code of @plone/client is:

getbackendurl-vscode

But the plone server is on different url. Have a look:

On server it is http://localhost:8080/plone.
Let's correct this.

Screenshot 2023-03-30 223759

Now, let's try and run it again...
The result is:

Screenshot 2023-03-30 224220

Interesting, now it is able to communicate with the server...that should solve the problem...Not exactly! Let me explain.

Even though one test passed, there are still 2 failed tests...and It is not like those test were not able to communicate with server. They did got some response. They recieved a string "Welcome to Volto!" but the expeced was "Welcome to Plone 6!". I did some of my research of my own and found out something.

In the @plone/client's library I found a Makefile which can be used to install and run backend on local machine very easily (Spoiler alert: My big brain was not able to run that file on my computer). Anyways, I found out that the Backend's version in Makefile and volto's docker-compose file differ somewhat:

docker-compose:

Screenshot 2023-03-30 230422

Makefile:

Screenshot 2023-03-30 230550

Could this be an issue? Please let me know. I am not done yet, There is one more issue.

The thing is how do I run Makefile. I have installed mingw-get and from this tool installed mingw32-make and now I am trying to run this command:

Screenshot 2023-03-30 231250

This is the issue I have from 2 days now, I have tried to explain this to community but failed to (Because of my great communication skills, but now I tried to calm down and thought of what I was facing and how can I communicate about it). I would love to have some help here @sneridagh or any other member from community who knows how to deal with it.

There is already a make script to run the testing backend server in @plone/client.
Just run:

sudo make start-test-acceptance-server

this will run your testing server with required addons on port 55001

Thanks for this, I was missing the argument after make.

1 Like

Hi Danish, @plone/client is mostly a proof of concept, but as you could see, there is already some CI set up and working (green) for the current code.

As Yuvraj pointed out, the tests need an special acceptance test backend server, which is setup via the command he attached.

The logic for deciding the backend URL is still a work in progress, and would be one of the fist things to make it work. So it can work well in all possible scenarios. Look at the commented out code, which tried to take into account all use cases: Volto as an add-on, outside Volto as a library, and in testing/CI environment.

Regarding developing in Windows, Volto does NOT support it, even on WSL, since nobody is maintaining it. So my recommendation here is that you get Windows out of the equation while developing Volto, since you will be on your own if you find any problem with your environment.

Thanks for all the efforts, I hope I'd be of help.

1 Like

Hi @sneridagh, I have followed what Yuvraj has said and now it is working on my machine. But I completely agree on what you have to say about Windows development and If I were to get selected for this proposal First thing I will do is remove windows and install ubuntu (Installing will only take a day or so) as I am very familiar with ubuntu and use it regularly on VM.

I have made a PR on the PoC, I know this is not relevant but I just want a Yes/No on weather I have done things correctly. I would really appreciate if you have a look and share your thoughts with me.

At last, I am eager to work on this project so that's why I am constantly improving my proposal. Now, I am researching about new things and one of this is the word Pluggable, as one of the core part of the proposal it is important to understand properly about it. I would love to have a proper straight forward definition of this word "Pluggable".

Thank you and the other community for helping me in this journey.

Hi Danish, I'd rather not accept any PR in the PoC before the project start. It won't be fair, and not considerate by your other fellow GSOC candidates, don't you think?

I'd rather work in improving the proposal and make it outstanding, as this year's tentative mentors have already stated multiple times.

You can add your amendments or improvement ideas of the current state of the PoC in the proposal.

Cheers,
V.

Regarding the "Plugability": This project is all about it.

The vision about the purpose of this client library is the ability to be used by any JS framework providing the ability to query a Plone site via it's RESTAPI. So you "plug" it, and use it right away, no other ceremonies needed.

I got what you said crystal clear sir! Just now I have closed the PR and will make as an example in proposal.

Ok I knew what it meant already a little bit but wanted to clear my doubts regarding this from the idea's proposer itself. And, one thing more... in the original PILP of the project we are talking about, at deliverables section... there is one thing mentioned that the contributor to this project has to release list of all the components that will be affected. Just to make sure we only have to release it list and other part like working on upgrading those components will be taken care by the community itself. Am I right on this statement? One thing is certain that I will write a storybook that will include examples on how to upgrade them.

1 Like

The project consists in both create @plone/client and integrate it into Volto.

So the resultant list of components updated should be part of the deliverables, but the work on them is part of the project.

I just checked and the deliverables section does not word it in the best way, I will take care of amend it.

2 Likes

I also had some misconceptions about the "list of updated components" in the deliverables, but this cleared my doubt. Thank you.

Okay...so, there is lot of work left with my proposal. Thank you for your support. I might aswell add this to my proposal.

Hi @sneridagh, As you might know we are running out of time for submittion of the proposals, and being the one who has a lot to say about the project I have left a lot to write in these 2 3 days. I would really appreciate if you could explain to me a little bit more about the PILP #4352 and a little bit about how you think It should be implimented after @plone/client is ready.

One thing more, If we are assigned to create @plone/componets which will have all the components ready for the use in any framework like NextJS, Remix, Gatsby, etc... (as mentioned in PILP of Modrenize api project) then what will be the motive of the contributor working on " Refactor class components to functional components". I have tried to read both #4460 and #4352 and I am kind of confused weather @plone/components will be used or the components folder in the volto project will be used for storing components code.

Best,
Danish