Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
309 commits
Select commit Hold shift + click to select a range
687d821
Fix FAQ page
aalin Apr 30, 2024
b79165e
Remove outdated documentation
aalin Apr 30, 2024
d2ce1ce
Remove borders used for debugging
aalin Apr 30, 2024
0effd73
Fix state and props
aalin Apr 30, 2024
6120f7e
Make ConnectionStatus a type
aalin Apr 30, 2024
8dc14c2
Make patching async
aalin May 1, 2024
36ed336
OLLAMA_URL => OLLAMA_HOST
aalin May 1, 2024
04917af
Fix pokemon demo
aalin May 1, 2024
bde9fa3
Update docs
aalin May 1, 2024
5d2022f
Clear patches before running
aalin May 1, 2024
c6b7cda
Add fetch
aalin May 1, 2024
39c7fb3
Add a build command
aalin May 1, 2024
26c613a
Fix invalid wrapping of elements in markdown
aalin May 1, 2024
d6cbce7
Use instance variables in events demo page
aalin May 1, 2024
08faca6
Validate DOM nesting
aalin May 3, 2024
581078b
Extract vnodes into separate files
aalin May 3, 2024
5b3dd4d
Add link header
aalin May 10, 2024
5382dc4
Give assets a more descriptive name
aalin May 10, 2024
17e7fc4
Fix indentation
aalin May 11, 2024
b68d5ed
Use Console.logger in more places
aalin May 11, 2024
afbf558
Delete path prefix instead of using basename
aalin May 11, 2024
443a1a6
Log error
aalin May 11, 2024
feba585
Improve logging
aalin May 11, 2024
f69d9a3
Routes: Sort paths
aalin May 14, 2024
8aac530
Show path by default in routes command and make regexp optional
aalin May 14, 2024
19f9ca5
Generate assets, WiP
aalin Jun 9, 2024
b511704
Assets: Fix svg dimensions
aalin Jun 9, 2024
9119a04
Fix icon-color
aalin Jun 9, 2024
5722181
Add cache-control header to assets
aalin Jun 10, 2024
e99c972
Remove false prop
aalin Jun 10, 2024
67d3f2b
Add blur_url to image
aalin Jun 10, 2024
ab29a79
Fix string event handlers (onclick="alert(event)")
aalin Jun 16, 2024
874d844
Fix images with blur background
aalin Jun 16, 2024
ba7c218
Use Ruby 3.3.3
aalin Jun 21, 2024
c8db07b
Update dependencies
aalin Jun 21, 2024
0001523
Update pokemon pagination styles
aalin Jun 21, 2024
14b596c
Flatten attribute props
aalin Jun 21, 2024
12b382f
Use Environment.with(env) for loading configuration and everything else
aalin Jun 21, 2024
1822a23
Make modules log their path rather than their constant name
aalin Jun 21, 2024
734a459
Fix image loader + generator
aalin Jun 21, 2024
294f042
Remove unused code
aalin Jun 21, 2024
06b795c
Add test output file
aalin Jun 21, 2024
cf8992b
Add copyright
aalin Jun 21, 2024
dfb2ebf
Unskip source map test
aalin Jun 21, 2024
acffa0f
Include path to filenames in assertion failure messages
aalin Jun 21, 2024
af10e22
Move Mayu::Modules::Assets to Mayu::Assets
aalin Jun 21, 2024
14ceca3
Add basic support for custom elements
aalin Jun 30, 2024
e7f1b1d
Make session_timeout_seconds and transfer_timeout_seconds configurable
aalin Jun 30, 2024
1bc6b36
Remove unused file
aalin Jul 1, 2024
61ab47a
Fix build and start commands
aalin Jul 19, 2024
c4fbb80
Don't overwrite Exports when loading bundle
aalin Jul 19, 2024
ca0f1e4
Don't print which asset is being retreived
aalin Jul 20, 2024
a12230c
Remove prefixing slash from CSS paths
aalin Jul 20, 2024
93a4e47
Use el.classList.add and el.classList.remove
aalin Jul 20, 2024
5a561f7
Add some options and improve messages
aalin Jul 25, 2024
5cd81ab
Fix assertion message
aalin Jul 25, 2024
519300f
Fix test failures
aalin Jul 25, 2024
2f154c1
Fix secret key
aalin Jul 28, 2024
dc06f5e
Replace nokogiri with nokolexbor
aalin Jul 28, 2024
1da95b4
Add a class for getting class names
aalin Jul 31, 2024
934093b
Handle nil class names
aalin Jul 31, 2024
ec34f25
Add tests for Component::StyleSheets
aalin Jul 31, 2024
387a8ee
Details: Fix lazy
aalin Aug 8, 2024
267ce5d
Put Modules::System inside Environment
aalin Aug 8, 2024
bc63e70
Wrap imported .rb-files in classes
aalin Aug 8, 2024
6fc3039
Add some colors to `mayu routes` output
aalin Aug 8, 2024
b7c1b67
Use splats in tree demo
aalin Aug 8, 2024
eb30073
Squash this with .rb commit
aalin Aug 8, 2024
c4ddf0b
Remove unnecessary require
aalin Aug 8, 2024
3d8a731
Use white text for unsupported file formats in Highlight component
aalin Aug 8, 2024
96b44ef
Remove unused class names
aalin Aug 8, 2024
12a5edd
Fix unused class names warning
aalin Aug 8, 2024
46b9aa1
Comment out some noise
aalin Aug 8, 2024
707ad62
Rebuild routes before reloading modules when watching
aalin Aug 8, 2024
d5a48a3
Fix missing class name
aalin Aug 8, 2024
87eadf3
Wait for session
aalin Aug 8, 2024
d24b13a
Improve handling of marshal dump errors
aalin Aug 8, 2024
79fffe3
Add marshal_dump and marshal_load to Ollama class
aalin Aug 8, 2024
d120dd4
Put hashes at the end of asset filenames
aalin Aug 8, 2024
1ef494c
Measure session transfer time
aalin Aug 8, 2024
25aebde
Remove noisy output
aalin Aug 8, 2024
3cd9998
Improve error handling
aalin Aug 8, 2024
a981b43
Extract style sheets error reporting to a separate method
aalin Aug 8, 2024
3e1dc4a
Fix CSS selectors in Markdown component
aalin Aug 8, 2024
5e7f3e1
Don't keep loading rules in marshal dump
aalin Aug 8, 2024
9a85941
Store version in .mayu-bundle file
aalin Aug 9, 2024
f368bc3
Print version on start
aalin Aug 9, 2024
ba93405
Remove unused classes
aalin Aug 9, 2024
f21a835
Add prometheus metrics
aalin Aug 9, 2024
4f7bce5
Raise when attempting to write to a closed stream
aalin Aug 9, 2024
5a0144f
Validate token when resuming session
aalin Aug 9, 2024
77ae67a
Fix metrics being nil when resuming transferred sessions
aalin Aug 9, 2024
3cb3d74
Cleanup
aalin Aug 9, 2024
690e265
Calculate overall order and improve messages
aalin Aug 9, 2024
235f48d
Make CSS modules generate their .css file
aalin Aug 9, 2024
f343ed8
Setup metrics in test
aalin Aug 10, 2024
1cf4ecb
Cleanup transformers
aalin Aug 10, 2024
7278ef6
Import fonts and JSON files
aalin Aug 10, 2024
e4a3f2a
Verify token when resuming transferred session
aalin Aug 10, 2024
d9aef6e
Remove trailing comma
aalin Aug 10, 2024
3ef8130
Add some alt tags
aalin Aug 10, 2024
3e808b4
Add frozen_string_literal and copyright
aalin Aug 10, 2024
4a8dc69
Fix CSS filenames
aalin Aug 10, 2024
2d69f89
Make cookie_timeout_seconds configurable
aalin Aug 11, 2024
6905190
Update test outputs
aalin Aug 11, 2024
2e8cecd
Add BacktraceRewriter and use it to format exceptions
aalin Aug 11, 2024
04a4772
Add a context demo
aalin Aug 11, 2024
83f73c9
Fix opening links in new tab
aalin Aug 11, 2024
1855fa5
Delete unused descriptors
aalin Aug 11, 2024
1650a4b
Add a description to the fonts page
aalin Aug 11, 2024
7aa30f1
Fix routes command
aalin Aug 11, 2024
b94bcb1
Make image sizes configurable
aalin Aug 12, 2024
fe0377b
Optimize update_child_ids
aalin Aug 15, 2024
3258b18
Refactor: Handle one incoming message at a time
aalin Aug 15, 2024
75ddb86
Fix transfer, wait for bodies to finish writing
aalin Aug 16, 2024
48891bd
Use value.inspect to get "nil"
aalin Sep 3, 2024
8a928e7
Fix not found routes
aalin Sep 3, 2024
105cb7b
Rename update->apply, update_sync->update
aalin Sep 3, 2024
f19e46a
Use a Data object for todo page items
aalin Sep 3, 2024
475b8cc
Make JS runtime a module and load it from init.js
aalin Oct 30, 2024
c56d9ab
Use thread local variables for Modules::System.current
aalin Oct 30, 2024
f9a1de7
Simplify expression
aalin Oct 30, 2024
23a2245
Don't wrap asset generation in an async task
aalin Oct 30, 2024
fd9aed8
Fix intermittent failures in style sheets test
aalin Oct 31, 2024
b60758f
Fix runtime tests
aalin Oct 31, 2024
786c75d
Handle both ` and ' in backtrace rewriter
aalin Mar 22, 2025
8c715b6
Make everything run in Ruby 3.4
aalin Mar 22, 2025
8ad7f9c
Update dependencies and modernize code
aalin Mar 23, 2025
724a5bc
Add YJIT to footer, again
aalin Mar 23, 2025
b246f12
Remove unnecessary message
aalin Mar 23, 2025
de88654
Add an init command for initializing new apps
aalin Mar 23, 2025
2d6c687
Remove unused dependencies
aalin Mar 23, 2025
f740825
Render pages without storing sessions when using HTTP/1.1
aalin Mar 23, 2025
5de8266
Transfer sessions concurrently and with timeouts
aalin Mar 23, 2025
3e1dc4f
Render empty strings as ​
aalin Mar 24, 2025
9805099
Add dotenv for loading .env-files
aalin Mar 24, 2025
4ab6dc5
Add .gitignore and .dockerignore for init command and update them for…
aalin Mar 24, 2025
dd2c60f
Add remove method to VComment
aalin Mar 24, 2025
d966f43
Update Gemfile.lock
aalin Mar 24, 2025
8da44f4
Replace Ollama with GitHub Models
aalin Mar 24, 2025
077ead6
Load .env-files from app root
aalin Mar 24, 2025
8031f56
Fix margins
aalin Mar 24, 2025
5aed415
Add contain: strict; to avoid flickering when overflowing
aalin Mar 26, 2025
e8ceaa7
Refactor todo list
aalin Apr 5, 2025
d747d9e
Move init command first and print help if no arguments are passed
aalin Apr 5, 2025
7bf15ca
Rename --primary-region to --fly-region
aalin Apr 5, 2025
baf3950
Use SyntaxTree.format() instead of JSON.pretty_generate
aalin Apr 5, 2025
715884b
Update website readme
aalin Apr 5, 2025
b6fde68
Make everything work with Ruby 4.0
aalin Jan 24, 2026
b3eead8
Use oga instead of nokolexbor and fix tests
aalin Jan 24, 2026
bd56a1a
start rewriting the vdom again
aalin Jan 27, 2026
2fcefe3
Add AGENTS.md (generated by Codex)
aalin Jan 27, 2026
6f82231
Revert "start rewriting the vdom again"
aalin Jan 27, 2026
0172a27
Add some stubs for new implementation
aalin Jan 27, 2026
6ee8917
Implement constructors
aalin Jan 27, 2026
2fd9294
add dom_id_tree
aalin Jan 27, 2026
f8105b7
Add a test for the vnodes
aalin Jan 27, 2026
ef4cf38
Insert/remove patches
aalin Jan 27, 2026
43021b6
Patch updates
aalin Jan 27, 2026
38fe20c
progress
aalin Jan 27, 2026
e74aa0a
Wait for component to be mounted
aalin Jan 27, 2026
94ade60
Make a helper for rendering html
aalin Jan 27, 2026
7348ea5
Add what we've done to the vnodes2 readme
aalin Jan 27, 2026
9ea1f91
Add engine and updater and update components
aalin Jan 27, 2026
9e425b9
Update head
aalin Jan 27, 2026
66854a6
Head tests
aalin Jan 27, 2026
7440857
Replace children after updating children
aalin Jan 27, 2026
415dd8d
Test replace children
aalin Jan 28, 2026
52c36b3
Use DOM::IdNode
aalin Jan 28, 2026
7d6987e
Add stylesheets
aalin Jan 28, 2026
abd3736
update vnodes2 readme
aalin Jan 28, 2026
79b69c4
Define head aggregation rules
aalin Jan 28, 2026
6a306c6
Extract internal components to a subdirectory
aalin Jan 28, 2026
74cc9d6
Callbacks
aalin Jan 28, 2026
29e99f5
Callbacks/listeners
aalin Jan 28, 2026
cab2202
Cleanup
aalin Jan 28, 2026
dd8498d
Cleanup
aalin Jan 28, 2026
d690c70
Serialization
aalin Jan 28, 2026
4438736
Serialization
aalin Jan 28, 2026
74dec90
Serialization tests
aalin Jan 28, 2026
c20ebe0
Make methods for dumping/restoring engine
aalin Jan 28, 2026
58aa308
Don't start if there is already a task.
aalin Jan 28, 2026
6907d67
update readme
aalin Jan 28, 2026
c501667
Error boundaries
aalin Jan 28, 2026
5296109
More error boundary tests
aalin Jan 28, 2026
db62dfa
Add irb and minitest-focus
aalin Jan 28, 2026
20fe373
View transitions
aalin Jan 28, 2026
914f6cc
Extract tests to separate files
aalin Jan 28, 2026
d587fb6
update readme
aalin Jan 28, 2026
6b3dd2e
AddClass/RemoveClass, SetCSSProperty etc
aalin Jan 28, 2026
44d0581
Patches
aalin Jan 28, 2026
d8e1c7b
Run mount and listeners in async tasks
aalin Jan 28, 2026
deb43e2
Don't find the closest VDocument, call the Engine instead
aalin Jan 28, 2026
d62f4ec
Integrate vnodes2 with session.rb and server.rb
aalin Jan 28, 2026
237f84a
Make rendering work
aalin Jan 28, 2026
6b48dc9
Remove unused class
aalin Jan 28, 2026
4abbafd
Fix listener attribute logic and move rendering of attributes to VAtt…
aalin Jan 28, 2026
4a84177
Add a queue for callbacks (and keep VComponent tasks running)
aalin Jan 28, 2026
addb4b9
Don't find VDocument when we don't need it
aalin Jan 28, 2026
eee3ed0
Fix navigation
aalin Jan 28, 2026
7485376
Fix navigation
aalin Jan 31, 2026
3a04f17
Debug
aalin Jan 31, 2026
4906597
Add more tests
aalin Jan 31, 2026
e2739cb
Fix navigation
aalin Jan 31, 2026
0a65f61
Enable injection of data-mayu-id by setting an env var
aalin Jan 31, 2026
d37d5e3
Flush head after flushing dirty elements
aalin Jan 31, 2026
d0a73a7
Accept rest attributes
aalin Jan 31, 2026
5eb1ae7
Make sure components are started after insert
aalin Jan 31, 2026
a8cfe0f
Stop nodes when unmounted
aalin Jan 31, 2026
9dee8ba
Make sure CreateTree always has one IdNode
aalin Jan 31, 2026
9500477
Emit head and navigation patches first
aalin Jan 31, 2026
bfe85af
Update README
aalin Jan 31, 2026
51b1820
Reload app on file changes
aalin Jan 31, 2026
3d4ea40
Fix tests
aalin Jan 31, 2026
329bcdb
Don't do instance_variable_set
aalin Jan 31, 2026
95c7c3a
Metrics
aalin Jan 31, 2026
94c80ec
Don't ask if VNodes respond_to? certain methods
aalin Jan 31, 2026
6ad48ac
Mark nested nodes as removed
aalin Jan 31, 2026
5d2742f
Make sure removed nodes are not updated
aalin Jan 31, 2026
f5260c5
Fix watcher paths
aalin Jan 31, 2026
7e93b35
Use InlineStyle.diff
aalin Jan 31, 2026
45a3e30
Set a budget for how many children can be updated in one batch
aalin Jan 31, 2026
237222d
Update README
aalin Jan 31, 2026
cd95631
Update TODO
aalin Jan 31, 2026
17ac74d
Make VElement#tag_name public
aalin Jan 31, 2026
7134296
Bubble up errors
aalin Jan 31, 2026
189608e
Emit RenderError when callbacks raise
aalin Jan 31, 2026
54bd67f
Implement tree_path
aalin Jan 31, 2026
11f3760
Fix tree path
aalin Jan 31, 2026
4f253bd
Add tests for tree_path
aalin Jan 31, 2026
9fbdaa1
Register custom elements
aalin Jan 31, 2026
4574ab0
Custom elements
aalin Jan 31, 2026
d8951eb
Improve exception view
aalin Jan 31, 2026
ec0460b
Improve styling of ping element
aalin Jan 31, 2026
d33563b
Update game of life cell animation
aalin Jan 31, 2026
6754440
Add advanced controls to game of life page
aalin Jan 31, 2026
269de76
Refactor game of life
aalin Jan 31, 2026
32df8e3
Make sure components aren't double-rendered
aalin Jan 31, 2026
3d26aa8
Remove support for old vnodes
aalin Jan 31, 2026
9368de9
Move vnodes to legacy vnodes
aalin Jan 31, 2026
8dfe095
Merge Runtime::VNodes2::Engine into Runtime::Engine
aalin Jan 31, 2026
0403ecd
Rename VNodes2 -> VNodes
aalin Jan 31, 2026
5d7028c
Rename vnodes2 -> vnodes
aalin Jan 31, 2026
3b5ae43
Don't add multiple click listeners to links
aalin Jan 31, 2026
c44a5da
Fix listeners when resuming transfered state
aalin Jan 31, 2026
be4e991
Update vnodes readme
aalin Jan 31, 2026
17c01f7
Add context
aalin Feb 1, 2026
29c8fd3
Fix tests
aalin Feb 1, 2026
1b76487
Remove legacy_vnodes
aalin Feb 1, 2026
9074fb0
Add a README describing the modules system
aalin Feb 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
with:
ruby-version: "3.3.0"
bundler-cache: true
- name: Check types
run: bundle exec srb tc
- name: Run tests
run: bundle exec rake test
- uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ruby 3.3.0
nodejs 21.4.0
ruby 4.0.1
nodejs 24.1.0
47 changes: 47 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Repository Guidelines

## Project Structure & Module Organization

- `lib/` contains the Ruby framework code; tests live alongside source as `*.test.rb` (e.g., `lib/mayu/state.rb` → `lib/mayu/state.test.rb`).
- `lib/mayu/client/` holds the browser runtime (Node workspace).
- `example/` is a runnable sample app plus `mayu.toml` server config.
- `bin/` and `exe/` provide CLI entry points and scripts.
- `vendor/` and `node_modules/` are dependency/vendor directories.

## Architecture Overview

- Server-rendered HTML with server-side state; the client runtime applies DOM patches over streaming updates.
- Components return VDOM descriptors; the server diffs component trees and sends patch instructions.
- Client stream and event serialization live under `lib/mayu/client/src/` and `lib/mayu/client/src/serializeEvent.ts`.

## Build, Test, and Development Commands

- `bundle install` installs Ruby dependencies.
- `npm install` installs Node dependencies (root workspace).
- `npm run build` builds the browser runtime via the `lib/mayu/client` workspace.
- `rake test` runs the Minitest suite (glob: `lib/**/*.test.rb`).
- `rake build` runs the client production build and builds the gem.
- `cd example && bundle install && bin/mayu dev` starts the example app at `https://localhost:9292/`.

## Coding Style & Naming Conventions

- Ruby code uses `.rb` with adjacent tests named `*.test.rb`.
- Prettier is configured (with `@prettier/plugin-ruby`) and is used via `npx prettier --write '**/*'`.
- `lint-staged` runs Prettier on common file types before commits; keep changes formatted.

## Testing Guidelines

- Test framework: Minitest (see `test_helper.rb` and `Rakefile`).
- Prefer higher-level tests; add focused unit tests for tricky edge cases.
- Keep example app behavior up to date; it serves as a practical integration test.

## Commit & Pull Request Guidelines

- Commit messages in this repo are short, imperative sentences (e.g., “Fix margins”, “Update dependencies and modernize code”).
- Include a clear PR description, link issues when relevant, and add screenshots/gifs for UI changes.
- Confirm tests (`rake test`) and build (`npm run build`) before opening a PR.

## Security & Configuration Tips

- Development HTTPS uses a self-signed certificate; follow README instructions if your browser blocks `https://localhost:9292/`.
- Server settings live in `example/mayu.toml`; use `[dev.server]` options for local development.
10 changes: 3 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ group :development do
gem "guard", require: false
gem "localhost", require: false
gem "minitest", require: false
gem "minitest-mock", require: false
gem "minitest-reporters", require: false
gem "minitest-focus", require: false
gem "prettier", require: false
gem "rexml", require: false
gem "ruby-prof", require: false
gem "sorbet", require: false
gem "tapioca", require: false
gem "nokogiri", require: false
gem "benchmark", require: false
gem "irb", require: false
end

gem "fuzzy_match"

gem "reline", "~> 0.4.2"
Loading