Help understanding where code lives before it is published or deployed

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?

Thanks,
Tim

Are we talking about Cloud Code or UI Builder?

Is UI Builder the frontend and Cloud Code the backend? If that is true, then I’m asking about both.

Tim

Cloud Code runs on the server side and means the following:

  • API Services
  • Event Handlers
  • Timers

For both Cloud and Ui Builder:

  1. All code lives on the server
  2. Browser maintains local (browser-side) change log history.
  3. Change log is stored in the browser’s Local Storage.
  4. When local storage gets full, Backendless Console prompts you to clear local storage.

Cloud Code:

  1. Changes in Codeless are not automatically saved on the server - they are kept on the browser side.
  2. You can see all modified API service methods, timers, event handlers, and functions in the tree indicated in a different color with an asterisk:
  3. When you deploy anything in Cloud Code, you’re deploying the entire deployment model.
  4. Deployment makes all the changes active - they are put into actual production use.
  5. 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:

  1. Changes in UI and Logic are automatically saved on the server.
  2. Working on the same page or logic in different browser tabs or browsers will cause problems.
  3. Deploying a UI container compresses logic and copies all the files into the designated directory.

Thanks again, @mark-piller.

Since you posted this, I think you’ve made an update. I now see green and orange API methods -

image

When deploying, there is a new message -

image

What does “This method has changes on the server” mean?

Thanks,
Tim

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.

Hope this helps.

Mark

This is very helpful, thank you @mark-piller.

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?

Thanks,
Tim

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.

Mark