Weasel...ndlers(3pm)

πŸ“¦
version 0.32 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Weasel::WidgetHandlers β€” the whole vibe πŸ’–

okay so bestie, the page header thing says Weasel...ndlers(3pm) (yes it's truncated, that's just how man pages do, don't @ me) and it lives in the User Contributed Perl Documentation section. Version is 0.32. Let's get into it. πŸ¦‹


✨ NAME ✨

Weasel::WidgetHandlers β€” the part that maps elements to widget handlers, i.e. the matchmaker of your DOM πŸ’…


🌸 VERSION 🌸

version 0.32


πŸŽ€ SYNOPSIS πŸŽ€

  use Weasel::WidgetHandlers qw( register_widget_handler );

  register_widget_handler(
    'Weasel::Widgets::HTML::Radio', # Perl class handler
    'HTML',                         # Widget group
    tag_name => 'input',
    attributes => {
       type => 'radio',
    });

  register_widget_handler(
    'Weasel::Widgets::Dojo::FilteringSelect',
    'Dojo',
    tag_name => 'span',
    classes => ['dijitFilteringSelect'],
    attributes => {
       role => 'presentation',
       ...
    });

like, that's the whole point. you tell it a class, a group, and what the element looks like. it does the rest. slay. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: widget handlers map HTML elements to Perl class instances, and they decide based on the HTML tag and its attributes. That Perl class is then your little encapsulation station β€” it wraps up all the interaction with the HTML element and its children, so instead of doing raw HTML DOM stuff you're doing functional behaviours. it's giving abstraction, and honestly? iconic. πŸ‘‘

A widget can also be composed of one or more child-widgets, no cap. Like, a form could be made of several input fields and a button, and all of those get mapped to widgets that handle the interactions for their specific element type. nesting is the moment. πŸ’–

You can develop classes and register handlers for widgets that do the same behaviours as basic HTML widgets β€” think the select tag for example. Like, a Dojo Toolkit, Vue or React widget could be mapped to specific classes that encapsulate the DOM interactions required to make those widgets transparent to the Perl code that's interacting with them. literally invisible, main character energy but for the Perl side. An example of a widget mimicing to be a select tag is Weasel::Widgets::Dojo::Select. πŸ’…


🌈 DEPENDENCIES 🌈

(this section is empty in the original, bestie. nothing to see here. moving on. πŸ™ˆ)


⭐ SUBROUTINES/METHODS ⭐

  • register_widget_handler($handler_class_name, $group_name, %conditions) β€” Registers $handler_class_name to be the instantiated widget returned for an element matching %conditions into $group_name.

And listen: Weasel::Session can select a subset of widgets to be applicable to that session by adding a subset of available groups to that session. so you get to pick your faves. πŸŽ€

  • best_match_handler_class($driver, $_id, $groups) β€” Returns the best matching handler's class name, within the groups listed in the arrayref $groups, or undef in case of no match.

When $groups is undef, all registered handlers will be searched. 🌸

When multiple handlers are considered "best match", the one last added to the group last mentioned in $groups is selected. yes it's giving favouritism and yes that's on purpose. πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

Erik Huelsmann


🫢 CONTRIBUTORS 🫢

Erik Huelsmann Yves Lavoie


πŸ’œ MAINTAINERS πŸ’œ

Erik Huelsmann


😭 BUGS AND LIMITATIONS 😭

Bugs can be filed in the GitHub issue tracker for the Weasel project:

https://github.com/perl-weasel/weasel/issues
fr fr if something's cursed, tell the tracker, don't suffer in silence bestie πŸ“

πŸ”₯ SOURCE πŸ”₯

The source code repository for Weasel is at

https://github.com/perl-weasel/weasel

🧚 SUPPORT 🧚

Community support is available through perl-weasel@googlegroups.com <mailto:perl-weasel@googlegroups.com>.


 (C) 2016-2023  Erik Huelsmann

Licensed under the same terms as Perl.


and that's the whole page, bestie!! this one was generated by perl v5.40.1 on 2025-05-24, and the footer was screaming Weasel...ndlers(3pm) at us the whole time. go forth and map your widgets. periodt. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from