Migrating pier experiences

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Migrating pier experiences

Stephan Eggermont-3
Diego and I are looking at migrating the moose site to a newer pier.
We use the PierCodeExporter for that.
The moose site is a pretty old pier (Pier1 on Pharo 1.0rc1 10492). It doesn’t have grease loaded.
The exporter doesn’t use a lot of grease functionality.
We could have tried loading Grease, but decided to just copy paste
the functionality needed.
  http://smalltalkhub.com/mc/Pier/Pier3Addons/main/Pier-Exporter1-DiegoLont.1.mcz

Then the compilation fails because there are too many news entries,
resulting in a method that is too large to compile.
In PRKernelCodeExporter>>writeCodeFor: structure
we changed the repeated
  structure addChild: (self newsABCD: aKernel).
to an array of selectors with a perform: loop.

+ stream << ' #('.
+ structure enumerator do: [ :each | stream << ' #''' << (each asSelector) << ':''' ] separatedBy: [ stream cr ].
+ stream << ' ) do: [ :each | ' << String cr << ' structure addChild: (self perform: each with: aKernel) ].' << String cr.
-
- structure enumerator do: [ :each |
- stream << ' structure addChild: (self ' << (each asSelector) << ': aKernel).' << String cr ].

This was enough for moose, but needs method splitting for larger sites.
  http://smalltalkhub.com/mc/Pier/Pier3Addons/main/Pier-Exporter-Code-DiegoLont.55.mcz

With this we are able to generate the code. Next step is loading in a newer Pier.

to be continued.
  Stephan
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Migrating pier experiences

Stephan Eggermont-3
So the next steps are (after updating and moving a few packages):

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3/main';
 package: 'ConfigurationOfPier3';
 load.

(Smalltalk at: #ConfigurationOfPier3) load.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Moose/Fame/main';
 package: 'ConfigurationOfFame';
 load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/ObjectProfile/Roassal/main';
 package: 'ConfigurationOfRoassal';
 load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
 url: 'http://smalltalkhub.com/mc/RMoD/Citezen/main';
 package: 'ConfigurationOfCitezen';
 load.
 
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3Addons/main';
 package: 'Pier-Blog';
 package: 'Pier-Documents';
 package: 'Pier-Exporter-Code';
 package: 'Pier-JQuery';
 package: 'Pier-Google';
 package: 'Pier-Fame';
 package: 'TopFeeder-Pier-Widgets';
 load.

" manually load exported code "
" roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DamienCassou.29' "

PRKernelCreatorForPier register
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [Moose-dev] Re: Migrating pier experiences

Tudor Girba-2
Brilliant!

Thanks a lot,
Doru


On Tue, Feb 4, 2014 at 11:16 AM, Stephan Eggermont <[hidden email]> wrote:
So the next steps are (after updating and moving a few packages):

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3/main';
 package: 'ConfigurationOfPier3';
 load.

(Smalltalk at: #ConfigurationOfPier3) load.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Moose/Fame/main';
 package: 'ConfigurationOfFame';
 load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/ObjectProfile/Roassal/main';
 package: 'ConfigurationOfRoassal';
 load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
 url: 'http://smalltalkhub.com/mc/RMoD/Citezen/main';
 package: 'ConfigurationOfCitezen';
 load.

((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

Gofer new
 url: 'http://www.smalltalkhub.com/mc/Pier/Pier3Addons/main';
 package: 'Pier-Blog';
 package: 'Pier-Documents';
 package: 'Pier-Exporter-Code';
 package: 'Pier-JQuery';
 package: 'Pier-Google';
 package: 'Pier-Fame';
 package: 'TopFeeder-Pier-Widgets';
 load.

" manually load exported code "
" roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DamienCassou.29' "

PRKernelCreatorForPier register
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--

"Every thing has its own flow"

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [Moose-dev] Migrating pier experiences

DiegoLont
In reply to this post by Stephan Eggermont-3
Hi all,

Load script below still should be made nicer (using the ConfigurationOfPier3Addons), but for now this gives a reasonable result. There are a few notes:
- you should not forget to copy the files. Preferable before creating the Pier instance.
- there are still some does not understands in Citizen, because there are no accessors to build this tree. If someone can give me rights to this, I will add the accessors needed.
- pier3 requires {{{ }}} to embed html. This is not converted, and gives some flaky results.
- testing the site, shows that some parts do not work yet, because some of the used components do not work in Pier3.

Export script:
" Load exporter code "
Gofer new
package: 'Pier-Exporter-Code';
load.

" Check the kernel name, for moose-technology this was the default (pier) "
(Smalltalk at: #PRKernelCodeExporter) exportAsPier3Kernel: 'pier'.

self doStuffInComment.
" Save exported code with Monticello "

Import script: (tested in a fresh pharo 2.0, tailored to work for the moose-technology website, as it loads the used packages for this website.)
" Load Pier"
Gofer new
package: 'ConfigurationOfPier3';
load.

(Smalltalk at: #ConfigurationOfPier3) load.

" Load things we need for some of the extensions "
Gofer new
package: 'ConfigurationOfFame';
load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
package: 'ConfigurationOfRoassal';
load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
package: 'ConfigurationOfCitezen';
load.
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

" Load Pier extensions "
Gofer new
package: 'Pier-Blog';
package: 'Pier-Documents';
package: 'Pier-Exporter-Code';
package: 'Pier-JQuery';
package: 'Pier-Google';
package: 'Pier-Fame';
package: 'TopFeeder-Pier-Widgets';
package: 'Pier-Randomizer';
load.

self doStuffInComment.
" manually do the following things 
- load exported code
- roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DiegoLont.27'
- Copy the folder '/files' to the (resource folder of the) new image or configure Magritte-External-FileModel to point to the right place.
"

" remove old occurrences: "
PRKernel reset.
" and load and register the new one: "
PRKernelCreatorForPier register

Diego


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [Moose-dev] Re: Migrating pier experiences

Tudor Girba-2
Great work.

When we see things that are not supported in Pier3, we will remove it altogether. For example, Citezen will not be used anymore. It was only for publications, but it is not important enough to warrant the overhead.

I want to rework the site completely. We will only use the contexts for some of the existing parts, and ditch those that are not useful anymore.

Doru




On Tue, Feb 4, 2014 at 11:51 AM, Diego Lont <[hidden email]> wrote:
Hi all,

Load script below still should be made nicer (using the ConfigurationOfPier3Addons), but for now this gives a reasonable result. There are a few notes:
- you should not forget to copy the files. Preferable before creating the Pier instance.
- there are still some does not understands in Citizen, because there are no accessors to build this tree. If someone can give me rights to this, I will add the accessors needed.
- pier3 requires {{{ }}} to embed html. This is not converted, and gives some flaky results.
- testing the site, shows that some parts do not work yet, because some of the used components do not work in Pier3.

Export script:
" Load exporter code "
package: 'Pier-Exporter-Code';
load.

" Check the kernel name, for moose-technology this was the default (pier) "
(Smalltalk at: #PRKernelCodeExporter) exportAsPier3Kernel: 'pier'.

self doStuffInComment.
" Save exported code with Monticello "

Import script: (tested in a fresh pharo 2.0, tailored to work for the moose-technology website, as it loads the used packages for this website.)
" Load Pier"
Gofer new
package: 'ConfigurationOfPier3';
load.

(Smalltalk at: #ConfigurationOfPier3) load.

" Load things we need for some of the extensions "
Gofer new
package: 'ConfigurationOfFame';
load.

((Smalltalk at: #ConfigurationOfFame) project version: '1.2') load: 'Core'.

Gofer new
package: 'ConfigurationOfRoassal';
load.

(Smalltalk at: #ConfigurationOfRoassal) project latestVersion load.

Gofer new
package: 'ConfigurationOfCitezen';
load.
((Smalltalk at: #ConfigurationOfCitezen) version: '2.1') load: 'Web'.

" Load Pier extensions "
Gofer new
package: 'Pier-Blog';
package: 'Pier-Documents';
package: 'Pier-Exporter-Code';
package: 'Pier-JQuery';
package: 'Pier-Google';
package: 'Pier-Fame';
package: 'TopFeeder-Pier-Widgets';
package: 'Pier-Randomizer';
load.

self doStuffInComment.
" manually do the following things 
- load exported code
- roll back Magritte-Exernal-FileModel to version 'Magritte-Pharo-Model-DiegoLont.27'
- Copy the folder '/files' to the (resource folder of the) new image or configure Magritte-External-FileModel to point to the right place.
"

" remove old occurrences: "
PRKernel reset.
" and load and register the new one: "
PRKernelCreatorForPier register

Diego


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki