Repository navigation
fix: read client-synced control state like event.control.value - #71
Merged
Merged
Conversation
The control docs read a control's current value off the control itself (`event.control.value` in on_change/on_select handlers, `field.value` and `toggle.value` later on), but controls only exposed `props["value"]`, so those reads raised NoMethodError on v0.0.23 and on main. Each control now answers a bare read (no arguments, no block) of any property its KEYWORDS declare, through method_missing/respond_to_missing?. Events are not readers, there are no setters, public methods of the same name keep winning, and every call with arguments or a block takes the previous method_missing path unchanged. Values are the current ones: Page already applies update_control and change/select event values to props before handlers run. `controls` reads the live children list, and the dropdown_m2 spellings read the Dropdown key they are stored under. The Rails HTML recorder service matched actions with respond_to?, so the AudioRecorder properties (data, key, configuration) would have become "actions"; it now checks the recorder's real public methods, which keeps every action resolving exactly as before.
Review of the first version: readers for every declared property, answered through method_missing, made respond_to?/method/public_send/try answer for 784 names, and which names were readable depended on the runtime (CRuby reached method_missing for private Kernel helpers such as open/icon/color, the embedded mruby VM did not). Readers are now ordinary public methods, defined once at load time from an explicit table (Ruflet::UI::ClientStateReaders): only the properties the Flutter renderers send back with update_control after user interaction (value, selected, selected_index, start_value/end_value, expanded, selection, entry_mode), and only on the classes that declare them. That is 51 readers on 42 classes; nothing else about any control changes. A reader is never defined over an existing public or private method of the class or an ancestor; `open` and Dropdown `text` are not in the table because they are private Kernel methods on every object. The method_missing / respond_to_missing? override, the `controls` and dropdown_m2 alias readers, and the Rails recorder guard are gone: AudioRecorder gets no readers, so html_app.rb is back to main. The same 51 readers, and no other method or respond_to? change, exist on CRuby and in the embedded VM built from these sources (tools/embedded_vm_harness/tests/client_state_readers_test.rb).
No table entry collides with an existing method, so the guard was never exercised: removing it, or narrowing it to public methods, kept every test green. define_readers takes its own [class, names] pairs, and the CRuby and embedded-VM tests now run it on classes with public, protected, private, inherited and Kernel methods of those names. They also pin that a reader rejects keywords and ignores a block.
The readers sat in front of every method an app could add above the table class (Ruflet::Control, PlatformControl, framework modules, Object, Kernel), so an app that had added its own `value` on v0.0.23 got the reader instead. Each table class now gets its readers from its own module, included into the class, and a reader hands the call on whenever something else would have answered it without the reader: - a method of that name after the reader module in the lookup, public, protected or private, including Object and Kernel (super, with the arguments and block); - a method_missing other than Ruflet's own Kernel#method_missing, on the object, a subclass, a control class, Object, or in place of Ruflet's. Methods defined on the class itself, a subclass, the object, or a module included into the class later come first in the lookup as usual. Tests cover each place an app can put such a method, before and after Ruflet loads. The embedded test no longer calls install! itself, so it fails when the framework stops installing the readers.
`ruflet run` hot reload drops every watched file from $LOADED_FEATURES and loads the script again. When the framework sources sit inside the app directory, that loads ruflet_ui.rb a second time, which defines Kernel#method_missing again. The readers compared it with the definition they recorded at the first load, took the new one for an app's method_missing, and handed every read to it, so `toggle.value` raised NoMethodError after the first reload. install! now records Kernel#method_missing on every call; ruflet_ui.rb calls it right after defining it, on every load. Loading the readers file again also no longer warns about METHOD_DEFINED_COUNTS_PRIVATE.
…ion helpers On CRuby, a call with a receiver to a private or protected method goes to method_missing. So on v0.0.23, an app with its own method_missing that answers `value` also got `control.value` when it had a private or protected method of that name above the control class, such as a top-level `def value` in the script. The readers handed those calls to that method instead (`chip.selected` returned the script's helper and set an instance variable on the chip). A reader now hands the call to the app's method_missing unless the method after the reader module is public. Calls that reached such a private or protected method from inside the control (no receiver, self., send) or a protected one from another control now reach the method_missing too: a method cannot tell how it was called. The module comment lists this. A helper that Ruflet::Extensions.register_control defines after load for an extension named like a reader (`expanded`) is a private Kernel DSL helper, so the readers took it for an app method and `tile.expanded` built an `expanded` control. register_control now records the helper it defined (Ruflet::Extensions.kernel_helper), and a plain read (no arguments, no block) ignores that unchanged helper. Calls with arguments or a block still reach it, and an app's own method of that name still wins. Tests (core, and the embedded test on CRuby and mruby where they apply): keyword arguments and blocks handed to an app method_missing; an app method_missing with a private Object helper, a protected Ruflet::Control method, a private framework-module method ahead of a public Object method, and a public Object method; the reviewer's script; extension helpers named `expanded` and `selection`, with app methods of those names; the recorded helper surviving a framework reload. The comment on `skipped` and the "app's method always wins" wording are corrected.
When an app has its own method_missing, a reader passes the call to it unless the method after the reader is public. That visibility was asked with public_method_defined? of the first module after the reader that has the method, usually the superclass. In the embedded VM that is a bootstrap.rb fallback over public_instance_methods, which lists a public method even when a private one of the same name hides it. So with a private Ruflet::Control#value over a public Object#value, `toggle.value` went to the method_missing on CRuby, but to the private method in mruby. The readers now find the module whose method `super` would call (the first in the lookup that has the method itself, a visibility change included) and read the visibility there. CRuby asks method_defined?/private_method_defined?/public_method_defined? with inherit false; mruby, whose predicates take no such flag, reads the module's own method lists. The extension-helper check uses the same lookup instead of UnboundMethod#owner. register_control's Kernel helper is a visibility change (Kernel makes the SharedControlForwarders method private), and for such a method Ruby 3.1 reports the defining module as the owner, not Kernel (3.2 changed this, bug #18729). On 3.1 a plain `tile.expanded` would have built an `expanded` control again. Tests: a private or protected Ruflet::Control#value, and a bare `private :value`, in front of a public Object#value; a public one in front of a private Object#value (core, and the embedded test on both runtimes). A fresh-process core test makes UnboundMethod#owner answer as on Ruby 3.1 and checks `tile.expanded`. An app method_missing now also gets bare and argument calls of an extension helper from inside the tile, which the module comment's "Not covered" list now says.
The reload test now also reads ClientStateReaders.skipped after the second require. An install! that ran define_readers again would find the readers it defined the first time and list all 51 pairs as skipped; no test noticed that before.
register_control's Kernel helper (say `expanded`) is private, and a plain `tile.expanded` reads the tile's state instead of building a control. The check compared Kernel.instance_method(:expanded) with the recorded helper, and == ignores visibility. So after `module Kernel; public :expanded; end` the reader still answered, where v0.0.23 called the public helper and built an `expanded` control. The helper now counts as Ruflet's only while Kernel's entry is still private; once the app makes it public or protected, `tile.expanded` calls it again. Protected counts because CRuby lets a caller that is an instance of the method's module call a protected method with a receiver, and every caller is an Object. The same applies to any protected method of Object, Kernel or a module Object includes: with an app method_missing, v0.0.23's `control.value` called such a method, while the reader sent the call to the method_missing. reachable_method_after? (was public_method_after?) now treats those protected methods like public ones. A protected method further down (Ruflet::Control, PlatformControl, an included module) still sends the call to the method_missing, as on v0.0.23. One known difference is left: with an app method_missing and a protected Object/Kernel method, `public_send(:value)` went to the method_missing on v0.0.23 and now reaches the protected method.
app_method_missing? calls Kernel#method unbound so that a control with a `method` of its own (an HTTP-verb style property, say) cannot change the answer. Nothing tested that: asking `control.method(:method_missing)` instead passed every test, and in such an app it raises NoMethodError (`owner` for nil) on every read of every reader. The core and embedded tests now define `Ruflet::Control#method` and check that the reader, and an app method_missing, still answer. The core test also gives one control a singleton `method`.
…s comment The "Not covered" bullet for a protected Object or Kernel method now says what the embedded VM did on v0.0.23 (it raised for every such call with a receiver), and the next bullet names Ruflet's own extension helper instead of "such" a helper, which no longer referred to the bullet above it. Comment only.
2 tasks
app_method_missing? looked only at the first method_missing in the control's lookup. In an app whose method_missing comes after Ruflet's own Kernel#method_missing (one in a module included into Kernel, before or after Ruflet loads, or one on BasicObject in place of Ruby's own), that first one is Ruflet's, so the reader returned props["value"]. On v0.0.23 and main, `toggle.value` reached the app's method_missing: Ruflet's Kernel#method_missing, and SharedControlForwarders' after it, call super at once for a call with no arguments and no block. When the first method_missing is Ruflet's, the readers now also walk the modules after Kernel (Kernel's own ancestors, then BasicObject's) and count any method_missing there that is not Ruflet's SharedControlForwarders one or Ruby's own BasicObject one. install! records those two along with Kernel's, so a framework reload keeps them Ruflet's. Ruby's is recorded only when it is built in (no source_location and no parameter names, on CRuby and in the VM), so a BasicObject#method_missing defined before Ruflet loads counts as the app's. The walk stops at Ruby's own, which calls nothing after it. The reader still hands the call to method_missing, so it goes through Ruflet's Kernel#method_missing as on v0.0.23: a plain read reaches the app's, and a call with an argument builds the generic control CRuby built there. In the embedded VM, v0.0.23 raised for these calls (mruby stops a call with a receiver at Ruflet's private Kernel#method_missing); they now reach the app's method_missing, as on CRuby. Tests: the four cases in fresh processes (core), a module included into BasicObject that Ruby's own never reaches, and the same cases in the embedded test, where a module included into SharedControlForwarders stands in for one included into Kernel before Ruflet loads.
With an app method_missing, a protected `value` in a module that Object includes (a script's top-level `include` puts it there) answers `toggle.value`, as on v0.0.23. reachable_method_after? asks whether Object's ancestors include the method's module, but no test had such a module, so checking only Object and Kernel passed every test. A core row (`toggle.value`, `instance_eval`, `public_send`) and an embedded row (`toggle.value`, on CRuby and in the VM) now pin it.
The readers treat Ruflet's SharedControlForwarders#method_missing as Ruflet's only while it is the definition install! recorded. An app that wraps it (alias, then a method_missing of its own) got `toggle.value` on v0.0.23 through Ruflet's Kernel#method_missing, and still does. No test had such a wrapper, so skipping that comparison passed every test. A fresh-process core row and an embedded row now pin it.
The walk after Ruflet's Kernel#method_missing starts after Kernel's own place in Kernel.ancestors, so a module prepended to Kernel (a require hook, say) is not mistaken for the modules Kernel includes. Starting at index 1 instead would take Kernel's own method_missing for an app's and send every read to it, and no test prepended anything to Kernel. A core row and an embedded row now do.
On a framework without the fix, `toggle.value(1)` raised ArgumentError in the new after-Kernel rows and stopped the embedded test before it listed its failures. The row now rescues it and records the failure, so the run shows all 9 failing rows (in the VM built from e79ba92 and on CRuby with its sources).
This was referenced Nov 17, 2026
…uper On CRuby, Ruby's own BasicObject#method_missing builds its error from the thread's last method miss. A reader that hands a read to an app method_missing calls method_missing itself, which is no miss, so when the app's called super the error described whatever missed last: after a rescued bare word (or a bare local_auth / about_dialog, which Ruflet's Kernel#method_missing answers after such a miss) it was a NameError that escaped rescue NoMethodError, after a private miss "private method 'value' called". The reader now first repeats, on a throwaway object, the miss control.value made without it: of a method that does not exist, or of a private or protected one when the method after the reader is. The error then matches main's in class, message, name, receiver, args and private_call?. The embedded VM has no such state and skips it.
… again install! records Ruby's own BasicObject#method_missing on every call, but only the Kernel and SharedControlForwarders records were pinned: recording Ruby's only on the first install! passed every test. The reload test now defines an app BasicObject#method_missing before Ruflet loads, puts Ruby's own back, and reloads the framework; the reader answers only once the reload has recorded Ruby's again.
This was referenced Nov 18, 2026
The REPEATS_MISS probe made a private call and then a plain miss on the loading thread, so `require "ruflet"` replaced whatever had missed before it: after a rescued bare word or private call, Ruby's own BasicObject#method_missing called directly said "undefined method" where main, v0.0.23 and 2a95acf still reported the earlier miss. The probe now runs in a Fiber of its own. CRuby keeps the last miss per Fiber, so the caller's stays as on main; REPEATS_MISS is still true on CRuby and false in the embedded VM. test_requiring_ruflet_leaves_the_last_miss_alone checks both earlier misses in fresh processes; it passes on main and fails on 25fc1ed. The comment of test_requiring_ruflet_is_enough no longer claims its check covers this.
…erently The module comment said every caller is an Object, but a method of a BasicObject subclass is a caller whose self is not one: with a protected value on Object, Kernel or a module Object includes, CRuby sent its `control.value` to the app's method_missing (or raised without one), and the reader calls the protected method. The comment now says so, both in the "Not covered" bullet and where reachable_method_after? explains why that method comes first, and it lists the calls that went from raising to answering without an app method_missing: any call with a receiver to a private method above the table class or a protected one below Object, and public_send or a BasicObject caller for a protected one on Object. `super` from a `value` an app subclass defines is another call without a receiver: with an app method_missing that passes it on, v0.0.23 raised "super: no superclass method 'value'" with private_call? true, and the reader raises "undefined method" with private_call? false. The comment lists it and test_a_call_without_a_receiver_raises_what_a_call_with_one_raised pins it.
… alone Repeating the miss before `super` to an app method, or before returning props, passed every test: only code that calls method_missing directly afterwards sees the extra miss. test_reads_that_reach_no_method_missing_leave_the_last_miss_alone reads after a rescued bare word and after a rescued private call, with no app method, a public Ruflet::Control#value and a private Object#value, and checks that the thread's last miss is what it was before the read.
This was referenced Nov 20, 2026
AdamMusa
added a commit
that referenced
this pull request
Nov 20, 2026
#71 added public readers (field.value, tabs.selected_index and 38 more) to the controls, so MethodContractCoverageTest failed on main once this branch was merged with it: 40 methods had no spec. Each reader returns what the control's props hold and sends nothing, so each gets a local spec naming client_state_readers_test, which covers them.
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.
Problem
Seven documented examples read the user's choice off the control:
event.control.valuein anon_change/on_selecthandler (control_date_picker__1,control_time_picker__1,control_dropdown__1,control_slider__1,control_switch__1), andfield.value/toggle.valueafterwards (control_dropdown__3,control_switch__2). Controls only hadcontrol.props["value"], so every one of these reads raisesNoMethodErroron v0.0.23 and on main.Fix
51 public readers on 42 control classes, only for the state the Flutter client writes back to Ruby after user interaction, and only on the classes that declare that property. Each returns
props[name]exactly as props store it (the wire value, normalized when it was set:Ruflet.dropdown(value: :apple).valueis"apple"). After a client change it returns what the client sent, asPage#apply_client_updatestored it. No engine change is needed, because the renderers already sendupdate_controlbefore the event.The readers are defined once, at the end of
ruflet_ui.rb, from the explicit table inRuflet::UI::ClientStateReaders(new filepackages/ruflet_core/lib/ruflet_ui/ruflet/ui/client_state_readers.rb). Each table class includes a reader module of its own (ClientStateReaders::RufletComponentsSwitchControl, ...). There is nomethod_missingorrespond_to_missing?override, so CRuby and the embedded mruby VM define the same methods.Components::andRufletComponents::CheckboxControl,SwitchControl,SliderControl, and their Cupertino classes (value)RangeSliderControl,DateRangePickerControl(start_value, end_value)dropdown_m2), TimerPickerComponents::TextFieldControl,TextFieldControl,CupertinoTextFieldControl(value, selection)CupertinoDatePickerControl: value)Components::SegmentedButtonControl(selected, selected_index),SegmentedButtonControl(selected)Left out on purpose:
open(every object has a privateKernel#open), Dropdowntext(the private Kerneltexthelper), client values on classes that do not declare the property, Page/View/Window measurements, and properties the client never writes back. Everything else is still read withcontrol.props["name"].When the app answers the read itself
Apps on v0.0.23 may already answer these reads with their own method or
method_missing. The reader leaves those in charge, except as listed under "Behavior changes":install!returns the skipped pairs ([]with nothing app-defined).Ruflet::Control,PlatformControl, a framework module such asTextInputMethods,Object,Kernel; any visibility): the reader checks on every call and calls it withsuper, arguments and block unchanged. Where that method is private, or protected belowObject,control.valueraised on v0.0.23 (Behavior changes 3).method_missing(in front of Ruflet'sKernel#method_missing, wrapping it, or after it: a module included intoKernel, aBasicObject#method_missingin place of Ruby's, a module prepended toBasicObject, a wrapper aroundSharedControlForwarders#method_missing): the reader callsmethod_missingwith the arguments and block, socontrol.valuegoes where it went on v0.0.23, also when a private method of that name sits above the class or a protected one belowObject. When the method after the reader is public, or protected onObject,Kernelor a moduleObjectincludes, the reader calls it instead, as CRuby's lookup did forcontrol.valuefrom code whoseselfis anObject(not forpublic_sendor aBasicObjectcaller: Behavior changes 4).install!records Ruflet's twomethod_missingdefinitions and Ruby's built-in one on every call, so a framework reload (ruflet runhot reload) keeps them Ruflet's.method_missingpasses the read tosuper: on CRuby, Ruby'sBasicObject#method_missingbuilds its error from the last method miss, and the reader's own call tomethod_missingis not a miss. So the reader first repeats, on a throwaway object (ClientStateReaders::MISSED_CALL), the misscontrol.valuemade on v0.0.23: of a method that does not exist, or of a private or protected one when the method after the reader is one. The error then matches v0.0.23's in class, message,name,receiver,argsandprivate_call?, whatever missed before. Reads that reach nomethod_missingmake no miss.REPEATS_MISSis probed at load in aFiberof its own (CRuby keeps the last miss per Fiber), sorequire "ruflet"leaves the caller's last miss as it was. It is false in the VM: this mruby raises "private method called" before anymethod_missingruns, and itsBasicObject#method_missingalways says "undefined method", so there is nothing to repeat.register_control(:expanded, ...)after load defines a private Kernel helper. That helper is Ruflet's, not the app's (Behavior changes 5). Once the app makes it public or protected on Kernel,tile.expandedcalls it, as on v0.0.23. In this mruby, registering an extension after load raisesTypeError(Kernel.send(:private, helper)with a String, on v0.0.23 too), so this case is CRuby's.Only when none of these applies does the reader answer:
props[name]with no arguments, theArgumentErrorof a zero-argument method with arguments; a block is ignored.Behavior changes
All of them concern only the 51 (class, name) pairs. 1 is the bug fix itself, and 2 is what adding a public method means. 3-9 follow from it, because a Ruby method cannot see how it was called (with a receiver or not, through
public_send, from whichself). They apply only to an app that defines its own method of that name or its ownmethod_missing, to a late extension helper of that name, to the VM, or to refinements. Each turns a call that raised into one that answers, or changes which method answers or which error is raised.NoMethodErroron v0.0.23 and main, and now returnsprops[name]. A call with arguments now raisesArgumentErroron both runtimes. On main, CRuby built an unrelated genericvaluecontrol fortoggle.value(1)(it ended up in the pending DSL app or the enclosing builder block), and mruby raisedNoMethodError. A block alone is ignored. There are no setters.respond_to?,method,public_sendandtrysee a public method, and each of the 42 classes has its reader module atancestors[1]. Nothing else changes in any control class,Object,KernelorBasicObject.Ruflet::Extensionsgainskernel_helper(name).def value, a privateRuflet::Control#value), or a protected one belowObject(onRuflet::Control,PlatformControl, a module the class includes), defined after Ruflet loads, with no appmethod_missing:control.valueandpublic_send(:value)now call it. v0.0.23 raised "private method 'value' called" or "protected method 'value' called".Object,Kernelor a moduleObjectincludes, defined after Ruflet loads:public_send(:value), andcontrol.valuefrom code whoseselfis not anObject(a method of aBasicObjectsubclass), now call it. v0.0.23 raised "protected method 'value' called", or went to the app'smethod_missingif it had one.control.valuefrom code whoseselfis anObjectcalled it on v0.0.23 and still does.register_control(:expanded, ...)after load, CRuby only): a plaintile.expandedreturns the state, where v0.0.23 raised "private method 'expanded' called". A call without a receiver from inside a table-class method (expandedin an ExpansionTile method) also returns the state, or the appmethod_missing's answer; v0.0.23 built an emptyexpandedcontrol. Calls with arguments or a block still reach the helper, unless the app has its ownmethod_missing(6).method_missingplus a private method of that name above the class, or a protected one belowObject: calls that reached that method on v0.0.23 from inside the control (no receiver,self.value,send(:value),instance_eval), and protected calls from another control, now go to themethod_missing. Ruflet's own extension helpers are such private methods, soexpanded(content: ...)in an ExpansionTile method goes there too.control.valuewent to themethod_missingon v0.0.23 as well.valuein a control method,self.value,send(:value),superfrom avaluean app subclass defines) that an appmethod_missingpasses tosupernow raises whatcontrol.valueraises:NoMethodError"undefined method 'value'",private_call?false. On v0.0.23 the bare word raisedNameError"undefined local variable or method",superraisedNoMethodError"super: no superclass method 'value'", and all but the bare word hadprivate_call?true.rescue NameErrorstill catches every one of them.method_missing, a private or protected method in front of it, a protectedObjectmethod, amethod_missingafter Ruflet's privateKernel#method_missing), the call now goes where CRuby sends it. When such amethod_missingthen callssuper, mruby's error says "undefined method".CRuby and the VM differ only in: refinements; registering an extension after load (raises in this mruby); a call with arguments when the app's
method_missingcomes after Ruflet's (CRuby builds a generic control for a Ruflet object, the VM passes the call on); and thesupererror messages in 7 and 8. From the code, not run (Ruby 3.1, the gemspec minimum, is not installed here):app_method_missing?compares the owner of the control'smethod_missing, so a class that only doespublic :method_missingcounts as an appmethod_missingon 3.2+ but not on 3.1, where the reader answers instead of raising.Verification
Head 9b99f34. It merges
origin/maindd924eb into bef75c4 with a merge commit and no conflicts. No history was rewritten. Since bef75c4 the merge brings only main'spackages/rufletchanges (#70, #75) and.gitignore;git diff --stat bef75c43 9b99f340 -- packages/ruflet_core packages/ruflet_server packages/ruflet_rails packages/ruflet_record tools ruby_runtimeis empty. Against main,git diff --name-only dd924eb3 9b99f340lists the 7 files of this PR: the ruflet_core lib (3) and readers test, the server and rails tests, and the harness test. There are no template, CLI or packaging files, so published gems that fetch template main are unaffected. Everything below ran on 9b99f34, on CRuby 4.0.5 withGEM_HOMEunset and one process per test file, unless the line says otherwise.RUFLET_TEMPLATE_ROOTat the local ruflet-template clone (as in CI), with 0 failures and 0 errors in each:packages/ruflet: 18 files, 512 runs, 3233 assertions (compat_goldens_test.rb: 242 runs);ruflet_core: 191 files, 1125 runs, 12390 assertions, 1 skip;ruflet_server: 14 files, 51 runs, 187 assertions;ruflet_rails(bundle exec): 17 files, 295 runs, 2812 assertions.ruby test/compat/compat.rb --jobs 4inpackages/rufletchecked 234 goldens, exit 0.packages/ruflet_core/test/client_state_readers_test.rbgives 41 runs, 619 assertions, 0 failures on seeds 1, 977, 4242, 31337 and 65000, and on Ruby 3.4.5 (seed 31337).test_a_call_without_a_receiver_raises_what_a_call_with_one_raised,test_an_app_method_missing_that_calls_super_raises_what_main_raised);test_requiring_ruflet_leaves_the_last_miss_alone).tools/embedded_vm_harness/tests/client_state_readers_test.rb) on CRuby: 359 assertions pass (2 runs, and on 3.4.5).ruflet_server/test/control_value_readers_wire_test.rb, 2 runs, 4 assertions) andruflet_rails/test/html_app_test.rb(45 runs, 144 assertions) pass in the suites above.super; added beforeprops[key]; moved aftermethod_missing.REPEATS_MISSforced false; always the "undefined" miss; private and protected swapped; every method counted as private.BasicObject#method_missingrecorded only on the firstinstall!.date_picker,time_picker,dropdown,slider,switch.value) raiseNoMethodError/NoMethodError/ return the props value.switch.value(1)gives a genericvaluecontrol / a genericvaluecontrol /ArgumentError.def value:switch.valueandpublic_send(:value)raise "private method 'value' called" / the same / return the helper's value. A privateRuflet::Control#selection, read astext_field.selection, behaves the same way. With a protectedRuflet::Control#selected_index,tabs.selected_indexandpublic_sendraise "protected method" / the same / return the method's value.Object#value:t.valuereturns its value on all three.public_send(:value)and aBasicObjectcaller raise "protected method 'value' called" / the same / return its value. With an appRuflet::Control#method_missingtoo, both give themethod_missing's answer / the same / the protected method's value.register_control(:expanded, ...):tile.expandedraises "private method 'expanded' called" / the same / returnstrue.tile.instance_eval { expanded }builds anexpandedcontrol / the same / returnstrue. With arguments, all three build the control.def valueand an appRuflet::Control#method_missing:t.valuegives themethod_missing's answer on all three.t.instance_eval { value },t.instance_eval { self.value }andt.send(:value)return the helper's value / the same / themethod_missing's answer.superfrom an app subclass'svalueand an appmethod_missing: "super: no superclass method 'value'" withprivate_call?true / the same / "undefined method 'value'" withprivate_call?false.require "ruflet", read back throughBasicObject#method_missingafter a rescued bare word, private, protected orsupermiss: identical before and after on all three. It is also identical on head on Ruby 3.4.5 (bare word, private,super).tools/build_apple_vm_artifacts.sh macosnarrowed to arm64 (this Mac has no Rosetta), and then the harness. All 278.rbfiles underruflet_core/libandruflet_server/libappear verbatim in its10_framework.rb.REPEATS_MISSis false.scoped_helper_testandicon_deferral_testpass.compat_testat line 67 (SystemExitis not defined in this mruby) andregexp_testat line 132 (String#partitionwith an OnigRegexp). Neither involves the readers.ruby_runtimearchives carry an older framework, soruflet build --selfapps get the readers once those artifacts are rebuilt.Ruflet::Controlclass plusObject,KernelandBasicObjectcovers ancestors and every instance method with its visibility and owner. Against main, it differs in only three places: 42 ancestor lists (aClientStateReadersmodule inserted atancestors[1]), the 51 public readers (owned by those modules), andRuflet::Extensions.kernel_helper.ruby -w, requiringruflet, prints the same 2 warning lines on head and on main.Other open PRs
I changed no other PR.
git merge-tree --write-treeof 9b99f34 with each of the 14 other open PRs (#76-#84 and #86-#90; #91 belongs to another session) is clean, except #84. #84 conflicts with main dd924eb itself inpackages/ruflet/lib/ruflet/cli/build_command.rb(#75's split). This PR does not touch that file, and #84 merges cleanly with bef75c4. On the merged trees with the PRs that changeruflet_core,ruflet_server,ruflet_railsorruflet_record(#82, #83, #86, #87, #88, #89, #90), three tests pass: the core readers test (41 runs, 619 assertions), the embedded test on CRuby (359) and the wire test.method_contract_coverage_test.rbfails and lists exactly 40type#nameentries with no spec (switch#value,text_field#selection,tabs#selected_index,expansion_tile#expanded, ...; one per factory type). That is Test what every control and service method sends; fix unset values sent as {} and map stack overflows #87's to resolve once this PR merges: add those specs, or exclude methods owned by aClientStateReadersmodule.Note
On the docs site,
control_dropdown.mdwritesfield.value # => "s"after# later:. That holds only once the user picks Small; right after construction the value isnil(test_reader_returns_what_the_user_selected_on_the_client).