Skip to content

0.1.5

Choose a tag to compare

@Ishanoshada Ishanoshada released this 28 Jun 12:31
· 17 commits to main since this release

MicroWeb Release Notes - Version 0.1.5

Overview

Version 0.1.5 introduces significant enhancements to the MicroWeb framework, focusing on improving the template engine, static file serving, and CLI functionality for MicroPython on ESP32. This release adds support for dynamic template rendering with for loops and conditionals, enhances static file handling for CSS and JavaScript, and improves the create command for generating example applications.

New Features

  • Template Engine Enhancements: Added support for for loops and if/else conditionals in templates, enabling dynamic rendering of lists and conditional content.
  • Static File Serving: Improved support for serving static files (e.g., style.css, script.js) to enhance web interfaces with consistent styling and interactivity.
  • CLI Improvements: Enhanced the microweb create command to generate example apps with app.py, index.html, style.css, script.js, and README.md, including a for loop example.
  • Dynamic Routing: Strengthened dynamic routing with URL parameter handling (e.g., /greet/<name>), improving flexibility for API endpoints.
  • JSON Responses: Optimized app.json_response for consistent API output with proper Content-Type headers.

Improvements

  • Wi-Fi Configuration: Refined Wi-Fi handling with better fallback to access point mode when station mode fails.
  • Debugging: Enhanced debug=True logging for template rendering and static file serving errors.
  • Documentation: Updated README.md template in generated apps to include instructions for testing for loops and static files.

Bug Fixes

  • Fixed issues with template caching on ESP32, improving performance for repeated renders.
  • Resolved errors in req.form parsing for POST requests with empty or malformed data.
  • Corrected CLI path handling for Windows environments in the create command.

Upgrade Instructions

  1. Update MicroWeb to version 0.1.5:
    pip install microweb==0.1.5
  2. For existing apps, ensure templates use the new {% %} and {{ }} syntax for variables and control structures.
  3. Update static file references in templates to include .css and .js files served via app.add_static.
  4. Test existing routes with curl or a browser to verify compatibility with the updated template engine.

Known Issues

  • Large template files (>10KB) may cause memory issues on ESP32 due to MicroPython constraints. Consider splitting complex templates.
  • Custom Wi-Fi configurations in config.json may require revalidation after upgrading.

Feedback

Report issues or suggest features at https://github.com/ishanoshada/microweb.