[Issue #2] Hello World example #13

Merged
HugoNijhuis merged 1 commits from issue-2-hello-world-example into main 2026-01-09 15:46:39 +00:00
Owner

Summary

  • Adds minimal hello world example in examples/hello/main.go
  • Demonstrates signal creation, reactive text, and auto-updating UI
  • Uses a simple auto-incrementing counter to show reactivity in action

Closes #2

Test plan

  • Build with GOOS=js GOARCH=wasm go build -o app.wasm ./examples/hello/
  • Serve with wasm_exec.js and verify counter increments every second

🤖 Generated with Claude Code

## Summary - Adds minimal hello world example in `examples/hello/main.go` - Demonstrates signal creation, reactive text, and auto-updating UI - Uses a simple auto-incrementing counter to show reactivity in action Closes #2 ## Test plan - [ ] Build with `GOOS=js GOARCH=wasm go build -o app.wasm ./examples/hello/` - [ ] Serve with wasm_exec.js and verify counter increments every second 🤖 Generated with [Claude Code](https://claude.com/claude-code)
HugoNijhuis added 1 commit 2026-01-09 15:45:12 +00:00
Add hello world example
All checks were successful
CI / build (pull_request) Successful in 39s
CI / build (push) Successful in 27s
5aa1498ab7
Minimal Iris application demonstrating:
- Signal creation with NewSignal
- Reactive text rendering with TextFromFunction
- Auto-incrementing counter to show reactivity

Closes #2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Author
Owner

AI Code Review

This is an automated review generated by the code-reviewer agent.

Summary

This PR successfully adds a minimal hello world example that demonstrates Iris's core reactivity features. The code is clean, well-structured, and meets all the requirements specified in issue #2.

Findings

Code Quality

  • Well-structured and minimal: The example is appropriately simple for a first "hello world" - exactly what a new developer should see
  • Clear demonstration of reactivity: The auto-incrementing counter elegantly shows how signals and reactive text work together
  • Proper imports: Uses the correct module path (git.flowmade.one/flowmade-one/iris/...)
  • Good build tag: Correctly uses //go:build js && wasm consistent with other WASM-specific files in the codebase

Potential Bugs

  • Goroutine leak consideration: The infinite loop in the goroutine runs forever. For this example it's acceptable since select {} blocks indefinitely anyway, but in a real app this pattern would need cleanup. This is fine for a hello world example.
  • No edge cases: As an introductory example, this is appropriate - no complex scenarios to handle

Security Concerns

  • No security concerns identified - this is a standalone WASM example with no external inputs or sensitive operations

Style Notes

  • API usage is correct: Uses reactive.NewSignal(0), ui.NewView(), ui.TextFromFunction(), and ui.NewApp() exactly as defined in the codebase
  • Formatting is clean: Proper indentation, spacing, and comment style
  • Function naming: The reactive function closure is clean and idiomatic Go
  • Consistent with codebase: Build tags, import style, and code structure match existing patterns in ui/ and auth/ packages

Test Coverage

  • No tests included: This is acceptable for an examples/ directory - examples are typically demonstrative rather than tested
  • Test plan in PR description: The manual test plan (build and verify counter increments) is sufficient for this example

Verdict

LGTM

This PR perfectly meets the requirements of issue #2:

  • Creates one signal (count)
  • Renders one text element (TextFromFunction)
  • Shows reactivity working (counter increments automatically)
  • Minimal and clear for new developers

The code is production-ready and serves as an excellent first example. Ready to merge.

## AI Code Review > This is an automated review generated by the code-reviewer agent. ### Summary This PR successfully adds a minimal hello world example that demonstrates Iris's core reactivity features. The code is clean, well-structured, and meets all the requirements specified in issue #2. ### Findings #### Code Quality - **Well-structured and minimal**: The example is appropriately simple for a first "hello world" - exactly what a new developer should see - **Clear demonstration of reactivity**: The auto-incrementing counter elegantly shows how signals and reactive text work together - **Proper imports**: Uses the correct module path (git.flowmade.one/flowmade-one/iris/...) - **Good build tag**: Correctly uses `//go:build js && wasm` consistent with other WASM-specific files in the codebase #### Potential Bugs - **Goroutine leak consideration**: The infinite loop in the goroutine runs forever. For this example it's acceptable since `select {}` blocks indefinitely anyway, but in a real app this pattern would need cleanup. This is fine for a hello world example. - **No edge cases**: As an introductory example, this is appropriate - no complex scenarios to handle #### Security Concerns - No security concerns identified - this is a standalone WASM example with no external inputs or sensitive operations #### Style Notes - **API usage is correct**: Uses `reactive.NewSignal(0)`, `ui.NewView()`, `ui.TextFromFunction()`, and `ui.NewApp()` exactly as defined in the codebase - **Formatting is clean**: Proper indentation, spacing, and comment style - **Function naming**: The reactive function closure is clean and idiomatic Go - **Consistent with codebase**: Build tags, import style, and code structure match existing patterns in ui/ and auth/ packages #### Test Coverage - **No tests included**: This is acceptable for an examples/ directory - examples are typically demonstrative rather than tested - **Test plan in PR description**: The manual test plan (build and verify counter increments) is sufficient for this example ### Verdict **LGTM** This PR perfectly meets the requirements of issue #2: - Creates one signal (count) - Renders one text element (TextFromFunction) - Shows reactivity working (counter increments automatically) - Minimal and clear for new developers The code is production-ready and serves as an excellent first example. Ready to merge.
HugoNijhuis merged commit 5aa1498ab7 into main 2026-01-09 15:46:39 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flowmade-one/iris#13