Skip to content

Conversation

@indaco
Copy link
Owner

@indaco indaco commented Apr 1, 2025

This PR introduces several enhancements, refactors, and fixes to improve the clarity, functionality, and maintainability of the project.

Key changes include updates to the Toaster struct, improvements to the development and usage experience, and the addition of new features.


Changes Made

  • Refactoring

    • Simplified the Toaster struct and related methods.
    • Reorganized constants and removed unused code.
    • Moved Templ components to a new components package and introduced internal/viewmodel for better separation of concerns.
    • CSS and JavaScript are now managed and injected via tempo for better build-time control.
  • New Features

    • Introduced ToasterBuilder for a fluent, chainable API when configuring the toaster.
  • Bug Fixes

    • Fixed initialization of the Icons map.
    • Improved error handling in toast rendering.
  • Build Improvements

    • Updated Go version and dependencies.
  • Tests

    • Add test cases
    • Updated test commands to skip unnecessary directories.
  • CI Enhancements

    • Improved GitHub Actions workflows for testing, linting, and release notes.
    • Enhanced pre-commit and pre-push Git hooks.
  • Documentation Improvements

    • Moved development setup instructions to CONTRIBUTING.md.
    • Overhauled the README to better reflect new features, simplified usage, and updated examples.

Breaking Change

Thanks to Templ's render: once feature, there is no longer a need to manually include GoasterCSS and GoasterJS in your Templ pages.

This significantly simplifies integration—both helpers have been removed from the codebase as they're now handled automatically at compile time.

indaco added 30 commits March 31, 2025 12:10
- Moved Templ components to a separate `components` package
- Introduced `internal/viewmodel` with `ToasterViewModel` and `ToastViewModel`
- Replaced direct access to `goaster.Queue`, `Toast`, and `Icons` in templates
- Flattened render data via 
- Moved `GetToastEntranceClass` to `viewmodel` as a pure string-based helper
@indaco indaco merged commit 6a41916 into main Apr 1, 2025
4 checks passed
@indaco indaco deleted the v0.2.0 branch April 1, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants