My editor is lagging really bad, i can barely do anything.

  • Iconic

    8 days ago

    Been out of nordcraft for a while came back to build a new project and for some reason the editor is lagging, its so bad ihad to rework my whole api systemand its still lagging. what could be the issue?
  • salma

    8 days ago

    do you have any issues in the issues panel?
  • Erik Beuschau

    8 days ago

    It could be a number of things really:
    - The size of your project
    - The number of elements in the component/page you have opened
    - Slow custom actions that perform unnecessary work
    - Large (1MB+) test values for attributes
    - Big API responses
  • Iconic

    8 days ago

    nope
  • Iconic

    8 days ago

    its just one page i started with,
  • Erik Beuschau

    8 days ago

    Sounds strange. Could you share a url to your project? DMs are open
  • Iconic

    8 days ago

    yeah i noticed a larger response crashed the editor, but then what's the way around that.
  • Erik Beuschau

    8 days ago

    Large API responses don't necessarily crash the editor. But if you're doing heavy processing of the response (filtering, modifying it etc.) the runtime might start to struggle.
  • Iconic

    8 days ago

    i wasnt even doing anything. It crashed it
  • Iconic

    8 days ago

    i had to rebuild the whole api setup i had and still it lags but doesn't crash anymore, but when im pulling a large data it does
  • Erik Beuschau

    8 days ago

    Which API call do you believe makes it slow?
  • Iconic

    8 days ago

    the main one getting a product and its prices and they're all text data that im then storing in a variable
  • also worried about moving these functions to the backend because constant api calls cause lags
  • Erik Beuschau

    8 days ago

    From the URL you provided, the API responses don't look very big.
    Generally, it's rarely necessary/beneficial to store API responses in variables. Instead, it's usually better to access the data directly from the API response. That way, the UI will also update if the API call is re-fetched later.
    When I open the editor on your start branch I don't experience any lag. Not sure if any logic on the page would work differently for you than others? (perhaps if you're using some sort of authentication)
  • Iconic

    8 days ago

    thats because i switched to a really small, product.
  • Tod

    8 days ago

    Great job @Iconic! Your contribution to the Nordcraft Community just made you advance to Community Level 2! 🌲
  • Iconic

    8 days ago

    if i switch to a larger product now it would lag
  • theres a variable called current_product_id switch it to 9 and the lags starts
  • Erik Beuschau

    8 days ago

    I'll check
  • Erik Beuschau

    8 days ago

    It still doesn't lag on my end 🤔 Could you perhaps create a screen recording of the issue you experience?
    A few things I would try:
    - Remove the unused variables (see the issues panel on the left)
    - Stop saving API data in variables and reference the API data directly
    - Don't start your API calls in the onLoad workflow - instead, just set the API requests to auto fetch
  • Iconic

    8 days ago

    sorry i meant 6
  • Iconic

    8 days ago

    auto fetch made it way worse. it crashed constant ly
  • Erik Beuschau

    8 days ago

    Ah, now I see it 👍
  • Iconic

    8 days ago

    i use those variables to segment data properly so i can display and calculate it
  • Iconic

    8 days ago

    as i changed it now its crashed on my end
  • Erik Beuschau

    8 days ago

    Right. But I believe you could achieve the same using formulas that work with the dynamic data from your API responses.
    Your product_variant_attribute_data API returns a response of 789,142 lines (for current_product_id=6). That seems like a lot of data 🤔 It might be useful if you could filter some of the data on the server.
  • Iconic

    8 days ago

    but regardless when i run a smaller data like the one with the smaller id it still lags
  • Erik Beuschau

    8 days ago

    Which id is that? Just so I can try on my end?
  • Iconic

    8 days ago

    the 9
  • Erik Beuschau

    8 days ago

    I'll check if I can find the root cause for this and get back to you
  • Jacob Kofoed

    8 days ago

    I am currently having a look at this. I think we can optimise things quite a bit from our side, but I would still follow all of @Erik Beuschau's suggestions as keeping things small will help a lot.
  • Iconic

    8 days ago

    worse issue, acceepeted an ai logic thati thought was going to improve an api call, instead it deleted elements and api and a whole other functions and the editor crashed , reloaded and now i can undo the changes
  • Jacob Kofoed

    8 days ago

    Sounds really bad. The AI is still receiving updates daily, so issues are expected for a little while. However, in your version history sidebar there’s a new feature to go back to a previous commit. You can use it to go back to where you were on your branch.
  • Jacob Kofoed

    7 days ago

    I released some changes that should make things run a lot better. There are still some more we can do to improve editor-performance, but as always keeping components small will always make things faster.
    👍1

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.