Sync templates with Arizona breaking changes#24
Merged
williamthome merged 7 commits intomainfrom Oct 7, 2025
Merged
Conversation
Replace all arizona_template:from_string calls with arizona_template:from_html across all templates to align with Arizona breaking changes.
Breaking changes in Arizona client API:
- Arizona is now a named export instead of default export
- Constructor now accepts { logger } instead of { logLevel }
- Logger must be instantiated separately (ArizonaConsoleLogger)
- connect() now takes path string directly instead of { wsPath }
Updated templates:
- arizona.frontend: Updated main.js and package.json
- arizona.svelte: Updated main.js and package.json
The Arizona client API has renamed the event method: - sendEventTo() → pushEventTo() Updated templates: - arizona.presence: Updated counter.erl increment button - arizona.svelte: Updated counter.erl decr/reset/incr buttons
The app.css and app.js files in priv/static/assets/ are build artifacts generated by npm run build, not source files. Users should build these after template generation using: - npm run build:css (generates app.css with Tailwind) - npm run build:js (generates app.js with esbuild) This fixes the template generation issue where these files were missing.
Add clear "Getting Started" sections to all templates: - Step-by-step instructions (npm install, npm run build, rebar3 shell) - Application endpoint (http://localhost:1912) This provides a consistent onboarding experience across all templates.
Breaking changes applied: - Move layout from separate file into view.erl (layout/1 callback) - Use arizona_template:from_erl instead of from_html - Add handle_event/3 for interactive button - Use new Arizona client initialization (from arizona assets) - Update sys.config to use arizona static assets route - Add websocket route configuration Template now demonstrates: - Inline layout definition - Event handling with pushEvent - Dynamic content updates based on state
Breaking changes applied:
- Update Arizona client import path to /assets/arizona/js/arizona.min.js
- Add arizona.connect('/live') with explicit path
- Reorganize sys.config routes (arizona assets first, then app assets)
- Fix asset route to use {{name}} static assets instead of arizona
- Update layout script src to use correct assets path
This aligns with Arizona framework's standardized asset serving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update all rebar3 templates to be compatible with Arizona framework breaking changes:
from_htmlandfrom_erlAPIs for template renderingsendEventTo→pushEventToandsendEvent→pushEventAll templates (hello_world, presence, frontend, svelte) now work with latest Arizona framework APIs.