How to customize jquery to minimize the size

How to customize jquery to minimize the size

Hi,

I am trying to use jquery in an embedded software project.

We are using Micrium RTOS operating system and their HTTP Web Server implementation. As it is embedded software they offer so called static file system (*.html, *.css  etc compiled and converted to string literal using #define – see below) and dynamic file system (mounting SD or USB card as a system drive from which files are red). I was told (our local architectural decision) I have to use static files – which basically means that every *.html or *.css file has to be converted to the string literal (byte array created by #define pre-processor directive ) and returned from the server as an array of bytes (similar to a usual disk system with the exception that it is really code that is returned). For example, if the Browser asks my server for a typical index.html, my code looks in the lookup map that the index.html is mapped to my string literal FORM_HTML_CONTENT in the form below and I return that array of bytes to the browser:

  1. #define FORM_HTML_CONTENT \
  2. "\x3C\x21\x44\x4F\x43\x54\x59\x50\x45\x20\x48\x54\x4D\x4C\x20\x50"\
  3. "\x55\x42\x4C\x49\x43\x20\x22\x2D\x2F\x2F\x57\x33\x43\x2F\x2F\x44"\

  4. ..."

The problem with this approach is that string literals usually have limitations and using compiler like ccrx (Renesas compiler for RX Family of the microcontrollers – we are using R5F571MLCxBG) the limitation is 32K as I learned from Renesas forum.

I would like to use jquery library with my implementation and I found how to customize jquery using git library (https://github.com/jquery/jquery). However even if I switch off, most of the features from jquery using command below, I am still exceeding 32K limit:

  1. grunt custom:-ajax/xhr,-ajax/script,-ajax/jsonp,-css,-css/showHide,-deprecated,-dimensions,-effects,-event,-event/alias,-event/focusin,-event/trigger,-offset,-wrap,-sizzle

Is there any other way of minimizing jquery so I could convert it to string literal that is less then 32K?

I am running out of ideas.

 

Kind Regards,

Janusz