Oscar Nierstrasz wrote:
> Hi folks,
>
> I am trying to get RoassalAmber to run in Amber 0.12. The problem is that the original code did not use namespaces, so the compiled JS files are missing this information. What is the right way to proceed?
>
> - re-compile the st files with amberc? [didn't work I just got a mysterious 30330 error code]
Recompile is the right way.
There's a "migration from 0.11" section in changelog, pasting:
* Migration from Amber 0.11.0
First, the loading of JavaScript files must be adapted. The custom loader has been replaced with
requirejs for loading files in the browser. New loader code is thouroughly
explained in [4].
After updating the loader part, `.st` files need to be recompiled
into new AMD `.js` files. During loader changes, a namespace was choosen and will be needed for recompilation.
Go to your directory with `.st` files and issue this from the shell:
```sh
<path-to-amber>/bin/amberc -l SUnit,Canvas -n <chosen-namespace> -D <path-f
or-compiled-js-files> *.st
```
In windows, use `\` as path separator, the rest is identical.
The `-l SUnit,Canvas` is just a general guess, if your code depends on more (or less) non-kernel packages from amber, list them here accordingly.
This migrate scenario only covers simple deployments with your project's code and amber.
If your project is more complicated, using libraries and packages from multiple sources,
it is hard to give general advices to migrate - you must do it library by library,
giving each location its own namespace, and `-L` option of `amberc`
comes handy when integrating; ask on the mailing list if problems arise.
[1]
http://requirejs.org/
[2]
http://bower.io/
[3]
https://github.com/amber-smalltalk/brikz
[4]
https://github.com/amber-smalltalk/amber/wiki/How-to-load-amber
> - filein the st files one by one? [didn't work. JavaScript exception: TypeError: Cannot read property 'fn' of null]
> - write a perl script to patch the JS files, adding the missing
namespace information? [didn't try this yet]
>
> There is a probably an easy way I have not thought of yet. Any hints are welcome.
>
> Oscar
Herby