Giter VIP home page Giter VIP logo

Comments (2)

ad-si avatar ad-si commented on July 21, 2024 1

Oh my bad then. I thought Jsurl2 had a compressed variant.

Thanks for the write up!

from midi-surf.

ChrisWellsWood avatar ChrisWellsWood commented on July 21, 2024

Hi @ad-si, glad you like the project! I took a quick look at jsurl2 and it looks great for sending JSON via URLs, but it looks like there's no compression, so it's going to be difficult to fit all the data for the controller into a URL without it being very long. The method I use requires JSON encoding the controller data structure to a string, compressing it with GZIP and then the bytes are base 64 encoded, all in the browser. The relevant Elm code can be found here.

For example, for controller can be represented in JSON in around ~35,000 characters:
image

If I convert to JSON, GZIP, then base64 encode, it reduces it down to a url containing ~2,250 characters, around a 15 times compression and the big advantage is that all the data that describes the controller is in the URL, no server required! I wrote a wee post about it on the Elm discourse forum, if you're interested: https://discourse.elm-lang.org/t/encoding-user-created-content-in-a-url/8914.

from midi-surf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.