A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label framework. Show all posts
Showing posts with label framework. Show all posts

Javascript web frameworks, 2022

 A list:

  • React - library, jsx, facebook
  • Vue - easier than backbone, good cli
  • Angular - typescript, heavy, google
  • Ember - opinionated, fast development <-- this one is good
  • Backbone - stable, reliable, data rendering, easy, lightweight
  • Aurelia - convention over configuration, standards, very easy
  • Lit - very fast, lightweight, google
  • Mithril - lean, fast, simple

Mojolicious version 9 cheat sheet

Mojo 9 changes:

s/over/requires/

s/route/any/

s/via/methods/


Guide to debugging Mojolicious applications

When MOJO_MODE=development or is not set, you should see exceptions rendered in the browser. But if you don't, try creating a templates/exception.html.ep template that contains this: %= $exception

You can also create error templates for different environments:
  • templates/exception.production.html.ep
  • templates/exception.development.html.ep

Mojo provides useful hooks that can be used to dump out debugging info:

Client-side web design frameworks

A short list:

  • Foundation - doesn't work in IE8, and doesn't even degrade gracefully
  • Bootstrap - from Twitter. Works in IE8
  • Alternatives are available

Catalyst controller basics

Create a controller module:

    myapp_create.pl Controller Foo

created "......../lib/Controller/Foo.pm"
created "......../t/controller_Foo.t"

Inside Foo.pm:

sub index :Path :Args(0) {
    my ( $self, $c ) = @_;
    $c->response->body('Matched XXXX::Controller::Foo in Foo.');
}

sub root :Chained('/') :PathPrefix :CaptureArgs(0) {
    # common stuff for this controller
}
                        
sub bar :Chained('root') :PathPart('bar') :Args(0) {
    my ( $self, $c ) = @_;
    # something
}

Perl web frameworks