theelims / ESP32-sveltekit

A simple and extensible framework for ESP32 based IoT projects with a feature-rich, beautiful, and responsive front-end build with Sveltekit, Tailwind CSS and DaisyUI. This is a project template to get you started in no time with a fully integrated build chain.
https://theelims.github.io/ESP32-sveltekit/
Other
90 stars 15 forks source link

WWWData.h build script update #15

Closed EvEggelen closed 5 months ago

EvEggelen commented 6 months ago

-updated build script that only re-builds WWWData.h when source files are updated ( only working when compile def PROGMEM_WWW is used ) -added support for nodemcu-32s board -fixed build issues on Linux ( when using case sensitive filesystem); renamed spinner.svelte-> Spinner.svelte

theelims commented 6 months ago

@EvEggelen Thank you for submitting this pull request.

I have a couple of questions regarding your code:

  1. Why do you include this in the WWWData.h file?

    #include <functional>
    #if defined(ARDUINO)
      #include <Arduino.h>
    #else
      #define PROGMEM
    #endif
  2. Also what's the purpose of #define WWW_NR_PAGES and the page_entry_t struct?

  3. You have included "[ code available under dual license ]" behind your copyright note. I see this conflicting with the licencing and would like to remove this statement (keeping just your name)

EvEggelen commented 6 months ago
  1. This adds support for the ESP-IDF framework for the WWWData.h file.
  2. My background is automotive software that needs to comply with the MISRA standard. Then one of the requirements is to function without dynamic memory allocation ( to give guaranties ). So you need to assign all memory at startup. This define indicates how many files are generated so you can know how much memory to allocate. This is also needed for the IDF HTTPS server as it also pre-allocates a maximum number of end-points at start of the server. Even PsychicHttp cannot hide this ( current it is set a "large" number at a cost ). The struct enables serving files from a structure from flash without memory on the heap. But this is only use-full with the new HTTP server ( making progress) . The compiler removes it when not used.
  3. I moved some code (in this case snippets) from my company to the opensource project. I have not troubles sharing code to the public. But I do not want the requirements from LGPL coming in my own code base because I shared some code. This remark is there to indicate that my contributions are also available under a different license ( dual license ). For this build script I expect this is not critical, but for large contributions it can matter.
theelims commented 6 months ago

OK, understand. I'll test the code the coming days and merge it with the mainline.

theelims commented 5 months ago

@EvEggelen There was a small bug in your script. You compared the file creation date instead of the last file modification date.