Because of the issues, I’ve had with code in my browser not matching what is on the server I want to understand how this work.
I’m paranoid about pushing code because I’m worried I’ll overwrite something that is working.
On the frontend, when changes are made to logic, it seems like those are made on the server because the code can be previewed at that moment. When the code is published, does that get moved from a staging environment to a production environment?
On the backend, is codeless cloud code stored in the browser until it is deployed? When I get prompted to clear the browser (not the right term, can’t remember at this moment), is that deleting code from my browser cache?
When you deploy anything in Cloud Code, you’re deploying the entire deployment model.
Deployment makes all the changes active - they are put into actual production use.
If you open different browser tabs or different browsers and made changes to any element of the same deployment model, the last browser to deploy wins. Whatever logic it had is put into production use.
UI Builder:
Changes in UI and Logic are automatically saved on the server.
Working on the same page or logic in different browser tabs or browsers will cause problems.
Deploying a UI container compresses logic and copies all the files into the designated directory.
Everything in codeless is stored on the server. When you modified some logic, those changes occur in your browser first and then get deployed to the server. This is when files are highlighted in green.
When you have some logic open in a browser for editing and the same logic is changed and deployed by someone else on your team or you (perhaps in a different browser/computer), the logic that you have open now becomes outdated and in that case, Backendless tells you that the version of the logic on the server has changes. These files are highlighted in orange.
In both cases, the code on the server does not match what is in the browser. How does Backendless differentiate between changed code and out dated code in the browser? Also, how I clear out what is in the browser so the server code is fetched to start an edit?
When you make a change in your Codeless logic in Backendless console. That change is stored locally in the browser’s local storage until you click the DEPLOY MODEL button. The changes you make are timestamped, so Backendless Console knows when you made changes. Suppose you made some changes and closed the browser. Then sometime later you return to it. At that point, we know you have local changes on the browser side and we also check if the same logic (the one that was modified locally) had been modified on the server (modified since the time marked in the local changes). If the server says the logic on the server had been modified, we render it in the orange color.