New concept to test on 0.13 prerelease - devel/deploy switch

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

New concept to test on 0.13 prerelease - devel/deploy switch

Herby Vojčík
Hello,

I managed to create a structure in which index.html does not need to
change at all, even between deploy and devel version. Install 0.13 to
try it (npm -g install amber@~0.13.0).

After you run amber init, you have project in new structure nearly ready
(tl;dr: run 'npm run-script devel' to finish initialization, see below
for explanation).

The index.html now loads only one script: the.js ;-) and require()s only
one module: 'app'. Both the.js and 'app' may mean different things based
on devel/deploy scenario, so let me explain.

If you run (this is just temporary, it will be changed to use grunt) one
of these lines:

   npm run-script devel
   npm run-script deploy

then in both cases `amber config` is called first (to have current
config.js) and then the.js is generated using r.js, using either
devel.build.js or deploy.build.js. The former just bundles requirejs and
config.js into one file (and maps 'app' to 'devel', but that is
explained later). The latter does what formerly app.build.js did:
bundles everything into the.js (and maps 'app' to 'deploy').

So, index.html keeps loading the.js, but you change it to be
devel-friendly minimal one with just requirejs and config, or make it
fully-deployed application.

Now, to the 'app', which is module name that is require()d in
index.html. You may ask how you define which packages to load.
As told before, 'app' is mapped to either 'devel' or 'deploy'. In root
of the project, there are files devel.js and deploy.js. These now hold
the list of packages to load - they can be called 'sets'.

The 'deploy.js' set contains list of packages to load when app is
deployed - that is, the payload of the application itself. The
'devel.js' set contains those packages that should be loaded in
development (tests, etc.) but which should not / need not be deployed.

Both sets include amber itself ('amber/deploy' or 'amber/devel'
respectively) and 'devel' includes 'deploy'. It's best if you look into
them yourself.

So, to recap: you have two sets of packages in devel,js and deploy.js.
Whenever you add new package, you should add it to one of them. You have
also two 'modes' (given by what is included in the.js) in which you can
structure the inner of the app - you can switch between them from cli.
In devel mode, the.js contains just requirejs loader with configuration,
and 'app' module is mapped to 'devel' (so it loads 'devel.js' set). In
deploy mode, 'app' is mapped to 'deploy' and the.js contains all
dependencies of the app deploy set bundled in one file. The former is
ideal for development (app is loaded from separate files and contains
compiler etc.), the latter is ideal for deployment - you just take
index.html and the.js (and the resources, images, videos etc. are not
included in the.js; css's are if you load them via requirejs) and you're
basically done.

There is no magic behind these other than having two different build
configurations for r.js - devel.build.js and deploy.build.js, supplanted
by packages being split in two sets.

I'd like to hear from you about the idea and ideally about the
experiences working with this setup.

Herby

P.S.: What I see as added value is that you can have more pages than
index.html if you choose to - each of them would just need to load
the.js and require 'app' - only things they could be different is body
of the page and require(['app'], ...) callback. So one-page app is not
really enforced if you want it more old-school.

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Hannes Hirzel
Hello Herby

The concept looks fine but for some reason I do not get the most recent 0.13.0?

Maybe we need 0.13.1 so that we get the new version of 0.13.

--Hannes

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

> Hello,
>
> I managed to create a structure in which index.html does not need to
> change at all, even between deploy and devel version. Install 0.13 to
> try it (npm -g install amber@~0.13.0).
>
> After you run amber init, you have project in new structure nearly ready
> (tl;dr: run 'npm run-script devel' to finish initialization, see below
> for explanation).
>
> The index.html now loads only one script: the.js ;-) and require()s only
> one module: 'app'. Both the.js and 'app' may mean different things based
> on devel/deploy scenario, so let me explain.
>
> If you run (this is just temporary, it will be changed to use grunt) one
> of these lines:
>
>    npm run-script devel
>    npm run-script deploy
>
> then in both cases `amber config` is called first (to have current
> config.js) and then the.js is generated using r.js, using either
> devel.build.js or deploy.build.js. The former just bundles requirejs and
> config.js into one file (and maps 'app' to 'devel', but that is
> explained later). The latter does what formerly app.build.js did:
> bundles everything into the.js (and maps 'app' to 'deploy').
>
> So, index.html keeps loading the.js, but you change it to be
> devel-friendly minimal one with just requirejs and config, or make it
> fully-deployed application.
>
> Now, to the 'app', which is module name that is require()d in
> index.html. You may ask how you define which packages to load.
> As told before, 'app' is mapped to either 'devel' or 'deploy'. In root
> of the project, there are files devel.js and deploy.js. These now hold
> the list of packages to load - they can be called 'sets'.
>
> The 'deploy.js' set contains list of packages to load when app is
> deployed - that is, the payload of the application itself. The
> 'devel.js' set contains those packages that should be loaded in
> development (tests, etc.) but which should not / need not be deployed.
>
> Both sets include amber itself ('amber/deploy' or 'amber/devel'
> respectively) and 'devel' includes 'deploy'. It's best if you look into
> them yourself.
>
> So, to recap: you have two sets of packages in devel,js and deploy.js.
> Whenever you add new package, you should add it to one of them. You have
> also two 'modes' (given by what is included in the.js) in which you can
> structure the inner of the app - you can switch between them from cli.
> In devel mode, the.js contains just requirejs loader with configuration,
> and 'app' module is mapped to 'devel' (so it loads 'devel.js' set). In
> deploy mode, 'app' is mapped to 'deploy' and the.js contains all
> dependencies of the app deploy set bundled in one file. The former is
> ideal for development (app is loaded from separate files and contains
> compiler etc.), the latter is ideal for deployment - you just take
> index.html and the.js (and the resources, images, videos etc. are not
> included in the.js; css's are if you load them via requirejs) and you're
> basically done.
>
> There is no magic behind these other than having two different build
> configurations for r.js - devel.build.js and deploy.build.js, supplanted
> by packages being split in two sets.
>
> I'd like to hear from you about the idea and ideally about the
> experiences working with this setup.
>
> Herby
>
> P.S.: What I see as added value is that you can have more pages than
> index.html if you choose to - each of them would just need to load
> the.js and require 'app' - only things they could be different is body
> of the page and require(['app'], ...) callback. So one-page app is not
> really enforced if you want it more old-school.
>
> --
> 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/d/optout.
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Herby Vojčík


H. Hirzel wrote:
> Hello Herby
>
> The concept looks fine but for some reason I do not get the most recent 0.13.0?
>
> Maybe we need 0.13.1 so that we get the new version of 0.13.

We do not have 0.13.0 yet, even. We only have prereleases.

> --Hannes
>
> On 9/12/14, Herby Vojčík<[hidden email]>  wrote:
>> Hello,
>>
>> I managed to create a structure in which index.html does not need to
>> change at all, even between deploy and devel version. Install 0.13 to
>> try it (npm -g install amber@~0.13.0).

Ah sorry, I mean amber-cli, as in all other cases. Then running amber init to create a project.

>>
>> After you run amber init, you have project in new structure nearly ready
>> (tl;dr: run 'npm run-script devel' to finish initialization, see below
>> for explanation).
>>
>> The index.html now loads only one script: the.js ;-) and require()s only
>> one module: 'app'. Both the.js and 'app' may mean different things based
>> on devel/deploy scenario, so let me explain.
>>
>
> If you run (this is just temporary, it will be changed to use grunt) one
>> of these lines:
>>
>>     npm run-script devel
>>     npm run-script deploy
>>
>> then in both cases `amber config` is called first (to have current
>> config.js) and then the.js is generated using r.js, using either
>> devel.build.js or deploy.build.js. The former just bundles requirejs and
>> config.js into one file (and maps 'app' to 'devel', but that is
>> explained later). The latter does what formerly app.build.js did:
>> bundles everything into the.js (and maps 'app' to 'deploy').
>>
>> So, index.html keeps loading the.js, but you change it to be
>> devel-friendly minimal one with just requirejs and config, or make it
>> fully-deployed application.
>>
>> Now, to the 'app', which is module name that is require()d in
>> index.html. You may ask how you define which packages to load.
>> As told before, 'app' is mapped to either 'devel' or 'deploy'. In root
>> of the project, there are files devel
.js and deploy.js. These now hold

>> the list of packages to load - they can be called 'sets'.
>>
>> The 'deploy.js' set contains list of packages to load when app is
>> deployed - that is, the payload of the application itself. The
>> 'devel.js' set contains those packages that should be loaded in
>> development (tests, etc.) but which should not / need not be deployed.
>>
>> Both sets include amber itself ('amber/deploy' or 'amber/devel'
>> respectively) and 'devel' includes 'deploy'. It's best if you look into
>> them yourself.
>>
>> So, to recap: you have two sets of packages in devel,js and deploy.js.
>> Whenever you add new package, you should add it to one of them. You have
>> also two 'modes' (given by what is included in the.js) in which you can
>> structure the inner of the app - you can switch between them from cli.
>> In devel mode, the.js contains just requirejs loader with configuration,
>> and 'app' module is mapped to 'devel' (so it loads 'devel.js' set). In
>
> deploy mode, 'app' is mapped to 'deploy' and the.js contains all
>> dependencies of the app deploy set bundled in one file. The former is
>> ideal for development (app is loaded from separate files and contains
>> compiler etc.), the latter is ideal for deployment - you just take
>> index.html and the.js (and the resources, images, videos etc. are not
>> included in the.js; css's are if you load them via requirejs) and you're
>> basically done.
>>
>> There is no magic behind these other than having two different build
>> configurations for r.js - devel.build.js and deploy.build.js, supplanted
>> by packages being split in two sets.
>>
>> I'd like to hear from you about the idea and ideally about the
>> experiences working with this setup.
>>
>> Herby
>>
>> P.S.: What I see as added value is that you can have more pages than
>> index.html if you choose to - each of them would just need to load
>> the.js and require 'app' - only things they could be different is body
>> of th
e page and require(['app'], ...) callback. So one-page app is not

>> really enforced if you want it more old-school.
>>
>> --
>> 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/d/optout.
>>
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Hannes Hirzel
Using
    amber-cli

I do the following


Test case
--------------


npm -g install amber-cli@~0.13.0

mkdir a13b
ac a13b
amber init
--> create class Amber013TestB
npm run-script devel


I get the following index.html

----------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html>

  <head>
    <title>Amber013TestB</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="author" content="" />
    <script type='text/javascript' src='the.js'></script>
  </head>

  <body>
  <script type='text/javascript'>
      require(['app'], function (smalltalk) {
          smalltalk.initialize({
            //used for all new packages in IDE
            'transport.defaultAmdNamespace': "amber-amber013testb"
          });
      });
    </script>
    <button onclick="require('amber/helpers').globals.Browser._open()">legacy
IDE</button>
    <button onclick="require('amber/helpers').popupHelios()">Helios IDE</button>
  </body>

</html>
----------------------------------------------------------------------------------------------




amber serve

--> localhost:4000

Add class method #startUp to Amber013TestB

startUp

    'body' asJQuery append: 'hello'.



Save/commit

Add line
   smalltalk.globals.Amber013TestB._startUp();
to index.html.



--------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html>

  <head>
    <title>AmberTest13B</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="author" content="" />
    <script type='text/javascript' src='the.js'></script>
  </head>

  <body>
  <script type='text/javascript'>
      require(['app'], function (smalltalk) {
          smalltalk.initialize({
            //used for all new packages in IDE
            'transport.defaultAmdNamespace': "amber-ambertest13b"
          });
          smalltalk.globals.Amber013TestB._startUp();
      });
    </script>
    <button onclick="require('amber/helpers').globals.Browser._open()">legacy
IDE</button>
    <button onclick="require('amber/helpers').popupHelios()">Helios IDE</button>
  </body>

</html>
--------------------------------------------------------------------------------------------------------------------

Reload in the browser. Expected result is the word 'hello' appended
after the two buttons.

However the web console gives following error message

14:05:16.106 GET http://localhost:4000/ [HTTP/1.1 200 OK 4ms]
14:05:16.107 GET http://localhost:4000/the.js [HTTP/1.1 200 OK 38ms]
14:05:16.373 GET http://localhost:4000/devel.js [HTTP/1.1 200 OK 12ms]
14:05:16.375 GET http://localhost:4000/src/Amber013TestB.js [HTTP/1.1
404 Not Found 9ms]
14:05:16.273 Error: Script error for: amber-amber013testb/Amber013TestB
http://requirejs.org/docs/errors.html#scripterror the.js:7
14:05:16.376 GET
http://localhost:4000/bower_components/amber/support/devel.js
[HTTP/1.1 200 OK 38ms]
14:05:16.377 GET http://localhost:4000/deploy.js [HTTP/1.1 200 OK 43ms]
14:05:16.378 GET http://localhost:4000/src/Amber013testb-Tests.js
[HTTP/1.1 200 OK 2ms]



If I add

    require(['app', 'amber-amber013testb/Amber013TestB'], function (smalltalk) {

It still does not work.

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

>
>
> H. Hirzel wrote:
>> Hello Herby
>>
>> The concept looks fine but for some reason I do not get the most recent
>> 0.13.0?
>>
>> Maybe we need 0.13.1 so that we get the new version of 0.13.
>
> We do not have 0.13.0 yet, even. We only have prereleases.
>
>> --Hannes
>>
>> On 9/12/14, Herby Vojčík<[hidden email]>  wrote:
>>> Hello,
>>>
>>> I managed to create a structure in which index.html does not need to
>>> change at all, even between deploy and devel version. Install 0.13 to
>>> try it (npm -g install amber@~0.13.0).
>
> Ah sorry, I mean amber-cli, as in all other cases. Then running amber init
> to create a project.
>
>>>
>>> After you run amber init, you have project in new structure nearly ready
>>> (tl;dr: run 'npm run-script devel' to finish initialization, see below
>>> for explanation).
>>>
>>> The index.html now loads only one script: the.js ;-) and require()s only
>>> one module: 'app'. Both the.js and 'app' may mean different things based
>>> on devel/deploy scenario, so let me explain.
>>>
>>
>> If you run (this is just temporary, it will be changed to use grunt) one
>>> of these lines:
>>>
>>>     npm run-script devel
>>>     npm run-script deploy
>>>
>>> then in both cases `amber config` is called first (to have current
>>> config.js) and then the.js is generated using r.js, using either
>>> devel.build.js or deploy.build.js. The former just bundles requirejs and
>>> config.js into one file (and maps 'app' to 'devel', but that is
>>> explained later). The latter does what formerly app.build.js did:
>>> bundles everything into the.js (and maps 'app' to 'deploy').
>>>
>>> So, index.html keeps loading the.js, but you change it to be
>>> devel-friendly minimal one with just requirejs and config, or make it
>>> fully-deployed application.
>>>
>>> Now, to the 'app', which is module name that is require()d in
>>> index.html. You may ask how you define which packages to load.
>>> As told before, 'app' is mapped to either 'devel' or 'deploy'. In root
>>> of the project, there are files devel
> .js and deploy.js. These now hold
>>> the list of packages to load - they can be called 'sets'.
>>>
>>> The 'deploy.js' set contains list of packages to load when app is
>>> deployed - that is, the payload of the application itself. The
>>> 'devel.js' set contains those packages that should be loaded in
>>> development (tests, etc.) but which should not / need not be deployed.
>>>
>>> Both sets include amber itself ('amber/deploy' or 'amber/devel'
>>> respectively) and 'devel' includes 'deploy'. It's best if you look into
>>> them yourself.
>>>
>>> So, to recap: you have two sets of packages in devel,js and deploy.js.
>>> Whenever you add new package, you should add it to one of them. You have
>>> also two 'modes' (given by what is included in the.js) in which you can
>>> structure the inner of the app - you can switch between them from cli.
>>> In devel mode, the.js contains just requirejs loader with configuration,
>>> and 'app' module is mapped to 'devel' (so it loads 'devel.js' set). In
>>
>> deploy mode, 'app' is mapped to 'deploy' and the.js contains all
>>> dependencies of the app deploy set bundled in one file. The former is
>>> ideal for development (app is loaded from separate files and contains
>>> compiler etc.), the latter is ideal for deployment - you just take
>>> index.html and the.js (and the resources, images, videos etc. are not
>>> included in the.js; css's are if you load them via requirejs) and you're
>>> basically done.
>>>
>>> There is no magic behind these other than having two different build
>>> configurations for r.js - devel.build.js and deploy.build.js, supplanted
>>> by packages being split in two sets.
>>>
>>> I'd like to hear from you about the idea and ideally about the
>>> experiences working with this setup.
>>>
>>> Herby
>>>
>>> P.S.: What I see as added value is that you can have more pages than
>>> index.html if you choose to - each of them would just need to load
>>> the.js and require 'app' - only things they could be different is body
>>> of th
> e page and require(['app'], ...) callback. So one-page app is not
>>> really enforced if you want it more old-school.
>>>
>>> --
>>> 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/d/optout.
>>>
>>
>
> --
> 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/d/optout.
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

sebastianconcept
In reply to this post by Herby Vojčík
just tested this right now.

so switching with:

$ r.js -o devel.build.js


and:

$ r.js -o deploy.build.js 

you get the different outputs.

Man this is looking pretty solid.

the.js  <— that was great :)

what is not great, and I know we’re working on it, is the size of things…

the.js in dev was mere 19KB against 766KB of the deploy build

But in general terms, this strategy is powerful, flexible and simple enough

I might suggest a couple of comments in a PR to make it less alien to smalltalkers that are first comers to the js jungle

But again let me tell you, I’m very happy to see this move





On Sep 12, 2014, at 7:38 PM, Herby Vojčík <[hidden email]> wrote:

Hello,

I managed to create a structure in which index.html does not need to change at all, even between deploy and devel version. Install 0.13 to try it (npm -g install amber@~0.13.0).

After you run amber init, you have project in new structure nearly ready (tl;dr: run 'npm run-script devel' to finish initialization, see below for explanation).

The index.html now loads only one script: the.js ;-) and require()s only one module: 'app'. Both the.js and 'app' may mean different things based on devel/deploy scenario, so let me explain.

If you run (this is just temporary, it will be changed to use grunt) one of these lines:

 npm run-script devel
 npm run-script deploy

then in both cases `amber config` is called first (to have current config.js) and then the.js is generated using r.js, using either devel.build.js or deploy.build.js. The former just bundles requirejs and config.js into one file (and maps 'app' to 'devel', but that is explained later). The latter does what formerly app.build.js did: bundles everything into the.js (and maps 'app' to 'deploy').

So, index.html keeps loading the.js, but you change it to be devel-friendly minimal one with just requirejs and config, or make it fully-deployed application.

Now, to the 'app', which is module name that is require()d in index.html. You may ask how you define which packages to load.
As told before, 'app' is mapped to either 'devel' or 'deploy'. In root of the project, there are files devel.js and deploy.js. These now hold the list of packages to load - they can be called 'sets'.

The 'deploy.js' set contains list of packages to load when app is deployed - that is, the payload of the application itself. The 'devel.js' set contains those packages that should be loaded in development (tests, etc.) but which should not / need not be deployed.

Both sets include amber itself ('amber/deploy' or 'amber/devel' respectively) and 'devel' includes 'deploy'. It's best if you look into them yourself.

So, to recap: you have two sets of packages in devel,js and deploy.js. Whenever you add new package, you should add it to one of them. You have also two 'modes' (given by what is included in the.js) in which you can structure the inner of the app - you can switch between them from cli. In devel mode, the.js contains just requirejs loader with configuration, and 'app' module is mapped to 'devel' (so it loads 'devel.js' set). In deploy mode, 'app' is mapped to 'deploy' and the.js contains all dependencies of the app deploy set bundled in one file. The former is ideal for development (app is loaded from separate files and contains compiler etc.), the latter is ideal for deployment - you just take index.html and the.js (and the resources, images, videos etc. are not included in the.js; css's are if you load them via requirejs) and you're basically done.

There is no magic behind these other than having two different build configurations for r.js - devel.build.js and deploy.build.js, supplanted by packages being split in two sets.

I'd like to hear from you about the idea and ideally about the experiences working with this setup.

Herby

P.S.: What I see as added value is that you can have more pages than index.html if you choose to - each of them would just need to load the.js and require 'app' - only things they could be different is body of the page and require(['app'], ...) callback. So one-page app is not really enforced if you want it more old-school.

--
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/d/optout.

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Herby Vojčík


sebastian wrote:

> just tested this right now.
>
> so switching with:
>
> $ r.js -o devel.build.js
>
>
> and:
>
> $ r.js -o deploy.build.js
>
> you get the different outputs.

I changed and published some parts (amber-dev, grunt-init-amber).

If you generate the project with them (npm -g install amber-cli@^0.13 to
get them all), the project generated now does not have devel.build.js
and deploy.build.js files,  but have bigger Gruntfile.js where all this
is defined as tasks.

So to set development mode, do
   grunt devel
and to produce deployment all-in-one file, do
   grunt deploy

Herby

P.S.: Deployment is already stripped of debug context and sources.

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

sebastianconcept
thanks for the heads up, looking forward to test the new one.




On Oct 3, 2014, at 5:44 PM, Herby Vojčík <[hidden email]> wrote:

>
>
> sebastian wrote:
>> just tested this right now.
>>
>> so switching with:
>>
>> $ r.js -o devel.build.js
>>
>>
>> and:
>>
>> $ r.js -o deploy.build.js
>>
>> you get the different outputs.
>
> I changed and published some parts (amber-dev, grunt-init-amber).
>
> If you generate the project with them (npm -g install amber-cli@^0.13 to get them all), the project generated now does not have devel.build.js and deploy.build.js files,  but have bigger Gruntfile.js where all this is defined as tasks.
>
> So to set development mode, do
>  grunt devel
> and to produce deployment all-in-one file, do
>  grunt deploy
>
> Herby
>
> P.S.: Deployment is already stripped of debug context and sources.
>
> --
> 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/d/optout.

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

sebastianconcept
In reply to this post by Herby Vojčík
It’s awesome guys

Lets deploy some projects!



On Oct 3, 2014, at 5:44 PM, Herby Vojčík <[hidden email]> wrote:

>
>
> sebastian wrote:
>> just tested this right now.
>>
>> so switching with:
>>
>> $ r.js -o devel.build.js
>>
>>
>> and:
>>
>> $ r.js -o deploy.build.js
>>
>> you get the different outputs.
>
> I changed and published some parts (amber-dev, grunt-init-amber).
>
> If you generate the project with them (npm -g install amber-cli@^0.13 to get them all), the project generated now does not have devel.build.js and deploy.build.js files,  but have bigger Gruntfile.js where all this is defined as tasks.
>
> So to set development mode, do
>  grunt devel
> and to produce deployment all-in-one file, do
>  grunt deploy
>
> Herby
>
> P.S.: Deployment is already stripped of debug context and sources.
>
> --
> 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/d/optout.

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Hannes Hirzel
Yes, an important milestone is reached with this. An Amber single page
app is now usable as a single JavaScript file with everything included
in an easily accessible way.

I installed amber-cli. Did a hello World button and then

    grunt deploy

I copied the index.html and the the.js file into a deployment
directory and everything works fine.

Test with amber-cli version 0.13.0-5

https://github.com/amber-smalltalk/amber/issues/1086#issuecomment-57994416

This is the Amber version you get as of today when you do

     npm install --global amber-cli@^0.13 bower grunt-cli

Tested with Microsoft Windows 7.

It is left with fixing issue for Ubuntu 12.04


    https://github.com/amber-smalltalk/amber/issues/1085


Sebastian H (HeSe)?

--Hannes

On 10/3/14, sebastian <[hidden email]> wrote:

> It’s awesome guys
>
> Lets deploy some projects!
>
>
>
> On Oct 3, 2014, at 5:44 PM, Herby Vojčík <[hidden email]> wrote:
>
>>
>>
>> sebastian wrote:
>>> just tested this right now.
>>>
>>> so switching with:
>>>
>>> $ r.js -o devel.build.js
>>>
>>>
>>> and:
>>>
>>> $ r.js -o deploy.build.js
>>>
>>> you get the different outputs.
>>
>> I changed and published some parts (amber-dev, grunt-init-amber).
>>
>> If you generate the project with them (npm -g install amber-cli@^0.13 to
>> get them all), the project generated now does not have devel.build.js and
>> deploy.build.js files,  but have bigger Gruntfile.js where all this is
>> defined as tasks.
>>
>> So to set development mode, do
>>  grunt devel
>> and to produce deployment all-in-one file, do
>>  grunt deploy
>>
>> Herby
>>
>> P.S.: Deployment is already stripped of debug context and sources.
>>
>> --
>> 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/d/optout.
>
> --
> 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/d/optout.
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Hannes Hirzel
I re-did a test on an Ubuntu 14.04 based Linux (Linux Mint 17)

https://github.com/amber-smalltalk/amber/issues/1085#issuecomment-58012146

Assumption: Nodejs is properly installed.

The test covers
1. Installation of Amber 0.13.0-5 (alpha)
2. Creation of a project with amber amber init
3. Creation of a deployment the.js file
4. Running the deployed app

Result: OK

On 10/6/14, H. Hirzel <[hidden email]> wrote:

> Yes, an important milestone is reached with this. An Amber single page
> app is now usable as a single JavaScript file with everything included
> in an easily accessible way.
>
> I installed amber-cli. Did a hello World button and then
>
>     grunt deploy
>
> I copied the index.html and the the.js file into a deployment
> directory and everything works fine.
>
> Test with amber-cli version 0.13.0-5
>
> https://github.com/amber-smalltalk/amber/issues/1086#issuecomment-57994416
>
> This is the Amber version you get as of today when you do
>
>      npm install --global amber-cli@^0.13 bower grunt-cli
>
> Tested with Microsoft Windows 7.
>
> It is left with fixing issue for Ubuntu 12.04
>
>
>     https://github.com/amber-smalltalk/amber/issues/1085
>
>
> Sebastian H (HeSe)?
>
> --Hannes
>
> On 10/3/14, sebastian <[hidden email]> wrote:
>> It’s awesome guys
>>
>> Lets deploy some projects!
>>
>>
>>
>> On Oct 3, 2014, at 5:44 PM, Herby Vojčík <[hidden email]> wrote:
>>
>>>
>>>
>>> sebastian wrote:
>>>> just tested this right now.
>>>>
>>>> so switching with:
>>>>
>>>> $ r.js -o devel.build.js
>>>>
>>>>
>>>> and:
>>>>
>>>> $ r.js -o deploy.build.js
>>>>
>>>> you get the different outputs.
>>>
>>> I changed and published some parts (amber-dev, grunt-init-amber).
>>>
>>> If you generate the project with them (npm -g install amber-cli@^0.13 to
>>> get them all), the project generated now does not have devel.build.js
>>> and
>>> deploy.build.js files,  but have bigger Gruntfile.js where all this is
>>> defined as tasks.
>>>
>>> So to set development mode, do
>>>  grunt devel
>>> and to produce deployment all-in-one file, do
>>>  grunt deploy
>>>
>>> Herby
>>>
>>> P.S.: Deployment is already stripped of debug context and sources.
>>>
>>> --
>>> 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/d/optout.
>>
>> --
>> 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/d/optout.
>>
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

laurent laffont
In reply to this post by Herby Vojčík
Hi,

I'm a npm newbie :( I have this error (npm 2.1.3 on Arch):

sudo npm install -g amber-cli@~0.13.0
npm ERR! Linux 3.16.4-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "amber-cli@~0.13.0"
npm ERR! node v0.10.32
npm ERR! npm  v2.1.3
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: amber-cli@'>=0.13.0 <0.14.0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.0.1","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.10","0.0.11","0.12.0","0.12.1","0.12.2","0.13.0-0","0.12.3","0.13.0-1","0.13.0-2","0.13.0-3","0.13.0-4","0.13.0-5"]
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

Any idea ?

Cheers,

Laurent

Le sam. 13 sept. 2014 à 0:38, Herby Vojčík <[hidden email]> a écrit :
Hello, I managed to create a structure in which index.html does not need to change at all, even between deploy and devel version. Install 0.13 to try it (npm -g install amber@~0.13.0). After you run amber init, you have project in new structure nearly ready (tl;dr: run 'npm run-script devel' to finish initialization, see below for explanation). The index.html now loads only one script: the.js ;-) and require()s only one module: 'app'. Both the.js and 'app' may mean different things based on devel/deploy scenario, so let me explain. If you run (this is just temporary, it will be changed to use grunt) one of these lines: npm run-script devel npm run-script deploy then in both cases `amber config` is called first (to have current config.js) and then the.js is generated using r.js, using either devel.build.js or deploy.build.js. The former just bundles requirejs and config.js into one file (and maps 'app' to 'devel', but that is explained later). The latter does what formerly app.build.js did: bundles everything into the.js (and maps 'app' to 'deploy'). So, index.html keeps loading the.js, but you change it to be devel-friendly minimal one with just requirejs and config, or make it fully-deployed application. Now, to the 'app', which is module name that is require()d in index.html. You may ask how you define which packages to load. As told before, 'app' is mapped to either 'devel' or 'deploy'. In root of the project, there are files devel.js and deploy.js. These now hold the list of packages to load - they can be called 'sets'. The 'deploy.js' set contains list of packages to load when app is deployed - that is, the payload of the application itself. The 'devel.js' set contains those packages that should be loaded in development (tests, etc.) but which should not / need not be deployed. Both sets include amber itself ('amber/deploy' or 'amber/devel' respectively) and 'devel' includes 'deploy'. It's best if you look into them yourself. So, to recap: you have two sets of packages in devel,js and deploy.js. Whenever you add new package, you should add it to one of them. You have also two 'modes' (given by what is included in the.js) in which you can structure the inner of the app - you can switch between them from cli. In devel mode, the.js contains just requirejs loader with configuration, and 'app' module is mapped to 'devel' (so it loads 'devel.js' set). In deploy mode, 'app' is mapped to 'deploy' and the.js contains all dependencies of the app deploy set bundled in one file. The former is ideal for development (app is loaded from separate files and contains compiler etc.), the latter is ideal for deployment - you just take index.html and the.js (and the resources, images, videos etc. are not included in the.js; css's are if you load them via requirejs) and you're basically done. There is no magic behind these other than having two different build configurations for r.js - devel.build.js and deploy.build.js, supplanted by packages being split in two sets. I'd like to hear from you about the idea and ideally about the experiences working with this setup. Herby P.S.: What I see as added value is that you can have more pages than index.html if you choose to - each of them would just need to load the.js and require 'app' - only things they could be different is body of the page and require(['app'], ...) callback. So one-page app is not really enforced if you want it more old-school.
--
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/d/optout.

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Herby Vojčík
In reply to this post by Herby Vojčík
It worked before, but maybe sone detail in resolving ~-ranges got changed. Try install amber-cli@^0.13, that worked fine for me (but I didn't try npm 2).

Laurent <[hidden email]>napísal/a:

Hi,

I'm a npm newbie :( I have this error (npm 2.1.3 on Arch):

sudo npm install -g amber-cli@~0.13.0
npm ERR! Linux 3.16.4-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "amber-cli@~0.13.0"
npm ERR! node v0.10.32
npm ERR! npm  v2.1.3
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: amber-cli@'>=0.13.0 <0.14.0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.0.1","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.10","0.0.11","0.12.0","0.12.1","0.12.2","0.13.0-0","0.12.3","0.13.0-1","0.13.0-2","0.13.0-3","0.13.0-4","0.13.0-5"]
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

Any idea ?

Cheers,

Laurent

Le sam. 13 sept. 2014 à 0:38, Herby Vojčík <[hidden email]> a écrit :
Hello, I managed to create a structure in which index.html does not need to change at all, even between deploy and devel version. Install 0.13 to try it (npm -g install amber@~0.13.0). After you run amber init, you have project in new structure nearly ready (tl;dr: run 'npm run-script devel' to finish initialization, see below for explanation). The index.html now loads only one script: the.js ;-) and require()s only one module: 'app'. Both the.js and 'app' may mean different things based on devel/deploy scenario, so let me explain. If you run (this is just temporary, it will be changed to use grunt) one of these lines: npm run-script devel npm run-script deploy then in both cases `amber config` is called first (to have current config.js) and then the.js is generated using r.js, using either devel.build.js or deploy.build.js. The former just bundles requirejs and config.js into one file (and maps 'app' to 'devel', but that is explained later). The latter does what formerly app.build.js did: bundles everything into the.js (and maps 'app' to 'deploy'). So, index.html keeps loading the.js, but you change it to be devel-friendly minimal one with just requirejs and config, or make it fully-deployed application. Now, to the 'app', which is module name that is require()d in index.html. You may ask how you define which packages to load. As told before, 'app' is mapped to either 'devel' or 'deploy'. In root of the project, there are files devel.js and deploy.js. These now hold the list of packages to load - they can be called 'sets'. The 'deploy.js' set contains list of packages to load when app is deployed - that is, the payload of the application itself. The 'devel.js' set contains those packages that should be loaded in development (tests, etc.) but which should not / need not be deployed. Both sets include amber itself ('amber/deploy' or 'amber/devel' respectively) and 'devel' includes 'deploy'. It's best if you look into them yourself. So, to recap: you have two sets of packages in devel,js and deploy.js. Whenever you add new package, you should add it to one of them. You have also two 'modes' (given by what is included in the.js) in which you can structure the inner of the app - you can switch between them from cli. In devel mode, the.js contains just requirejs loader with configuration, and 'app' module is mapped to 'devel' (so it loads 'devel.js' set). In deploy mode, 'app' is mapped to 'deploy' and the.js contains all dependencies of the app deploy set bundled in one file. The former is ideal for development (app is loaded from separate files and contains compiler etc.), the latter is ideal for deployment - you just take index.html and the.js (and the resources, images, videos etc. are not included in the.js; css's are if you load them via requirejs) and you're basically done. There is no magic behind these other than having two different build configurations for r.js - devel.build.js and deploy.build.js, supplanted by packages being split in two sets. I'd like to hear from you about the idea and ideally about the experiences working with this setup. Herby P.S.: What I see as added value is that you can have more pages than index.html if you choose to - each of them would just need to load the.js and require 'app' - only things they could be different is body of the page and require(['app'], ...) callback. So one-page app is not really enforced if you want it more old-school.
--
You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Hannes Hirzel
Let's take this as an opportunity for a well documented installation
test on Arch Linux

https://github.com/amber-smalltalk/amber/issues/1090

Please post the full installation logs there.

As Herby notes going for the most recent alpha release of 0.13 (which
is due to be released very soon) is probably more likely to be
successfull

     sudo npm install -g amber-cli@^0.13.0 bower grunt-cli

--Hannes

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

> It worked before, but maybe sone detail in resolving ~-ranges got changed.
> Try install amber-cli@^0.13, that worked fine for me (but I didn't try npm
> 2).
>
> Laurent <[hidden email]>napísal/a:
>
>>Hi,I'manpmnewbie:(Ihavethiserror(npm2.1.3onArch):sudonpminstall-gamber-cli@~0.13.0npmERR!Linux3.16.4-1-ARCHnpmERR!argv"/usr/bin/node""/usr/bin/npm""install""-g""amber-cli@~0.13.0"npmERR!nodev0.10.32npmERR!npmv2.1.3npmERR!codeETARGETnpmERR!notargetNocompatibleversionfound:amber-cli@'=0.13.00.14.0'npmERR!notargetValidinstalltargets:npmERR!notarget["0.0.1","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.10","0.0.11","0.12.0","0.12.1","0.12.2","0.13.0-0","0.12.3","0.13.0-1","0.13.0-2","0.13.0-3","0.13.0-4","0.13.0-5"]npmERR!notargetnpmERR!notargetThisismostlikelynotaproblemwithnpmitself.npmERR!notargetInmostcasesyouoroneofyourdependenciesarerequestingnpmERR!notargetapackageversionthatdoesn'texist.Anyidea?Cheers,LaurentLesam.13sept.2014à0:38,HerbyVojčíkherby@mailbox.skaécrit:Hello,Imanagedtocreateastructureinwhichindex.htmldoesnotneedtochangeatall,evenbetweendeployanddevelversion.Install0.13totryit(npm-ginstallamber@~0.13.0).Afteryourunamberinit,youhaveprojectinnewstructurenearlyready(tl;dr:run'npmrun-scriptdevel'tofinishinitialization,seebelowforexplanation).Theindex.htmlnowloadsonlyonescript:the.js;-)andrequire()sonlyonemodule:'app'.Boththe.jsand'app'maymeandifferentthingsbasedondevel/deployscenario,soletmeexplain.Ifyourun(thisisjusttemporary,itwillbechangedtousegrunt)oneoftheselines:npmrun-scriptdevelnpmrun-scriptdeploytheninbothcases`amberconfig`iscalledfirst(tohavecurrentconfig.js)andthenthe.jsisgeneratedusingr.js,usingeitherdevel.build.jsordeploy.build.js.Theformerjustbundlesrequirejsandconfig.jsintoonefile(andmaps'app'to'devel',butthatisexplainedlater).Thelatterdoeswhatformerlyapp.build.jsdid:bundleseverythingintothe.js(andmaps'app'to'deploy').So,index.htmlkeepsloadingthe.js,butyouchangeittobedevel-friendlyminimalonewithjustrequirejsandconfig,ormakeitfully-deployedapplication.Now,tothe'app',whichismodulenamethatisrequire()dinindex.html.Youmayaskhowyoudefinewhichpackagestoload.Astoldbefore,'app'ismappedtoeither'devel'or'deploy'.Inrootoftheproject,therearefilesdevel.jsanddeploy.js.Thesenowholdthelistofpackagestoload-theycanbecalled'sets'.The'deploy.js'setcontainslistofpackagestoloadwhenappisdeployed-thatis,thepayloadoftheapplicationitself.The'devel.js'setcontainsthosepackagesthatshouldbeloadedindevelopment(tests,etc.)butwhichshouldnot/neednotbedeployed.Bothsetsincludeamberitself('amber/deploy'or'amber/devel'respectively)and'devel'includes'deploy'.It'sbestifyoulookintothemyourself.So,torecap:youhavetwosetsofpackagesindevel,jsanddeploy.js.Wheneveryouaddnewpackage,youshouldaddittooneofthem.Youhavealsotwo'modes'(givenbywhatisincludedinthe.js)inwhichyoucanstructuretheinneroftheapp-youcanswitchbetweenthemfromcli.Indevelmode,the.jscontainsjustrequirejsloaderwithconfiguration,and'app'moduleismappedto'devel'(soitloads'devel.js'set).Indeploymode,'app'ismappedto'deploy'andthe.jscontainsalldependenciesoftheappdeploysetbundledinonefile.Theformerisidealfordevelopment(appisloadedfromseparatefilesandcontainscompileretc.),thelatterisidealfordeployment-youjusttakeindex.htmlandthe.js(andtheresources,images,videosetc.arenotincludedinthe.js;css'sareifyouloadthemviarequirejs)andyou'rebasicallydone.Thereisnomagicbehindtheseotherthanhavingtwodifferentbuildconfigurationsforr.js-devel.build.jsanddeploy.build.js,supplantedbypackagesbeingsplitintwosets.I'dliketohearfromyouabouttheideaandideallyabouttheexperiencesworkingwiththissetup.HerbyP.S.:WhatIseeasaddedvalueisthatyoucanhavemorepagesthanindex.htmlifyouchooseto-eachofthemwouldjustneedtoloadthe.jsandrequire'app'-onlythingstheycouldbedifferentisbodyofthepageandrequire(['app'],...)callback.Soone-pageappisnotreallyenforcedifyouwantitmoreold-school.--YoureceivedthismessagebecauseyouaresubscribedtotheGoogleGroups"amber-lang"group.Tounsubscribefrom
>
> --
> 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/d/optout.
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: New concept to test on 0.13 prerelease - devel/deploy switch

Herby Vojčík


H. Hirzel wrote:
> Let's take this as an opportunity for a well documented installation
> test on Arch Linux
>
> https://github.com/amber-smalltalk/amber/issues/1090

I'd please not to do in the issue. Laurent's problem was about ~0.13.0 syntax failing. I'd be glad if the issue was left as only regarding that thing (and listing the solution, which it already does).

There is another issue about Linux installation problems, raised by Sebastian Heidbrink. If you want to use some issue for 'amber installation on Linux', that one is more appropriate.

Though in general my stance is, tracker issues should be about the actual problems they bring and their solutions (@HeSe's problem seemed to be the either the lack of c compiler or specifics of nodejs installation on RHEL-based distro), not about showoffs. If you really feel there should be an issue in tracker for showing the log of how installation of this-and-this version on this-and-this environment is possible, create dedicate
d one, like Installation of 0.13 amber on linux (I can create labels "how to" "installation" and "on linux"). Even better would be, if successful how-tos like this can be a pages in docs.amber-lang.net.

>
> Please post the full installation logs there.
>
> As Herby notes going for the most recent alpha release of 0.13 (which
> is due to be released very soon) is probably more likely to be
> successfull
>
>       sudo npm install -g amber-cli@^0.13.0 bower grunt-cli
>
> --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/d/optout.