Closed sanketshevkar closed 2 weeks ago
I found this. And looked around, looks like this is a standard approach. What is happening here?
Questions to be investigated here:
cc: @Vinyl-Davyl @mttrbrts @dselman
If we are going to use query parameters for state sharing, does saving the data in local storage still makes sense? The state in local storage is usually mapped to the URL. If we are storing the state in the URL itself. Should we even worry about storing it locally? https://github.com/accordproject/template-playground/issues/47
@mttrbrts had started discussion around if we would like to support uploading template-archive templates to load that template in the playground. In my view it'll be good if we keep this out of the scope for milestone 2. If we have time after milestone 3. This is something we should be looking into.
But we should start the discussion here, as the solution we build in this milestone should be extensible when we decide to develop the feature to upload and download a template.
I was wondering if could add the compression and base-64 encoding logic to template-archive itself and use it in playground? Something like getHash.
This looks like a great place to start, @sanketshevkar
I'm interested to know how far this can take us. For example, what is the expected upper bound on the maximum size of the template that can be expressed in this format?
Hey guys, having done some work and taking inspiration from TS playground on the use and Implementation with LZ-String. I believe our threshold is 2mb max size, which I think is okay for us.
Would share some more details soon.
Hey Guys,
After exploring the TS playground and implementing similar functionality in our project using LZ-String, I wanted to share our approach and findings regarding the state sharing and template size considerations and from what I've been building:
Threshold: Our current threshold for URL-shared state is around 2MB. Larger files, such as 3.6MB, do not consistently work across all browsers, especially Chrome.
Clarifications can be made in these created project with different share size:
2mb file to be tried in TS Playground and shared cross diff browsers(works across all browsers): large_text_file_2mb.txt
3.64mb file to be tried in TS Playground and shared cross diff browsers: large_text_file_2mb_5mb.txt
7.28mb file to be tried in TS Playground and shared cross diff browsers: large_text_file_5mb_10mb.txt
Size Impact: Base64 encoding increases the size of the data compared to the raw compressed string but remains smaller than the stringified object itself.
Based on these findings and implementation inspired by TS playground utilizing the compression library LZ-String, our approach supports efficient state sharing via URL while considering browser compatibility and file size constraints. This sets a strong foundation for future enhancements, such as template-archive integration and additional features post-Milestone 3.
Hence, Work has commenced on this.
Would love to discuss further and iterations on these insights to ensure our approach aligns with project goals and future scalability.
cc: @sanketshevkar @mttrbrts @dselman
Feature Request 🛍️
Use Case
Possible Solution
Context
Detailed Description