From fe85ef6e061e93257353e5f08bd57fc3348c43e6 Mon Sep 17 00:00:00 2001 From: Hauke D Date: Thu, 13 Sep 2018 10:19:47 +0200 Subject: [PATCH 1/9] Added documentation for Perl.exitStatus Added in b87f932e932a2ebf5d66079694e031800ef65e00 --- using.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/using.md b/using.md index 7710a03..88b8f07 100644 --- a/using.md +++ b/using.md @@ -384,6 +384,13 @@ The states currently are: This function was added in WebPerl `v0.05-beta`. +#### `Perl.exitStatus` + +This property should be **read only**! After Perl's state has changed +to `Ended`, you can retrieve the exit code here. + +This property was added in WebPerl `v0.09-beta`. + #### `Perl.stateChanged` **Deprecated** in WebPerl `v0.05-beta`. Use `Perl.addStateChangeListener` instead. From c943ecd2af31a7aa57bcb1a716c8893bdf4de50f Mon Sep 17 00:00:00 2001 From: Hauke D Date: Thu, 13 Sep 2018 10:31:49 +0200 Subject: [PATCH 2/9] Added a prerequisite for quick start See 4a7dd5709b2fe1dabeae5c4ed968a9ff1aa5d168 --- index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/index.md b/index.md index 551e866..b659db5 100644 --- a/index.md +++ b/index.md @@ -45,6 +45,7 @@ Quick Start - Prerequisites: `perl` (a recent version is recommended, e.g. v5.26 and up), [`plackup` from Plack](https://metacpan.org/pod/distribution/Plack/script/plackup), + [Plack::Middleware::CrossOrigin](https://metacpan.org/pod/Plack::Middleware::CrossOrigin), and [Cpanel::JSON::XS](https://metacpan.org/pod/Cpanel::JSON::XS). - In a shell: From 55f85e295b5c38295d58221bac35d057330db908 Mon Sep 17 00:00:00 2001 From: Hauke D Date: Wed, 3 Oct 2018 13:10:51 +0200 Subject: [PATCH 3/9] State non-changes won't be reported d72b6bbdf0269fa9ee2ff91490197e63cf0388c8 --- using.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/using.md b/using.md index 88b8f07..351da07 100644 --- a/using.md +++ b/using.md @@ -379,8 +379,9 @@ The states currently are: - `"Initializing"` - `Perl.init` is currently operating. - `"Ready" - `Perl.init` is finished and `Perl.start` can be called. - `"Running"` - The Perl interpreter is running, `Perl.eval` and `Perl.end` may be called -- `"Ended"` - The Perl interpreter has ended. You might receive several - state change notifications for this state. +- `"Ended"` - The Perl interpreter has ended. + ~~You might receive several state change notifications for this state.~~ + This is no longer the case as of WebPerl `v0.09-beta`. This function was added in WebPerl `v0.05-beta`. From f71685d586c2a4ba85054b4f638ce743bb8fc20e Mon Sep 17 00:00:00 2001 From: Hauke D Date: Thu, 8 Nov 2018 15:15:20 +0100 Subject: [PATCH 4/9] Updated version numbers --- democode/perleditor.html | 2 -- index.md | 8 ++++---- using.md | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/democode/perleditor.html b/democode/perleditor.html index 6bfd47c..f1e3bf5 100644 --- a/democode/perleditor.html +++ b/democode/perleditor.html @@ -58,10 +58,8 @@ function makeCM (textarea,plain,ro) { function runnerState (text) { $('#runnerstate').text( text - /* not available until WebPerl v0.09-beta: + (lastExitStatus ? ' (last exit status was '+lastExitStatus+')' : '') ); - */ ); } function updateButtonState () { diff --git a/index.md b/index.md index dc9c7b2..64367d0 100644 --- a/index.md +++ b/index.md @@ -33,7 +33,7 @@ js('document')->getElementById('my_button') ``` -- [**Download `webperl_prebuilt_v0.07-beta.zip`**](https://github.com/haukex/webperl/releases/download/v0.07-beta/webperl_prebuilt_v0.07-beta.zip) +- [**Download `webperl_prebuilt_v0.09-beta.zip`**](https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip) - [**Get the sources on GitHub**](https://github.com/haukex/webperl) For web applications written with WebPerl, see: @@ -52,9 +52,9 @@ Quick Start - In a shell: - $ wget https://github.com/haukex/webperl/releases/download/v0.07-beta/webperl_prebuilt_v0.07-beta.zip - $ unzip webperl_prebuilt_v0.07-beta.zip - $ cd webperl_prebuilt_v0.07-beta + $ wget https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip + $ unzip webperl_prebuilt_v0.09-beta.zip + $ cd webperl_prebuilt_v0.09-beta $ plackup webperl.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/ diff --git a/using.md b/using.md index f623ae4..05e2281 100644 --- a/using.md +++ b/using.md @@ -36,7 +36,7 @@ If you plan on building WebPerl, for example if you'd like to add more CPAN modules, then head on over to [Building WebPerl](building.html). Otherwise, if you'd just like to get started quickly and work with the prebuilt WebPerl (includes many of the Perl core modules plus a couple extras), then download -[`webperl_prebuilt_v0.07-beta.zip`](https://github.com/haukex/webperl/releases/download/v0.07-beta/webperl_prebuilt_v0.07-beta.zip) +[`webperl_prebuilt_v0.09-beta.zip`](https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip) and unpack it. This ZIP file includes the contents of the [`web`](https://github.com/haukex/webperl/tree/master/web) directory of the source code, as well as the build products `emperl.*` (currently three files). From f242e0ca2d136224e8719e08b7cf207dd706feb2 Mon Sep 17 00:00:00 2001 From: Hauke D Date: Thu, 8 Nov 2018 15:29:08 +0100 Subject: [PATCH 5/9] Document cpanfiles 7dd3d9fbe147a484eeb89b36625a989406165153 and f7b5822176ce65f67d906c9d1801e614c7abacce --- building.md | 12 ++++++------ index.md | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/building.md b/building.md index 62aaf92..01e440a 100644 --- a/building.md +++ b/building.md @@ -26,12 +26,12 @@ Prerequisites - [Emscripten](http://emscripten.org) SDK, 1.38.10 and up, please see the prerequisites and installation instructions at -- The build script has several CPAN dependencies. One way to install them - is using [lazy](https://metacpan.org/pod/lazy): first, - install "lazy", then run e.g. `perl -Mlazy build.pl --help`. - Otherwise, the modules used by `build.pl` can be seen in - [its source](https://github.com/haukex/webperl/blob/master/build/build.pl) - grouped near the top of the file. +- The build script has several CPAN dependencies. You can install these + via [`cpanm`](https://metacpan.org/pod/App::cpanminus) and the provided + `cpanfile`: `cd` to the `build` directory, then run `cpanm --installdeps .` + (Otherwise, see the `cpanfile` or the source of `build.pl` and install these + modules with the installer of your choice. Another possibility is to use + [`lazy`](https://metacpan.org/pod/lazy), e.g. `perl -Mlazy build.pl --help`) - A working Internet connection is needed for installation and the first build. diff --git a/index.md b/index.md index 64367d0..87f6573 100644 --- a/index.md +++ b/index.md @@ -46,15 +46,16 @@ Quick Start ----------- - Prerequisites: `perl` (a recent version is recommended, e.g. v5.26 and up), - [`plackup` from Plack](https://metacpan.org/pod/distribution/Plack/script/plackup), - [Plack::Middleware::CrossOrigin](https://metacpan.org/pod/Plack::Middleware::CrossOrigin), - and [Cpanel::JSON::XS](https://metacpan.org/pod/Cpanel::JSON::XS). + and [`cpanm`](https://metacpan.org/pod/App::cpanminus) to easily install + dependencies (otherwise, see the file `cpanfile` for the dependencies and + use the module installer of your choce). - In a shell: $ wget https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip $ unzip webperl_prebuilt_v0.09-beta.zip $ cd webperl_prebuilt_v0.09-beta + $ cpanm --installdeps . $ plackup webperl.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/ From 67ec248187ac0a8ce689e9ef58286646556010a9 Mon Sep 17 00:00:00 2001 From: Hauke D Date: Thu, 8 Nov 2018 16:44:02 +0100 Subject: [PATCH 6/9] Adjust paths For haukex/emperl5@bc78e33552fd7d7db0b3ba2996f4d9408394e0b6 --- building.md | 2 +- notes.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/building.md b/building.md index 01e440a..dc95088 100644 --- a/building.md +++ b/building.md @@ -54,7 +54,7 @@ Some of the central source files of WebPerl are: - [`emperl5/hints/emscripten.sh`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/hints/emscripten.sh) - [`emperl5/perlmain_noexit_patch`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/perlmain_noexit_patch) - [`emperl5/ext/WebPerl/WebPerl.xs`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/WebPerl.xs) -- [`emperl5/ext/WebPerl/WebPerl.pm`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/WebPerl.pm) +- [`emperl5/ext/WebPerl/lib/WebPerl.pm`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/lib/WebPerl.pm) - [`webperl/web/webperl.js`](https://github.com/haukex/webperl/blob/master/web/webperl.js) diff --git a/notes.md b/notes.md index b9c89ef..3f2b72e 100644 --- a/notes.md +++ b/notes.md @@ -133,7 +133,7 @@ Release Checklist At a minimum there is: - `web/webperl.js` - `Perl.WebPerlVersion` - - `emperl5/ext/WebPerl/WebPerl.pm` - `$VERSION` + - `emperl5/ext/WebPerl/lib/WebPerl.pm` - `$VERSION` - `pages/index.md` and `pages/using.md` - download links - Update [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) values as needed, e.g.: From 5863122d375e04cb00a4f6709d6816614de3254f Mon Sep 17 00:00:00 2001 From: Hauke D Date: Sat, 2 Mar 2019 20:43:29 +0100 Subject: [PATCH 7/9] Updates for Perl v5.28.1 --- building.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/building.md b/building.md index dc95088..ac715ed 100644 --- a/building.md +++ b/building.md @@ -51,10 +51,10 @@ is checked out by the build script. Some of the central source files of WebPerl are: - [`webperl/build/build.pl`](https://github.com/haukex/webperl/blob/master/build/build.pl) -- [`emperl5/hints/emscripten.sh`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/hints/emscripten.sh) -- [`emperl5/perlmain_noexit_patch`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/perlmain_noexit_patch) -- [`emperl5/ext/WebPerl/WebPerl.xs`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/WebPerl.xs) -- [`emperl5/ext/WebPerl/lib/WebPerl.pm`](https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/lib/WebPerl.pm) +- [`emperl5/hints/emscripten.sh`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/hints/emscripten.sh) +- [`emperl5/perlmain_noexit_patch`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/perlmain_noexit_patch) +- [`emperl5/ext/WebPerl/WebPerl.xs`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/ext/WebPerl/WebPerl.xs) +- [`emperl5/ext/WebPerl/lib/WebPerl.pm`](https://github.com/haukex/emperl5/blob/emperl_v5.28.1/ext/WebPerl/lib/WebPerl.pm) - [`webperl/web/webperl.js`](https://github.com/haukex/webperl/blob/master/web/webperl.js) From 4eed27b769372f85a17729879c593d96a0f7d94f Mon Sep 17 00:00:00 2001 From: Hauke D Date: Sat, 2 Mar 2019 21:53:15 +0100 Subject: [PATCH 8/9] A couple more version number updates --- perl6.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl6.md b/perl6.md index e82258e..4001baf 100644 --- a/perl6.md +++ b/perl6.md @@ -47,8 +47,8 @@ Quick Start $ git clone https://github.com/haukex/webperl.git $ cd webperl - $ wget https://github.com/haukex/webperl/releases/download/v0.07-beta/webperl_prebuilt_v0.07-beta.zip - $ unzip -j webperl_prebuilt_v0.07-beta.zip '*/emperl.*' -d web + $ wget https://github.com/haukex/webperl/releases/download/v0.09-beta/webperl_prebuilt_v0.09-beta.zip + $ unzip -j webperl_prebuilt_v0.09-beta.zip '*/emperl.*' -d web $ cpanm --installdeps . $ cd experiments ; cpanm --installdeps . ; cd .. $ experiments/p6/6init.pl # this patches Perl 6 support in From b50d7e648add7c35ab672742d188d6392215398f Mon Sep 17 00:00:00 2001 From: Hauke D Date: Sun, 3 Mar 2019 22:40:07 +0100 Subject: [PATCH 9/9] More updates for v0.09-beta --- _misc/import.pl | 52 ++++++++++++++++++++++++++++++++++++ _misc/import_regex_tester.pl | 31 --------------------- democode/perlrunner.html | 5 ++-- notes.md | 4 +-- regex.html | 41 ++++++++++++++++++++-------- using.md | 3 ++- 6 files changed, 88 insertions(+), 48 deletions(-) create mode 100755 _misc/import.pl delete mode 100755 _misc/import_regex_tester.pl diff --git a/_misc/import.pl b/_misc/import.pl new file mode 100755 index 0000000..f30da95 --- /dev/null +++ b/_misc/import.pl @@ -0,0 +1,52 @@ +#!/usr/bin/env perl +use warnings; +use 5.026; +use FindBin (); +use Path::Class qw/dir file/; + +# A quick and dirty script for importing stuff from webperl/master to gh-pages + +sub edit (&$$) { + my ($code,$source,$dest) = @_; + state $basedir = dir($FindBin::Bin)->parent->parent; + local $_ = file($source)->absolute($basedir)->slurp(iomode=>'<:raw:encoding(UTF-8)'); + $code->(); + file($dest)->absolute($basedir)->spew(iomode=>'>:raw:encoding(UTF-8)', $_); +} + +edit { + s{ iframe.perleditor\s*\{ [^\}]* border: \s* \K \N* (?=\n) }{1px dotted lightgrey;}xmsg==1 or die; + s{ }{<$+{x}>}xmsg==1 or die; + s{ ^ \s* \K /[/*] (?= \s* iFrameResize ) }{}xmsg==2 or die; +} 'web/democode/demo.html', 'pages/democode/index.html'; + +edit { + s{ ) }{index.html}xmsg==1 or die; + s{ }{<$+{x}>}xmsg==1 or die; +} 'web/democode/perleditor.html', 'pages/democode/perleditor.html'; + +edit { + s{ ) }{index.html}xmsg==1 or die; + s{ <(?script\s+src="[^"]*webperl\.js"\s*> }{}xmsg==1 or die; + s{ }{<$+{x}>}xmsg==1 or die; +} 'web/democode/perlrunner.html', 'pages/democode/perlrunner.html'; + +edit { +} 'web/democode/perleditor.css', 'pages/democode/perleditor.css'; + +edit { + my $msg = <<'ENDMSG'; +This is essentially a copy of +https://github.com/haukex/webperl/blob/master/web/regex_tester.html +with the following differences: +- webperl.js from CDN +- $RUN_CODE_IN_IFRAME enabled +- URL updated to https://github.com/haukex/webperl/blob/gh-pages/regex.html +(see import_regex_tester.pl) +ENDMSG + s{ <(?script\s+src="(?:webperl\.js|__WEBPERLURL__)"\s*> }{}xmsg==2 or die; + s{ }{<$+{x}>}xmsg==2 or die; + s{ ^ \s* our \s+ \$RUN_CODE_IN_IFRAME\s*=\s*\K[01](?=\s*;\s*) }{1}xmsg==1 or die; + s{ https?://github.com/haukex/webperl/blob/\Kmaster/web/regex_tester.html }{gh-pages/regex.html}xmsg==1 or die; + s{ \#\#\#\#\#\s*-->\n\K }{\n\n}xmsg==1 or die; +} 'web/regex_tester.html', 'pages/regex.html'; diff --git a/_misc/import_regex_tester.pl b/_misc/import_regex_tester.pl deleted file mode 100755 index 3b330a6..0000000 --- a/_misc/import_regex_tester.pl +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env perl -use warnings; -use strict; -use FindBin (); - -# A quick and dirty script for importing regex_tester.html to pages - -my $infn = "$FindBin::Bin/../../web/regex_tester.html"; -my $outfn = "$FindBin::Bin/../regex.html"; - -my $html = do { open my $ifh, '<:encoding(UTF-8)', $infn or die "$infn: $!"; local $/; <$ifh> }; - -my $msg = <<'ENDMSG'; -This is essentially a copy of -https://github.com/haukex/webperl/blob/master/web/regex_tester.html -with the following differences: -- webperl.js from CDN -- $RUN_CODE_IN_IFRAME enabled -- URL updated to https://github.com/haukex/webperl/blob/gh-pages/regex.html -(see import_regex_tester.pl) -ENDMSG - -( $html =~ s{ <(?script\s+src="(?:webperl\.js|__WEBPERLURL__)"\s*> }{}xmsg )==2 or die; -( $html =~ s{ }{<$+{x}>}xmsg )==2 or die; -( $html =~ s{ ^ \s* our \s+ \$RUN_CODE_IN_IFRAME\s*=\s*\K[01](?=\s*;\s*) }{1}xmsg )==1 or die; -( $html =~ s{ https?://github.com/haukex/webperl/blob/\Kmaster/web/regex_tester.html }{gh-pages/regex.html}xmsg )==1 or die; -( $html =~ s{ \#\#\#\#\#\s*-->\n\K }{\n\n}xmsg )==1 or die; - -open my $ofh, '>:encoding(UTF-8)', $outfn or die "$outfn: $!"; -print $ofh $html; -close $ofh; diff --git a/democode/perlrunner.html b/democode/perlrunner.html index 00532be..e0362cc 100644 --- a/democode/perlrunner.html +++ b/democode/perlrunner.html @@ -39,8 +39,8 @@ If not, see http://perldoc.perl.org/index-licence.html --> - + - + +