Super laggy

  • achivas-1343271457400160267

    A-Chivas

    20 days ago

    this is the form one
  • max.kayr-1343271533115609188

    Max

    20 days ago

    You should create components to structure your code. Currently, you have a lot of elements rendering at the same time on your page. You need to refactor that to keep it performant.
  • Same here. If you have that many API calls in one place, you likely need to split them up
  • achivas-1343271757506941050

    A-Chivas

    20 days ago

    I need to split the APIs how?
  • that page needs a lot of functions
  • max.kayr-1343272036113448961

    Max

    20 days ago

    You can split the logic in multiple components and have only very few calls in each component
  • achivas-1343272179260854363

    A-Chivas

    20 days ago

    and make the api calls inside the components you mean?
  • Tod-1343272180586381323

    Tod

    20 days ago

    Great energy @A-Chivas! Your continuous contribution to the toddle Community just made you advance to Community Level 10!
  • max.kayr-1343273315292282974

    Max

    20 days ago

    Yes
  • achivas-1343273483957833812

    A-Chivas

    20 days ago

    even if they are making the same api call?
  • max.kayr-1343273511283855470

    Max

    20 days ago

    Hard to say without looking at your project, but it does not seem structured. And this will slow the editor and the app down
  • achivas-1343273519261286431

    A-Chivas

    20 days ago

    are you saying that is better?
  • max.kayr-1343273600274268262

    Max

    20 days ago

    Structured is better 😊
  • achivas-1343275285415723019

    A-Chivas

    20 days ago

    ok, it works fine on the frontend though
  • also this issue, my client faced on the frontend
    1343275337085227008-image.png
  • my AWS server doesnt use cloudflare
  • max.kayr-1343276284721233950

    Max

    20 days ago

    Seems like you are calling too many APIs during rendering
  • achivas-1343276656147562609

    A-Chivas

    20 days ago

    how many is too many?
  • lucasg-1343277053365190658

    Lucas G

    20 days ago

    There are a lot of questions here that we cannot answer since we dont' have access to the project
  • Hopefully the toddle team can help you out a bit but if the project is like the form component you linked earlier, then it is as Max says and the project is likely in need of a good refactoring
  • achivas-1343277772495126548

    A-Chivas

    20 days ago

    is it better to handle all the logic aspects of the things on the backend if possible, so that there is less load on the editor?
  • lucasg-1343277810529210511

    Lucas G

    20 days ago

    It's not just for the frontend since the frontend renders the same whether it is in a component or not, but for code maintainability and performance in the editor then you'll need to refactor things
  • Not necessarily
  • achivas-1343277999973339206

    A-Chivas

    20 days ago

    I understand
  • lucasg-1343278222942535750

    Lucas G

    20 days ago

    There isn't a hard rule for where to handle logic. Sometimes it's fine on client-side other times it's better to handle it on a backend
  • A lot of mostly comes down to the amount of data you are handling
  • achivas-1343278775520989185

    A-Chivas

    20 days ago

    but what about this though, this happened on the frontend, not on the editor
  • lucasg-1343279090421076099

    Lucas G

    20 days ago

    Something during the SSR process stalled the worker caused it to timeout basically
  • achivas-1343279567774683147

    A-Chivas

    20 days ago

    thats on toddle side right?
  • lucasg-1343279617804472473

    Lucas G

    20 days ago

    If you're making the same call in multiple places, then you can move it up the DOM and share it to children components via contexts
  • achivas-1343279745374359552

    A-Chivas

    20 days ago

    I am not reusing any call though
  • mybad I am
  • lucasg-1343279856691056703

    Lucas G

    20 days ago

    I mean once you split things out to separate components
  • You can make use of the same data in different places via contexts instead of making the same call multiple times
  • As for the error, we can't say what caused it. Does it happen often?
  • achivas-1343280232916062218

    A-Chivas

    20 days ago

    nah, happened once
  • lucasg-1343280353808482327

    Lucas G

    20 days ago

    Does this page take a while to load?
  • lucasg-1343280625414832241

    Lucas G

    20 days ago

    It should be hard to exceed worker limits with just page rendering unless there is a lot going on during SSR. Maybe waiting on AIs or image transformations, etc.
  • But yeah, can't say what caused that one sorry
  • sanedealer-1343281283488419873

    Edwin Paul

    20 days ago

    Does worker limit mean CPU or memory?
  • lucasg-1343281320331055154

    Lucas G

    20 days ago

    Yes
  • achivas-1343282687472832593

    A-Chivas

    20 days ago

    so I hit the toddle server limit somehow
  • ?
  • lucasg-1343283403059105822

    Lucas G

    20 days ago

    Maybe. Could also have been a random Cloudflare issue. Again, hard to say.
  • achivas-1343283565818810460

    A-Chivas

    20 days ago

    just asking, I understand I might have not built the thing with best practices here, would have be better if I had a heads up to this
  • the people I have been learning toddle from told that I dont need to use components so much
  • lucasg-1343283812695806034

    Lucas G

    20 days ago

    The use of components has always been very highly advocated for here. It’s not exactly new.
  • achivas-1343284078119747675

    A-Chivas

    20 days ago

    I understand, but didnt know it would create performance issues inside the editor
  • wouldve done the same thing
  • lucasg-1343284133417189376

    Lucas G

    20 days ago

    I don’t know who would say that but in my opinion it’s clear that toddle was built with components in mind (similar to most modern frameworks)
  • lucasg-1343284551975436360

    Lucas G

    20 days ago

    toddle team members have said in the past that a good rule of thumb is if you can scroll the element tree then that is a good sign to use components
  • achivas-1343284873606987776

    A-Chivas

    20 days ago

    ok got it
  • also to put the APIs inside the components?
  • andreasmoller-1343285267687014502

    Andreas Møller

    20 days ago

    I am happy to take a look and give you some suggestions
  • lucasg-1343285340307193866

    Lucas G

    20 days ago

    You can if only that component needs it. Otherwise you can put it on a parent and share the API via contexts/attributes
  • achivas-1343285467688472738

    A-Chivas

    20 days ago

    pls mate
  • andreasmoller-1343285486277496982

    Andreas Møller

    20 days ago

    There are almost never simple rules for these things.
  • achivas-1343285494330429492

    A-Chivas

    20 days ago

    mainly the info project
  • achivas-1343285532003664023

    A-Chivas

    20 days ago

    for sure
  • achivas-1343286388950438010

    A-Chivas

    20 days ago

    I turned off all the auto fetch to avoid load times in the editor for now
  • achivas-1343287178121183355

    A-Chivas

    20 days ago

    parent component? and share api data, I have no clue how to execute this...
  • achivas-1343289250908606526

    A-Chivas

    20 days ago

    also the lag issue would go away if we increase our ram and cpu wont it?
  • lucasg-1343289331543965840

    Lucas G

    20 days ago

    It can be a parent component or page. Data can be shared via contexts or attributes.
  • lucasg-1343289503124553839

    Lucas G

    20 days ago

    Technically it could to a certain extent but that’s not a good way to handle it
  • achivas-1343289538675474615

    A-Chivas

    20 days ago

    I am using an intel i7, maybe m4 resolves this..
  • achivas-1343289643495591977

    A-Chivas

    20 days ago

    hmm, ok
  • lucasg-1343289660109230121

    Lucas G

    20 days ago

    That would be a cover to the bigger underlying issue of unoptimized structure
  • achivas-1343289725791764661

    A-Chivas

    20 days ago

    got it
  • lucasg-1343290013147861002

    Lucas G

    20 days ago

    You wouldn’t want to need 128GB of RAM just to be able to work on your project. Not like it would matter at that point but you get it
  • achivas-1343294459856818270

    A-Chivas

    20 days ago

    but would i work flawlessly, technically it should right
  • the new AMD AI processors be crasy
  • andreasmoller-1343294838438887456

    Andreas Møller

    20 days ago

    @svenning Can run build toddle in toddle on a raspberry py. (Though it’s not entirely smooth)
  • lucasg-1343295330686468097

    Lucas G

    20 days ago

    Maybe. But some things aren’t fixed by just throwing more ram at them
  • achivas-1343295527869218977

    A-Chivas

    20 days ago

    I dont believe that, lol
  • gotta see to believe that one
  • lucasg-1343295655224934430

    Lucas G

    20 days ago

    The toddle runtime is very light
  • achivas-1343295763077271602

    A-Chivas

    20 days ago

    because the load increases my fans start roaring
  • lucasg-1343295794803113994

    Lucas G

    20 days ago

    It would fit in the cache on my processor 😂
  • achivas-1343296096306462881

    A-Chivas

    20 days ago

    did you just say the cache on your processor is better than my entire processor, jesus
  • lucasg-1343296182696411179

    Lucas G

    20 days ago

    Fit**
  • achivas-1343296210391400468

    A-Chivas

    20 days ago

    lol ok
  • lucasg-1343296550859968653

    Lucas G

    20 days ago

    I use toddle on an M1 Pro 32GB RAM laptop and on a beefy Windows custom build I did for fun. Needless to say, they both run it without zero issues
  • And my app is getting to have a pretty nice amount of components in it
  • Even the main SPA runs fine
  • Disregarding the desktop, all laptops I've used it on run it without issues
  • achivas-1343296892305408010

    A-Chivas

    20 days ago

    I just hit that again
    1343296891995033620-image.png
  • just on load
  • it doesnt load my page at all now
  • achivas-1343297411766026251

    A-Chivas

    20 days ago

    sorry to bother you'll on a Sunday evening tbh
  • andreasmoller-1343297759582883970

    Andreas Møller

    20 days ago

    The work you computer need to do is more about the complexity of the component than toddle it self
  • For very large components it needs to do a lot of work
  • achivas-1343297911638851626

    A-Chivas

    20 days ago

    ok got it, hence the load
  • achivas-1343297960183595059

    A-Chivas

    20 days ago

    but this is the frontend
  • andreasmoller-1343298001631969461

    Andreas Møller

    20 days ago

    So the specific project / component matters much more than the computer in this case
  • andreasmoller-1343298207035428864

    Andreas Møller

    20 days ago

    This makes me think that the component has some very heavy workflows or potentially an infinite loops somewhere. I have time in half an hour then I’ll take a look
  • achivas-1343298279953141790

    A-Chivas

    20 days ago

    ok cool
  • achivas-1343298542126628887

    A-Chivas

    20 days ago

    I think it could be a rich text editor
  • oh yes
  • greg.irl-1347595131414515863

    Greg IRE

    8 days ago

    I'm not aware of the best practices and approaches mentioned here, is there a video or a resource somewhere that demonstrates these so i don't make these mistakes?
  • achivas-1347839751520256001

    A-Chivas

    7 days ago

    just use more components on complex stuff like image gallery popup etc and yuo should be good, designing everything on the page level can be a problem

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.