Hello everyone,

I have one question related to Outsystems 10.

For now, my Tabs includes other Tabs which are created dynamically and where I actually put one same Web Block in all of them.

My Web Block has some JS code on it

My question is, when by instantiating same Web Block in those Tabs, Outsystems duplicates same JS code as many times as there are the same web blocks?

Thanks in advance. 

Depends on how you're using JS in your web block. If you are using the JS property of the web block for the JavaScript, it should only produce one instance of the JS, which will be a file under the "Blocks" folder (may be under a subfolder if the web block is in a producer module).

If the JavaScript is in an expression in the body of the web block, it will be produced multiple times, once for each instance.

G. Andrew Duthie wrote:

Depends on how you're using JS in your web block. If you are using the JS property of the web block for the JavaScript, it should only produce one instance of the JS, which will be a file under the "Blocks" folder (may be under a subfolder if the web block is in a producer module).

If the JavaScript is in an expression in the body of the web block, it will be produced multiple times, once for each instance.

Thanks Andrew, actually that makes sense.

Well I'm having a little performance trouble with my scenario. When I launch the Screen on the browser, it takes around 5-8secs for my Tab to react to tabs changes. I thought it was originally for duplicated code on web blocks, but it seems there's something else.

Thanks. 


Elias Bellido wrote:

Well I'm having a little performance trouble with my scenario. When I launch the Screen on the browser, it takes around 5-8secs for my Tab to react to tabs changes. I thought it was originally for duplicated code on web blocks, but it seems there's something else.

Open the browser dev tools (F12), switch to the Network tab, and reload the page. Switch tabs, and check the browser tools window to see what is consuming the most bandwidth/time.