How do I create my own package in the right place and retrieve it later?

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

How do I create my own package in the right place and retrieve it later?

Hannes Hirzel
Hello again

I created my own package in the most recent commit [1] as described here
    http://stackoverflow.com/questions/18641294/how-do-i-add-a-new-package

However there are two problems

a) The compiled js code shows

    define("amber_core/HH2", ["amber_vm/smalltalk", "amber_vm/nil",
"amber_vm/_st",
    "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){

    smalltalk.addPackage('HH2');
    smalltalk.packages["HH2"].transport =
{"type":"amd","amdNamespace":"amber_core"};

    smalltalk.addClass('Couchdb', smalltalk.Object, [], 'HH2');


    It should not be placed in the amber_core. [1] How do I do that?
    Herby suggested in the thread _st.js of today that I should not
put it into the amber
    name space at all.

b) After restarting the amber server the HH2 package is no longer
there. I assume I have
    to require it at the right place. Where is that place?

Regards
Hannes



[1] https://github.com/amber-smalltalk/amber/commit/834ecb8c4afc24e057eb9f5b973101bf5e7abea5

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Herby Vojčík


H. Hirzel wrote:

> Hello again
>
> I created my own package in the most recent commit [1] as described here
> http://stackoverflow.com/questions/18641294/how-do-i-add-a-new-package
>
> However there are two problems
>
> a) The compiled js code shows
>
> define("amber_core/HH2", ["amber_vm/smalltalk", "amber_vm/nil",
> "amber_vm/_st",
> "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
>
> smalltalk.addPackage('HH2');
> smalltalk.packages["HH2"].transport =
> {"type":"amd","amdNamespace":"amber_core"};
>
> smalltalk.addClass('Couchdb', smalltalk.Object, [], 'HH2');
>
>
> It should not be placed in the amber_core. [1] How do I do that?
> Herby suggested in the thread _st.js of today that I should not
> put it into the amber
> name space at all.
>
> b) After restarting the amber server the HH2 package is no longer
> there. I assume I have
> to require it at the right place. Where is that place?

Let me first answer this, because here lies the root of fixing a)>

You started `amber serve` in amber directory itself; this is the first
problem I see. If you write your own app or library (that is, not part
of Amber itself), you should have it in your own directory; you should
also start `amber serve` from that directory (or using `amber serve
--base-path ...`, but I personally just run it without args from the
right directory.

In that directory, you should create your own index.html, which will
serve a base page which loads in your browser; you should load Amber
from its placement (remote URL or a path to where you amber is located,
like ../amber/support/amber.js - it's completely upon you where you put
amber (after release of 0.l2.0 the actual version will be in bower and
npm so you can as well have amber as a dependency in your project); and
along with amber, you should load any other packages you want to load
with it.

So, to answer b), your packages should be loaded from your project's
index.html. So if you create new one, you should then add it manually
into your project's index.html.


Now, back to a).

Each namespace, beyond being a logical name to distinguish "packs" of
amber code between themselves, has a very practical role while loading
an amber project - it is mapped to certain path / URL, all
my_namespace/xxx are then loaded from path_mapped_from_my_namespace/xxx.js.

So, to answer a), yes, you should have your own namespace; you should
choose itl and you should put the right path mapping into your project's
index.html (mappings of amber, amber_core, amber_vm etc. are done for
you in amber.js).

All newly created packages are save into one specific namespace, called
default namespace. You set up which namespace is the default namespace
in, surprise :-), your project's index.html.

The whole process is documented in wiki page "Making my first app" or
something like that in amber wiki. If you want to see the working
example, look at http://github.com/herby/trapped

> Regards
> Hannes

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Hannes Hirzel
On 9/6/13, Herby Vojčík <[hidden email]> wrote:

>
>
> H. Hirzel wrote:
>> Hello again
>>
>> I created my own package in the most recent commit [1] as described here
>> http://stackoverflow.com/questions/18641294/how-do-i-add-a-new-package
>>
>> However there are two problems
>>
>> a) The compiled js code shows
>>
>> define("amber_core/HH2", ["amber_vm/smalltalk", "amber_vm/nil",
>> "amber_vm/_st",
>> "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
>>
>> smalltalk.addPackage('HH2');
>> smalltalk.packages["HH2"].transport =
>> {"type":"amd","amdNamespace":"amber_core"};
>>
>> smalltalk.addClass('Couchdb', smalltalk.Object, [], 'HH2');
>>
>>
>> It should not be placed in the amber_core. [1] How do I do that?
>> Herby suggested in the thread _st.js of today that I should not
>> put it into the amber
>> name space at all.
>>
>> b) After restarting the amber server the HH2 package is no longer
>> there. I assume I have
>> to require it at the right place. Where is that place?
>
> Let me first answer this, because here lies the root of fixing a)>
>
> You started `amber serve` in amber directory itself; this is the first
> problem I see. If you write your own app or library (that is, not part
> of Amber itself), you should have it in your own directory; you should
> also start `amber serve` from that directory (or using `amber serve
> --base-path ...`, but I personally just run it without args from the
> right directory.
>
> In that directory, you should create your own index.html, which will
> serve a base page which loads in your browser; you should load Amber
> from its placement (remote URL or a path to where you amber is located,
> like ../amber/support/amber.js - it's completely upon you where you put
> amber (after release of 0.l2.0 the actual version will be in bower and
> npm so you can as well have amber as a dependency in your project); and
> along with amber, you should load any other packages you want to load
> with it.
>
> So, to answer b), your packages should be loaded from your project's
> index.html. So if you create new one, you should then add it manually
> into your project's index.html.
>
>
> Now, back to a).
>
> Each namespace, beyond being a logical name to distinguish "packs" of
> amber code between themselves, has a very practical role while loading
> an amber project - it is mapped to certain path / URL, all
> my_namespace/xxx are then loaded from path_mapped_from_my_namespace/xxx.js.
>
> So, to answer a), yes, you should have your own namespace; you should
> choose itl and you should put the right path mapping into your project's
> index.html (mappings of amber, amber_core, amber_vm etc. are done for
> you in amber.js).
>
> All newly created packages are save into one specific namespace, called
> default namespace. You set up which namespace is the default namespace
> in, surprise :-), your project's index.html.
>
> The whole process is documented in wiki page "Making my first app" or
> something like that in amber wiki. If you want to see the working
> example, look at http://github.com/herby/trapped
>
>> Regards
>> Hannes
>
> Herby
>


Thank you for the explanations. Below I describe how I follow them
exactly as far as I can see.
However there is a path problem and amber hello does not work.

I have the setup recommended in

https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app

Layout of directories and some files

amber
    support
        amber.js
    requirejs
        require.min.js
    bin
       amber.bat

projects
    hello
       js
       st
       index.html


I start the server from within the projects directory

    C:\Users\User\Documents\projects>..\amber\bin\amber serve
   Warning: project directory does not contain index.html
   Warning: project directory is missing an "st" directory
   Warning: project directory is missing a "js" directory
   Starting file server on http://127.0.0.1:4000

The warnings confused me first but this is what the wiki page says.

http://localhost:4000/hello/index.html

brings up an amber hello page indeed. BUT it does not work.

In the web console of Firefox I have

[16:29:02.141] GET http://localhost:4000/hello/index.html [HTTP/1.1 200 OK 0ms]
[16:29:02.219] GET
http://localhost:4000/amber/support/requirejs/require.min.js [HTTP/1.1
404 Not Found 0ms]
[16:29:02.220] GET http://localhost:4000/amber/support/amber.js
[HTTP/1.1 404 Not Found 0ms]
[16:29:02.221] GET http://localhost:4000/amber/support/amber.js
[HTTP/1.1 404 Not Found 0ms]



My index.html in the hello directory starts with

<!DOCTYPE html>
<html>
  <head>
    <title>My First Amber Project</title>
    <script src="../../amber/support/requirejs/require.min.js"></script>
    <script src="../../amber/support/amber.js"></script>
    <script type="text/javascript">
      require.config({ paths: {
        'com_example_hello': 'js', //mapping compiled .js files
        'com_example_hello/_source': 'st' //mapping smalltalk source files
      }});

I adapted the path for amber.js and requirejs, I think the path given
in https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
is wrong.


Having the hello directory as a sibling of the amber directory
(bypassing the projects directory) and going for

http://localhost:4000/index.html

does not work either.

What am I missing?

--Hannes

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Herby Vojčík


H. Hirzel wrote:
> On 9/6/13, Herby Vojčík<[hidden email]> wrote:
>>
>> H. Hirzel wrote:
> I adapted the path for amber.js and requirejs, I think the path given
> in https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
> is wrong.

I fixed the path already.

> What am I missing?

Nothing. I did not realize that the layout must be done so that the
server must be able to actually serve amber (which is not possible if it
is started in projects directory). I changed the layout in the wiki page
so amber is actually inside the served subtree.

> --Hannes

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Hannes Hirzel
Herby, following your updated instructions on
https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app

I have the directory layout

projects/vendor/amber/
projects/hello
projects/hello/st
projects/hello/js

I start the server with

C:\Users\User\Documents\projects>vendor\amber\bin\amber serve
Warning: project directory does not contain index.html
Warning: project directory is missing an "st" directory
Warning: project directory is missing a "js" directory
Starting file server on http://127.0.0.1:4000


I navigate to

    http://localhost:4000/hello/index.html

in the web browser.

The result is better in terms of loaded files. However the class
browser does not show up and the 'say hello' button does not work.
(see log copied in below)

   What works as before is if I navigate to
   http://localhost:4000/vendor/amber/index.html

--Hannes

[17:39:49.979] GET http://localhost:4000/hello/index.html [HTTP/1.1 200 OK 0ms]
[17:39:49.980] GET http://localhost:4000/vendor/amber/support/amber.js
[HTTP/1.1 200 OK 15ms]
[17:39:49.981] GET
http://localhost:4000/vendor/amber/support/requirejs/require.min.js
[HTTP/1.1 200 OK 15ms]
[17:39:50.370] GET http://localhost:4000/vendor/amber/support/devel.js
[HTTP/1.1 200 OK 0ms]
[17:39:50.371] GET
http://localhost:4000/vendor/amber/support/smalltalk.js [HTTP/1.1 200
OK 0ms]
[17:39:50.371] GET
http://localhost:4000/vendor/amber/support/jQuery/jquery-1.8.2.min.js
[HTTP/1.1 200 OK 16ms]
[17:39:50.372] GET
http://localhost:4000/vendor/amber/support/requirejs/require-css-0.0.6/css.js
[HTTP/1.1 200 OK 0ms]
[17:39:50.373] GET
http://localhost:4000/vendor/amber/js/Kernel-Objects.js [HTTP/1.1 200
OK 16ms]
[17:39:50.373] GET
http://localhost:4000/vendor/amber/js/Kernel-Classes.js [HTTP/1.1 200
OK 16ms]
[17:39:50.374] GET
http://localhost:4000/vendor/amber/js/Kernel-Methods.js [HTTP/1.1 200
OK 16ms]
[17:39:50.375] GET
http://localhost:4000/vendor/amber/js/Kernel-Collections.js [HTTP/1.1
200 OK 16ms]
[17:39:50.376] GET
http://localhost:4000/vendor/amber/js/Kernel-Infrastructure.js
[HTTP/1.1 200 OK 16ms]
[17:39:50.377] GET
http://localhost:4000/vendor/amber/js/Kernel-Exceptions.js [HTTP/1.1
200 OK 16ms]
[17:39:50.378] GET
http://localhost:4000/vendor/amber/js/Kernel-Transcript.js [HTTP/1.1
200 OK 32ms]
[17:39:50.378] GET
http://localhost:4000/vendor/amber/js/Kernel-Announcements.js
[HTTP/1.1 200 OK 32ms]
[17:39:50.379] GET http://localhost:4000/vendor/amber/js/Canvas.js
[HTTP/1.1 200 OK 32ms]
[17:39:50.380] GET http://localhost:4000/vendor/amber/js/SUnit.js
[HTTP/1.1 200 OK 32ms]
[17:39:50.380] GET
http://localhost:4000/vendor/amber/js/Importer-Exporter.js [HTTP/1.1
200 OK 32ms]
[17:39:50.381] GET
http://localhost:4000/vendor/amber/js/Compiler-Exceptions.js [HTTP/1.1
200 OK 32ms]
[17:39:50.382] GET
http://localhost:4000/vendor/amber/js/Compiler-Core.js [HTTP/1.1 200
OK 32ms]
[17:39:50.382] GET
http://localhost:4000/vendor/amber/js/Compiler-AST.js [HTTP/1.1 200 OK
32ms]
[17:39:50.383] GET
http://localhost:4000/vendor/amber/js/Compiler-Semantic.js [HTTP/1.1
200 OK 47ms]
[17:39:50.384] GET
http://localhost:4000/vendor/amber/js/Compiler-IR.js [HTTP/1.1 200 OK
47ms]
[17:39:50.385] GET
http://localhost:4000/vendor/amber/js/Compiler-Inlining.js [HTTP/1.1
200 OK 47ms]
[17:39:50.385] GET
http://localhost:4000/vendor/amber/js/Compiler-Interpreter.js
[HTTP/1.1 200 OK 47ms]
[17:39:50.386] GET
http://localhost:4000/vendor/amber/js/Compiler-Tests.js [HTTP/1.1 200
OK 47ms]
[17:39:50.387] GET
http://localhost:4000/vendor/amber/support/parser.js [HTTP/1.1 200 OK
47ms]
[17:39:50.387] GET http://localhost:4000/vendor/amber/js/IDE.js
[HTTP/1.1 200 OK 63ms]
[17:39:50.388] GET http://localhost:4000/vendor/amber/js/Examples.js
[HTTP/1.1 200 OK 63ms]
[17:39:50.389] GET http://localhost:4000/vendor/amber/js/Benchfib.js
[HTTP/1.1 200 OK 63ms]
[17:39:50.389] GET
http://localhost:4000/vendor/amber/js/Kernel-Tests.js [HTTP/1.1 200 OK
63ms]
[17:39:50.390] GET
http://localhost:4000/vendor/amber/js/SUnit-Tests.js [HTTP/1.1 200 OK
63ms]
[17:39:50.390] GET http://localhost:4000/vendor/amber/js/HH2.js
[HTTP/1.1 200 OK 63ms]
[17:39:50.368] Unknown property 'box-sizing'.  Declaration dropped. @
http://localhost:4000/hello/index.html
[17:39:51.130] GET http://localhost:4000/vendor/amber/support/nil.js
[HTTP/1.1 200 OK 0ms]
[17:39:51.130] GET http://localhost:4000/vendor/amber/support/_st.js
[HTTP/1.1 200 OK 0ms]
[17:39:51.131] GET http://localhost:4000/vendor/amber/support/boot.js
[HTTP/1.1 200 OK 15ms]
[17:39:51.132] GET
http://localhost:4000/vendor/amber/support/jQuery/jquery-ui-1.8.16.custom.min.js
[HTTP/1.1 200 OK 15ms]
[17:39:51.202] GET
http://localhost:4000/vendor/amber/support/requirejs/require-css-0.0.6/normalize.js
[HTTP/1.1 200 OK 0ms]
[17:39:51.203] GET
http://localhost:4000/vendor/amber/support/browser-compatibility.js
[HTTP/1.1 200 OK 0ms]
[17:39:51.204] GET
http://localhost:4000/vendor/amber/support/jQuery/jquery.textarea.js
[HTTP/1.1 200 OK 0ms]
[17:39:51.205] GET
http://localhost:4000/vendor/amber/support/CodeMirror/theme/ambiance.css
[HTTP/1.1 200 OK 0ms]
[17:39:51.205] GET
http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.css
[HTTP/1.1 200 OK 0ms]
[17:39:51.206] GET
http://localhost:4000/vendor/amber/support/CodeMirror/amber.css
[HTTP/1.1 200 OK 0ms]
[17:39:51.207] GET http://localhost:4000/vendor/amber/css/amber.css
[HTTP/1.1 200 OK 16ms]
[17:39:51.207] GET
http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css
[HTTP/1.1 200 OK 16ms]
[17:39:51.174] Unknown property '-moz-box-shadow'.  Declaration
dropped. @ http://localhost:4000/vendor/amber/support/CodeMirror/theme/ambiance.css:48
[17:39:51.178] Unknown property '-moz-box-shadow'.  Declaration
dropped. @ http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.css:11
[17:39:51.186] Expected declaration but found '*'.  Skipped to next
declaration. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:159
[17:39:51.186] Expected declaration but found '*'.  Skipped to next
declaration. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:160
[17:39:51.186] Unknown property '-moz-border-radius'.  Declaration
dropped. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:173
[17:39:51.187] Expected declaration but found '*'.  Skipped to next
declaration. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:239
[17:39:51.211] GET
http://localhost:4000/vendor/amber/support/ensure-console.js [HTTP/1.1
200 OK 0ms]
[17:39:51.212] GET
http://localhost:4000/vendor/amber/support/es5-shim-2.0.2/es5-shim.min.js
[HTTP/1.1 200 OK 16ms]
[17:39:51.213] GET
http://localhost:4000/vendor/amber/support/es5-shim-2.0.2/es5-sham.min.js
[HTTP/1.1 200 OK 16ms]
[17:39:51.507] GET
http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.js
[HTTP/1.1 200 OK 0ms]
[17:39:51.570] GET
http://localhost:4000/vendor/amber/support/CodeMirror/smalltalk.js
[HTTP/1.1 200 OK 0ms]
[17:39:51.571] GET
http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.js
[HTTP/1.1 200 OK 0ms]

On 9/6/13, Herby Vojčík <[hidden email]> wrote:

>
>
> H. Hirzel wrote:
>> On 9/6/13, Herby Vojčík<[hidden email]> wrote:
>>>
>>> H. Hirzel wrote:
>> I adapted the path for amber.js and requirejs, I think the path given
>> in https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
>> is wrong.
>
> I fixed the path already.
>
>> What am I missing?
>
> Nothing. I did not realize that the layout must be done so that the
> server must be able to actually serve amber (which is not possible if it
> is started in projects directory). I changed the layout in the wiki page
> so amber is actually inside the served subtree.
>
>> --Hannes
>
> Herby
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Herby Vojčík
I don't know. Everything seems to be nicely loaded.

Do you have the browser starting in the callback function in require call?

What happens if you try to run it from the console (use 'require("amber_vm/smalltalk").' in place of 'smalltalk.')?

Herby

H. Hirzel wrote:

> Herby, following your updated instructions on
> https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
>
> I have the directory layout
>
> projects/vendor/amber/
> projects/hello
> projects/hello/st
> projects/hello/js
>
> I start the server with
>
> C:\Users\User\Documents\projects>vendor\amber\bin\amber serve
> Warning: project directory does not contain index.html
> Warning: project directory is missing an "st" directory
> Warning: project directory is missing a "js" directory
> Starting file server on http://127.0.0.1:4000
>
>
> I navigate to
>
>      http://localhost:4000/hello/index.html
>
> in the web browser.
>
> The result is better in terms of loaded files. However the class
> browser do
es not show up and the 'say hello' button does not work.

> (see log copied in below)
>
>     What works as before is if I navigate to
>     http://localhost:4000/vendor/amber/index.html
>
> --Hannes
>
> [17:39:49.979] GET http://localhost:4000/hello/index.html [HTTP/1.1 200 OK 0ms]
> [17:39:49.980] GET http://localhost:4000/vendor/amber/support/amber.js
> [HTTP/1.1 200 OK 15ms]
> [17:39:49.981] GET
> http://localhost:4000/vendor/amber/support/requirejs/require.min.js
> [HTTP/1.1 200 OK 15ms]
> [17:39:50.370] GET http://localhost:4000/vendor/amber/support/devel.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:50.371] GET
> http://localhost:4000/vendor/amber/support/smalltalk.js [HTTP/1.1 200
> OK 0ms]
> [17:39:50.371] GET
> http://localhost:4000/vendor/amber/support/jQuery/jquery-1.8.2.min.js
> [HTTP/1.1 200 OK 16ms]
> [17:39:50.372] GET
> http://localhost:4000/vendor/amber/support/requirejs/require-css-0.0.6/css.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:50.373] GET
> http://localhost:4000/vendo
r/amber/js/Kernel-Objects.js [HTTP/1.1 200

> OK 16ms]
> [17:39:50.373] GET
> http://localhost:4000/vendor/amber/js/Kernel-Classes.js [HTTP/1.1 200
> OK 16ms]
> [17:39:50.374] GET
> http://localhost:4000/vendor/amber/js/Kernel-Methods.js [HTTP/1.1 200
> OK 16ms]
> [17:39:50.375] GET
> http://localhost:4000/vendor/amber/js/Kernel-Collections.js [HTTP/1.1
> 200 OK 16ms]
> [17:39:50.376] GET
> http://localhost:4000/vendor/amber/js/Kernel-Infrastructure.js
> [HTTP/1.1 200 OK 16ms]
> [17:39:50.377] GET
> http://localhost:4000/vendor/amber/js/Kernel-Exceptions.js [HTTP/1.1
> 200 OK 16ms]
> [17:39:50.378] GET
> http://localhost:4000/vendor/amber/js/Kernel-Transcript.js [HTTP/1.1
> 200 OK 32ms]
> [17:39:50.378] GET
> http://localhost:4000/vendor/amber/js/Kernel-Announcements.js
> [HTTP/1.1 200 OK 32ms]
> [17:39:50.379] GET http://localhost:4000/vendor/amber/js/Canvas.js
> [HTTP/1.1 200 OK 32ms]
> [17:39:50.380] GET http://localhost:4000/vendor/amber/js/SUnit.js
> [HTTP/1.1 200 OK 32ms
]

> [17:39:50.380] GET
> http://localhost:4000/vendor/amber/js/Importer-Exporter.js [HTTP/1.1
> 200 OK 32ms]
> [17:39:50.381] GET
> http://localhost:4000/vendor/amber/js/Compiler-Exceptions.js [HTTP/1.1
> 200 OK 32ms]
> [17:39:50.382] GET
> http://localhost:4000/vendor/amber/js/Compiler-Core.js [HTTP/1.1 200
> OK 32ms]
> [17:39:50.382] GET
> http://localhost:4000/vendor/amber/js/Compiler-AST.js [HTTP/1.1 200 OK
> 32ms]
> [17:39:50.383] GET
> http://localhost:4000/vendor/amber/js/Compiler-Semantic.js [HTTP/1.1
> 200 OK 47ms]
> [17:39:50.384] GET
> http://localhost:4000/vendor/amber/js/Compiler-IR.js [HTTP/1.1 200 OK
> 47ms]
> [17:39:50.385] GET
> http://localhost:4000/vendor/amber/js/Compiler-Inlining.js [HTTP/1.1
> 200 OK 47ms]
> [17:39:50.385] GET
> http://localhost:4000/vendor/amber/js/Compiler-Interpreter.js
> [HTTP/1.1 200 OK 47ms]
> [17:39:50.386] GET
> http://localhost:4000/vendor/amber/js/Compiler-Tests.js [HTTP/1.1 200
> OK 47ms]
> [17:39:50.387] GET
> http://localhos
t:4000/vendor/amber/support/parser.js [HTTP/1.1 200 OK

> 47ms]
> [17:39:50.387] GET http://localhost:4000/vendor/amber/js/IDE.js
> [HTTP/1.1 200 OK 63ms]
> [17:39:50.388] GET http://localhost:4000/vendor/amber/js/Examples.js
> [HTTP/1.1 200 OK 63ms]
> [17:39:50.389] GET http://localhost:4000/vendor/amber/js/Benchfib.js
> [HTTP/1.1 200 OK 63ms]
> [17:39:50.389] GET
> http://localhost:4000/vendor/amber/js/Kernel-Tests.js [HTTP/1.1 200 OK
> 63ms]
> [17:39:50.390] GET
> http://localhost:4000/vendor/amber/js/SUnit-Tests.js [HTTP/1.1 200 OK
> 63ms]
> [17:39:50.390] GET http://localhost:4000/vendor/amber/js/HH2.js
> [HTTP/1.1 200 OK 63ms]
> [17:39:50.368] Unknown property 'box-sizing'.  Declaration dropped. @
> http://localhost:4000/hello/index.html
> [17:39:51.130] GET http://localhost:4000/vendor/amber/support/nil.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.130] GET http://localhost:4000/vendor/amber/support/_st.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.131] GET http://localhost:4000/vend
or/amber/support/boot.js

> [HTTP/1.1 200 OK 15ms]
> [17:39:51.132] GET
> http://localhost:4000/vendor/amber/support/jQuery/jquery-ui-1.8.16.custom.min.js
> [HTTP/1.1 200 OK 15ms]
> [17:39:51.202] GET
> http://localhost:4000/vendor/amber/support/requirejs/require-css-0.0.6/normalize.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.203] GET
> http://localhost:4000/vendor/amber/support/browser-compatibility.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.204] GET
> http://localhost:4000/vendor/amber/support/jQuery/jquery.textarea.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.205] GET
> http://localhost:4000/vendor/amber/support/CodeMirror/theme/ambiance.css
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.205] GET
> http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.css
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.206] GET
> http://localhost:4000/vendor/amber/support/CodeMirror/amber.css
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.207] GET http://localhost:4000/vendor/amber/css/amber.css
> [HTTP/1.1 200 OK 16m
s]

> [17:39:51.207] GET
> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css
> [HTTP/1.1 200 OK 16ms]
> [17:39:51.174] Unknown property '-moz-box-shadow'.  Declaration
> dropped. @ http://localhost:4000/vendor/amber/support/CodeMirror/theme/ambiance.css:48
> [17:39:51.178] Unknown property '-moz-box-shadow'.  Declaration
> dropped. @ http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.css:11
> [17:39:51.186] Expected declaration but found '*'.  Skipped to next
> declaration. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:159
> [17:39:51.186] Expected declaration but found '*'.  Skipped to next
> declaration. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:160
> [17:39:51.186] Unknown property '-moz-border-radius'.  Declaration
> dropped. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:173
> [17:39:51.187] Expected declaration but found '*'.  Skipped to next
> declara
tion. @ http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:239

> [17:39:51.211] GET
> http://localhost:4000/vendor/amber/support/ensure-console.js [HTTP/1.1
> 200 OK 0ms]
> [17:39:51.212] GET
> http://localhost:4000/vendor/amber/support/es5-shim-2.0.2/es5-shim.min.js
> [HTTP/1.1 200 OK 16ms]
> [17:39:51.213] GET
> http://localhost:4000/vendor/amber/support/es5-shim-2.0.2/es5-sham.min.js
> [HTTP/1.1 200 OK 16ms]
> [17:39:51.507] GET
> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.570] GET
> http://localhost:4000/vendor/amber/support/CodeMirror/smalltalk.js
> [HTTP/1.1 200 OK 0ms]
> [17:39:51.571] GET
> http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.js
> [HTTP/1.1 200 OK 0ms]
>
> On 9/6/13, Herby Vojčík<[hidden email]>  wrote:
>>
>> H. Hirzel wrote:
>>> On 9/6/13, Herby Vojčík<[hidden email]>  wrote:
>>>> H. Hirzel wrote:
>>> I adapted the path for amber.js and requir
ejs, I think the path given

>>> in https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
>>> is wrong.
>> I fixed the path already.
>>
>>> What am I missing?
>> Nothing. I did not realize that the layout must be done so that the
>> server must be able to actually serve amber (which is not possible if it
>> is started in projects directory). I changed the layout in the wiki page
>> so amber is actually inside the served subtree.
>>
>>> --Hannes
>> Herby
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "amber-lang" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [hidden email].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Herby Vojčík
In reply to this post by Hannes Hirzel


H. Hirzel wrote:
> [17:39:50.390] GET http://localhost:4000/vendor/amber/js/HH2.js
> [HTTP/1.1 200 OK 63ms]

BTW Why do you load HH2 from amber location? It should not be there.

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Hannes Hirzel
In reply to this post by Herby Vojčík
On 9/6/13, Herby Vojčík <[hidden email]> wrote:
> I don't know. Everything seems to be nicely loaded.
>
> Do you have the browser starting in the callback function in require call?

No, I just copied the html page from the wiki page.

Adding
      smalltalk.Browser._open()
to the call back of the require function brings the browser up when
loading the page.
GREAT.
So it seems to be an issue of the button 'class browser' not working
in Firefox 23.

Thank you for your help.


<!DOCTYPE html>
<html>
  <head>
    <title>My First Amber Project</title>
    <script src="../vendor/amber/support/amber.js"></script>
    <script src="../vendor/amber/support/requirejs/require.min.js"></script>
    <script type="text/javascript">
      require.config({ paths: {
        'com_example_hello': 'js', //mapping compiled .js files
        'com_example_hello/_source': 'st' //mapping smalltalk source files
      }});
      require(['amber/devel'], function (smalltalk) {
        smalltalk.defaultAMDNamespace = "com_example_hello"; //used
for all new packages in IDE
        smalltalk.initialize();
       smalltalk.Browser._open();    //  +++ ADDED +++
      });
    </script>
  </head>
  <body>
    <article>
      <h1>My First Amber Project</h1>
      <button onclick="smalltalk.Browser._open()">class browser</button>
      <button id="sayHello">say hello</button>
    </article>
  </body>
</html>



>
> What happens if you try to run it from the console (use
> 'require("amber_vm/smalltalk").' in place of 'smalltalk.')?
>
> Herby
>
> H. Hirzel wrote:
>> Herby, following your updated instructions on
>> https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
>>
>> I have the directory layout
>>
>> projects/vendor/amber/
>> projects/hello
>> projects/hello/st
>> projects/hello/js
>>
>> I start the server with
>>
>> C:\Users\User\Documents\projects>vendor\amber\bin\amber serve
>> Warning: project directory does not contain index.html
>> Warning: project directory is missing an "st" directory
>> Warning: project directory is missing a "js" directory
>> Starting file server on http://127.0.0.1:4000
>>
>>
>> I navigate to
>>
>>      http://localhost:4000/hello/index.html
>>
>> in the web browser.
>>
>> The result is better in terms of loaded files. However the class
>> browser do
> es not show up and the 'say hello' button does not work.
>> (see log copied in below)
>>
>>     What works as before is if I navigate to
>>     http://localhost:4000/vendor/amber/index.html
>>
>> --Hannes
>>
>> [17:39:49.979] GET http://localhost:4000/hello/index.html [HTTP/1.1 200 OK
>> 0ms]
>> [17:39:49.980] GET http://localhost:4000/vendor/amber/support/amber.js
>> [HTTP/1.1 200 OK 15ms]
>> [17:39:49.981] GET
>> http://localhost:4000/vendor/amber/support/requirejs/require.min.js
>> [HTTP/1.1 200 OK 15ms]
>> [17:39:50.370] GET http://localhost:4000/vendor/amber/support/devel.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:50.371] GET
>> http://localhost:4000/vendor/amber/support/smalltalk.js [HTTP/1.1 200
>> OK 0ms]
>> [17:39:50.371] GET
>> http://localhost:4000/vendor/amber/support/jQuery/jquery-1.8.2.min.js
>> [HTTP/1.1 200 OK 16ms]
>> [17:39:50.372] GET
>> http://localhost:4000/vendor/amber/support/requirejs/require-css-0.0.6/css.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:50.373] GET
>> http://localhost:4000/vendo
> r/amber/js/Kernel-Objects.js [HTTP/1.1 200
>> OK 16ms]
>> [17:39:50.373] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Classes.js [HTTP/1.1 200
>> OK 16ms]
>> [17:39:50.374] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Methods.js [HTTP/1.1 200
>> OK 16ms]
>> [17:39:50.375] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Collections.js [HTTP/1.1
>> 200 OK 16ms]
>> [17:39:50.376] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Infrastructure.js
>> [HTTP/1.1 200 OK 16ms]
>> [17:39:50.377] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Exceptions.js [HTTP/1.1
>> 200 OK 16ms]
>> [17:39:50.378] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Transcript.js [HTTP/1.1
>> 200 OK 32ms]
>> [17:39:50.378] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Announcements.js
>> [HTTP/1.1 200 OK 32ms]
>> [17:39:50.379] GET http://localhost:4000/vendor/amber/js/Canvas.js
>> [HTTP/1.1 200 OK 32ms]
>> [17:39:50.380] GET http://localhost:4000/vendor/amber/js/SUnit.js
>> [HTTP/1.1 200 OK 32ms
> ]
>> [17:39:50.380] GET
>> http://localhost:4000/vendor/amber/js/Importer-Exporter.js [HTTP/1.1
>> 200 OK 32ms]
>> [17:39:50.381] GET
>> http://localhost:4000/vendor/amber/js/Compiler-Exceptions.js [HTTP/1.1
>> 200 OK 32ms]
>> [17:39:50.382] GET
>> http://localhost:4000/vendor/amber/js/Compiler-Core.js [HTTP/1.1 200
>> OK 32ms]
>> [17:39:50.382] GET
>> http://localhost:4000/vendor/amber/js/Compiler-AST.js [HTTP/1.1 200 OK
>> 32ms]
>> [17:39:50.383] GET
>> http://localhost:4000/vendor/amber/js/Compiler-Semantic.js [HTTP/1.1
>> 200 OK 47ms]
>> [17:39:50.384] GET
>> http://localhost:4000/vendor/amber/js/Compiler-IR.js [HTTP/1.1 200 OK
>> 47ms]
>> [17:39:50.385] GET
>> http://localhost:4000/vendor/amber/js/Compiler-Inlining.js [HTTP/1.1
>> 200 OK 47ms]
>> [17:39:50.385] GET
>> http://localhost:4000/vendor/amber/js/Compiler-Interpreter.js
>> [HTTP/1.1 200 OK 47ms]
>> [17:39:50.386] GET
>> http://localhost:4000/vendor/amber/js/Compiler-Tests.js [HTTP/1.1 200
>> OK 47ms]
>> [17:39:50.387] GET
>> http://localhos
> t:4000/vendor/amber/support/parser.js [HTTP/1.1 200 OK
>> 47ms]
>> [17:39:50.387] GET http://localhost:4000/vendor/amber/js/IDE.js
>> [HTTP/1.1 200 OK 63ms]
>> [17:39:50.388] GET http://localhost:4000/vendor/amber/js/Examples.js
>> [HTTP/1.1 200 OK 63ms]
>> [17:39:50.389] GET http://localhost:4000/vendor/amber/js/Benchfib.js
>> [HTTP/1.1 200 OK 63ms]
>> [17:39:50.389] GET
>> http://localhost:4000/vendor/amber/js/Kernel-Tests.js [HTTP/1.1 200 OK
>> 63ms]
>> [17:39:50.390] GET
>> http://localhost:4000/vendor/amber/js/SUnit-Tests.js [HTTP/1.1 200 OK
>> 63ms]
>> [17:39:50.390] GET http://localhost:4000/vendor/amber/js/HH2.js
>> [HTTP/1.1 200 OK 63ms]
>> [17:39:50.368] Unknown property 'box-sizing'.  Declaration dropped. @
>> http://localhost:4000/hello/index.html
>> [17:39:51.130] GET http://localhost:4000/vendor/amber/support/nil.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.130] GET http://localhost:4000/vendor/amber/support/_st.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.131] GET http://localhost:4000/vend
> or/amber/support/boot.js
>> [HTTP/1.1 200 OK 15ms]
>> [17:39:51.132] GET
>> http://localhost:4000/vendor/amber/support/jQuery/jquery-ui-1.8.16.custom.min.js
>> [HTTP/1.1 200 OK 15ms]
>> [17:39:51.202] GET
>> http://localhost:4000/vendor/amber/support/requirejs/require-css-0.0.6/normalize.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.203] GET
>> http://localhost:4000/vendor/amber/support/browser-compatibility.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.204] GET
>> http://localhost:4000/vendor/amber/support/jQuery/jquery.textarea.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.205] GET
>> http://localhost:4000/vendor/amber/support/CodeMirror/theme/ambiance.css
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.205] GET
>> http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.css
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.206] GET
>> http://localhost:4000/vendor/amber/support/CodeMirror/amber.css
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.207] GET http://localhost:4000/vendor/amber/css/amber.css
>> [HTTP/1.1 200 OK 16m
> s]
>> [17:39:51.207] GET
>> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css
>> [HTTP/1.1 200 OK 16ms]
>> [17:39:51.174] Unknown property '-moz-box-shadow'.  Declaration
>> dropped. @
>> http://localhost:4000/vendor/amber/support/CodeMirror/theme/ambiance.css:48
>> [17:39:51.178] Unknown property '-moz-box-shadow'.  Declaration
>> dropped. @
>> http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.css:11
>> [17:39:51.186] Expected declaration but found '*'.  Skipped to next
>> declaration. @
>> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:159
>> [17:39:51.186] Expected declaration but found '*'.  Skipped to next
>> declaration. @
>> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:160
>> [17:39:51.186] Unknown property '-moz-border-radius'.  Declaration
>> dropped. @
>> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:173
>> [17:39:51.187] Expected declaration but found '*'.  Skipped to next
>> declara
> tion. @
> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.css:239
>> [17:39:51.211] GET
>> http://localhost:4000/vendor/amber/support/ensure-console.js [HTTP/1.1
>> 200 OK 0ms]
>> [17:39:51.212] GET
>> http://localhost:4000/vendor/amber/support/es5-shim-2.0.2/es5-shim.min.js
>> [HTTP/1.1 200 OK 16ms]
>> [17:39:51.213] GET
>> http://localhost:4000/vendor/amber/support/es5-shim-2.0.2/es5-sham.min.js
>> [HTTP/1.1 200 OK 16ms]
>> [17:39:51.507] GET
>> http://localhost:4000/vendor/amber/support/CodeMirror/codemirror.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.570] GET
>> http://localhost:4000/vendor/amber/support/CodeMirror/smalltalk.js
>> [HTTP/1.1 200 OK 0ms]
>> [17:39:51.571] GET
>> http://localhost:4000/vendor/amber/support/CodeMirror/addon/hint/show-hint.js
>> [HTTP/1.1 200 OK 0ms]
>>
>> On 9/6/13, Herby Vojčík<[hidden email]>  wrote:
>>>
>>> H. Hirzel wrote:
>>>> On 9/6/13, Herby Vojčík<[hidden email]>  wrote:
>>>>> H. Hirzel wrote:
>>>> I adapted the path for amber.js and requir
> ejs, I think the path given
>>>> in https://github.com/amber-smalltalk/amber/wiki/Writing-my-first-app
>>>> is wrong.
>>> I fixed the path already.
>>>
>>>> What am I missing?
>>> Nothing. I did not realize that the layout must be done so that the
>>> server must be able to actually serve amber (which is not possible if it
>>> is started in projects directory). I changed the layout in the wiki page
>>> so amber is actually inside the served subtree.
>>>
>>>> --Hannes
>>> Herby
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "amber-lang" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to [hidden email].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: How do I create my own package in the right place and retrieve it later?

Herby Vojčík
> So it seems to be an issue of the button 'class browser' not working
> in Firefox 23.

Not working anywhere. It should have shown "Reference Error: smalltalk not defined" in the console when pressed. Fixed now.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.