Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import code length #103

Open
glibshaft opened this issue Jun 27, 2023 · 4 comments
Open

Import code length #103

glibshaft opened this issue Jun 27, 2023 · 4 comments

Comments

@glibshaft
Copy link

Hi, great piece of kit, this, but I have question. Is there a maximum length of code to import a partially built UI back into the web app? I have been using this for a while but it is now erroring in Chrome and gives an 'Error 5' message. thanks in advance.

@joonaspaakko
Copy link
Owner

joonaspaakko commented Jun 27, 2023

There could be some kind of limit in the browser itself, but there are no limits set by the app. That error code looks ominous...

I'll take a look at this over the weekend if necessary... Before that, could you confirm that what you are trying to import is just the import json, that is the commented line at the top of the exported script with the description that says something like "Import json, triple click to select".

The import modal only accepts valid json as the input, so it can't have any Javascript or any other extra characters around it that would invalidate it.

If it is valid json... it would help me if you sent me the import code for testing. My email is in my Github profile. You can post it here too, if you don't care it being publicly viewable.

@joonaspaakko
Copy link
Owner

joonaspaakko commented Jun 28, 2023

Since I'm fairly sure invalid import data shouldn't cause errors, I did a test where I made a large ~170k character import json, which also amounted to 3224 rows of javascript. It loaded in incredibly slowly in like 3 minutes and I had to tell Chrome to wait maybe 7 times, rather than have it kill the page, but it did open eventually without errors.

I should say that this slow load time isn’t caused by the import itself, but rather just rendering the dialog structure, so when you load a snapshot, or refresh, or reopen the page with the huge dialog loading from memory, it’s going to do it with the same amount of sluggishness.

There could possibly be certain combination of elements or perhaps a specific nested structure of specific elements that cause more issues than what I experienced. I just took the sample dialog and duplicated groups a bunch of times.

When I was reading your post, I was thinking maybe it could be related to a memory leak and running out of memory… But who knows. Looking into Chrome error 5 didn’t really amount to much, since at least what I was able to find with a quick search is that this is one of those “could be caused by like 5 different things that are all kind of vague”.

In general the app does have performance issues with large dialogs, much more than it should, if it was built better, I won’t deny that.

@glibshaft
Copy link
Author

Hi, sorry, it's been a while since I checked back in here. The code I was trying to pull back in was just the required json data, as specified by the 'Code for Import https://scriptui.joonas.me — (Triple click to select):' section. It was 386183 characters (it is a sizeable UI now).

I have got around the issue by breaking each of the tabs I use, down to a separate UI for each one to load back in and edit, once amended, I export it and build it all back up again into one large UI. Not ideal but more than happy to do it this way to continue using this great tool.

Happy to share the code with you too, if you still want to see it?

Just for clarity this is running on Chrome Version 115.0.5790.114 and on a 2022 Studio Mac Apple M1 Max, 32gb RAM running Monterey 12.6.1.

@joonaspaakko
Copy link
Owner

@glibshaft, yea, send me the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants