Are we including st sources in deploy?

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

Are we including st sources in deploy?

sebastianconcept
Hi guys,

I've followed the `r.js -o dist.js` strategy to deploy as pointed here:
http://stackoverflow.com/questions/9911809/amber-smalltalk-creating-a-single-js-file-for-deployment

The resulting app.js was huge (~850KB)

I've included the same packages than amber_core plus jquery and a small app

when I've opened this "minified" file and I've saw is full of st code.

Is that expected or I am missing something?

Older Amber used to have these X.deploy.js files with js only 

Maybe I have to tell require to ignore the .st files and I didn't do that?

Here is the dist.js file I've used:

// Instructs require.js how to make an all-in-one js file for this app
({
    preserveLicenseComments: false,
    paths: {
        'jquery': 'bower_components/jquery.min',
        'amber': 'bower_components/amber/support',
        'amber_core': 'bower_components/amber/src',
        'amber_lib': 'bower_components',
        'app': 'frontend/src'
    },
    include: [
        'bower_components/amber/support/requirejs/require.min',

        'amber_core/Kernel-Objects',
        'amber_core/Kernel-Classes',
        'amber_core/Kernel-Methods',
        'amber_core/Kernel-Collections',
        'amber_core/Kernel-Infrastructure',
        'amber_core/Kernel-Exceptions',
        'amber_core/Kernel-Transcript',
        'amber_core/Kernel-Announcements',
        'amber_core/Web',

        'app/App',
    ],
    out: 'dist/js/all.js'
})







PD: by the way thanks for the post about require Phil, good stuff.



--
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: Are we including st sources in deploy?

Herby Vojčík


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

Hi guys,

I've followed the `r.js -o dist.js` strategy to deploy as pointed here:
http://stackoverflow.com/questions/9911809/amber-smalltalk-creating-a-single-js-file-for-deployment

The resulting app.js was huge (~850KB)

I've included the same packages than amber_core plus jquery and a small app

when I've opened this "minified" file and I've saw is full of st code.

Is that expected or I am missing something?

Older Amber used to have these X.deploy.js files with js only

Maybe I have to tell require to ignore the .st files and I didn't do that?

----

.st files are not included. The source is inside .js files.

----

Here is the dist.js file I've used:

// Instructs require.js how to make an all-in-one js file for this app
({
    preserveLicenseComments: false,
    paths: {
        'jquery': 'bower_components/jquery.min',
        'amber': 'bower_components/amber/support',
        'amber_core': 'bower_components/amber/src',
        'amber_lib': 'bower_components',
        'app': 'frontend/src'
    },
    include: [
        'bower_components/amber/support/requirejs/require.min',

        'amber_core/Kernel-Objects',
        'amber_core/Kernel-Classes',
        'amber_core/Kernel-Methods',
        'amber_core/Kernel-Collections',
        'amber_core/Kernel-Infrastructure',
        'amber_core/Kernel-Exceptions',
        'amber_core/Kernel-Transcript',
        'amber_core/Kernel-Announcements',
        'amber_core/Web',

        'app/App',
    ],

----

This is tedious approach, and is hardly thinkable with big apps. Better is to include exactly what you include in index.html (dependencies are looked up and added) and do not specify paths at all (except jquery which is specific case of r.js not accepting arrays in paths) but use mainConfigFile.

IOW, as 0.13 does it.

----

    out: 'dist/js/all.js'
})




PD: by the way thanks for the post about require Phil, good stuff.


--
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: Are we including st sources in deploy?

philippeback

On Mon, Sep 8, 2014 at 10:04 AM, Herby Vojčík <[hidden email]> wrote:


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

Hi guys,

I've followed the `r.js -o dist.js` strategy to deploy as pointed here:
http://stackoverflow.com/questions/9911809/amber-smalltalk-creating-a-single-js-file-for-deployment

The resulting app.js was huge (~850KB)

I've included the same packages than amber_core plus jquery and a small app

when I've opened this "minified" file and I've saw is full of st code.

Is that expected or I am missing something?

Older Amber used to have these X.deploy.js files with js only

Maybe I have to tell require to ignore the .st files and I didn't do that?

----

.st files are not included. The source is inside .js files.

----

Here is the dist.js file I've used:

// Instructs require.js how to make an all-in-one js file for this app
({
    preserveLicenseComments: false,
    paths: {
        'jquery': 'bower_components/jquery.min',
        'amber': 'bower_components/amber/support',
        'amber_core': 'bower_components/amber/src',
        'amber_lib': 'bower_components',
        'app': 'frontend/src'
    },
    include: [
        'bower_components/amber/support/requirejs/require.min',

        'amber_core/Kernel-Objects',
        'amber_core/Kernel-Classes',
        'amber_core/Kernel-Methods',
        'amber_core/Kernel-Collections',
        'amber_core/Kernel-Infrastructure',
        'amber_core/Kernel-Exceptions',
        'amber_core/Kernel-Transcript',
        'amber_core/Kernel-Announcements',
        'amber_core/Web',

        'app/App',
    ],

----

This is tedious approach, and is hardly thinkable with big apps. Better is to include exactly what you include in index.html (dependencies are looked up and added) and do not specify paths at all (except jquery which is specific case of r.js not accepting arrays in paths) but use mainConfigFile.

IOW, as 0.13 does it.

----

    out: 'dist/js/all.js'
})


Can we get a sample? Would be immensely helpful.

Phil 


PD: by the way thanks for the post about require Phil, good stuff.


--
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: Are we including st sources in deploy?

Herby Vojčík


[hidden email] wrote:

>
> On Mon, Sep 8, 2014 at 10:04 AM, Herby Vojčík <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>
>     Sebastian Sastre <[hidden email]
>     <mailto:[hidden email]>>napísal/a:
>
>     Here is the dist.js file I've used:
>
>     // Instructs require.js how to make an all-in-one js file for this app
>     ({
>          preserveLicenseComments: false,
>          paths: {
>     'jquery': 'bower_components/jquery.min',
>     'amber': 'bower_components/amber/support',
>     'amber_core': 'bower_components/amber/src',
>     'amber_lib': 'bower_components',
>     'app': 'frontend/src'
>          },
>          include: [
>     'bower_components/amber/support/requirejs/require.min',
>
>     'amber_core/Kernel-Objects',
>     'amber_core/Kernel-Classes',
>     'amber_core/Kernel-Methods',
>     'amber_core/Kernel-Collections',
>     'amber_core/Kernel-Infrastructure',
>     'amber_core/Kernel-Exceptions',
>     'amber_core/Kernel-Transcript',
>     'amber_core/Kernel-Announcements',
>     'amber_core/Web',
>
>     'app/App',
>          ],
>
>     ----
>
>     This is tedious approach, and is hardly thinkable with big apps.
>     Better is to include exactly what you include in index.html
>     (dependencies are looked up and added) and do not specify paths at
>     all (except jquery which is specific case of r.js not accepting
>     arrays in paths) but use mainConfigFile.
>
>     IOW, as 0.13 does it.
>
>     ----
>
>          out: 'dist/js/all.js'
>     })
>
>
> Can we get a sample? Would be immensely helpful.
>
> Phil

Well, thinking about it, for 0.12 with amber.js it's probably harder to
it via mainConfigFile.

0.13 was designed to use this option - amber config creates config.js
which is used both in index.html to set requirejs mappings (instead of
amber.js) and both in r.js as mainConfigFile so mappings are reused from
one generated file.

The best way is to look at 0.13 project. npm -g install
amber-cli@~0.13.0, then amber init in an empty dir (then you can npm -g
install amber-cli to get back to stable version).

In the 0.13 project, you will see app.build.js which uses config.js as
mainConfigFile, and includes should match what you use index.html
(except amber/deploy set is used in app.build.js and amber/devel is used
in index.html).

--
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: Are we including st sources in deploy?

philippeback

On Mon, Sep 8, 2014 at 10:47 AM, Herby Vojčík <[hidden email]> wrote:


[hidden email] wrote:

On Mon, Sep 8, 2014 at 10:04 AM, Herby Vojčík <[hidden email]
<mailto:[hidden email]>> wrote:



    Sebastian Sastre <[hidden email]
    <mailto:[hidden email]>>napísal/a:

    Here is the dist.js file I've used:

    // Instructs require.js how to make an all-in-one js file for this app
    ({
         preserveLicenseComments: false,
         paths: {
    'jquery': 'bower_components/jquery.min',
    'amber': 'bower_components/amber/support',
    'amber_core': 'bower_components/amber/src',
    'amber_lib': 'bower_components',
    'app': 'frontend/src'
         },
         include: [
    'bower_components/amber/support/requirejs/require.min',

    'amber_core/Kernel-Objects',
    'amber_core/Kernel-Classes',
    'amber_core/Kernel-Methods',
    'amber_core/Kernel-Collections',
    'amber_core/Kernel-Infrastructure',
    'amber_core/Kernel-Exceptions',
    'amber_core/Kernel-Transcript',
    'amber_core/Kernel-Announcements',
    'amber_core/Web',

    'app/App',
         ],

    ----

    This is tedious approach, and is hardly thinkable with big apps.
    Better is to include exactly what you include in index.html
    (dependencies are looked up and added) and do not specify paths at
    all (except jquery which is specific case of r.js not accepting
    arrays in paths) but use mainConfigFile.

    IOW, as 0.13 does it.

    ----

         out: 'dist/js/all.js'
    })


Can we get a sample? Would be immensely helpful.

Phil

Well, thinking about it, for 0.12 with amber.js it's probably harder to it via mainConfigFile.

0.13 was designed to use this option - amber config creates config.js which is used both in index.html to set requirejs mappings (instead of amber.js) and both in r.js as mainConfigFile so mappings are reused from one generated file.

The best way is to look at 0.13 project. npm -g install amber-cli@~0.13.0, then amber init in an empty dir (then you can npm -g install amber-cli to get back to stable version).

In the 0.13 project, you will see app.build.js which uses config.js as mainConfigFile, and includes should match what you use index.html (except amber/deploy set is used in app.build.js and amber/devel is used in index.html).

Makes sense. I'll try that out.

Phil 


--
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: Are we including st sources in deploy?

sebastianconcept
In reply to this post by Herby Vojčík
On Sep 8, 2014, at 5:04 AM, Herby Vojčík <[hidden email]> wrote:

Is that expected or I am missing something?


----

.st files are not included. The source is inside .js files.

The source is inside .js files?

Isn’t this a regression compared to older .deploy.js files?

I’m getting it right? In 0.13 are we calling “deploy" a process that has as output javascript code that includes smalltalk code that is never going to be used in production apps?

--
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: Are we including st sources in deploy?

Herby Vojčík
sebastian wrote:

> On Sep 8, 2014, at 5:04 AM, Herby Vojčík <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>> Is that expected or I am missing something?
>>
>>
>> ----
>>
>> .st files are not included. The source is inside .js files.
>
> The source is inside .js files?
>
> Isn’t this a regression compared to older .deploy.js files?

We dropped .deploy.js files long ago, they created complications for loading and management; .js files (without .deploy) always included source in them.


> I’m getting it right? In 0.13 are we calling “deploy" a process that
> has as output javascript code that includes smalltalk code that is
> never going to be used in production apps?

Stripping out unneeded dev data (source, class references, even runtime context) is a thing people occasionally ask for. But no one is working on that atm (maybe there is no issue for it).

Stripping sources is pretty easy with sed, even grep (really, people do it, no joke).

Stripping context
s may be a little harder, but still possible, in similar fashion.

No, even in 0.13 those strippers probably won't be available. Unless there is decision that 0.13 comes later or someone writes them soon enough.

If there is no issue for creating those deploy strippers (and integrating them in r.js workflow), then you are welcome to add it.

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

Re: Are we including st sources in deploy?

sebastianconcept
Ok got it. Thanks Herby

We really need to work on it:

Lets understand / discuss strategy first?

That workaround with grep sounds like a desperate good start, is okay for a quick good enough result. How did you do that? Any command you can share? is okay that if it’s a shameless hack, we’re learning together

Can we share experiences on this?

We need professional Amber apps guys, who is interested in pairing on this? 





On Sep 8, 2014, at 8:28 AM, Herby Vojčík <[hidden email]> wrote:


Isn’t this a regression compared to older .deploy.js files?

We dropped .deploy.js files long ago, they created complications for loading and management; .js files (without .deploy) always included source in them.


I’m getting it right? In 0.13 are we calling “deploy" a process that has as output javascript code that includes smalltalk code that is never going to be used in production apps?

Stripping out unneeded dev data (source, class references, even runtime context) is a thing people occasionally ask for. But no one is working on that atm (maybe there is no issue for it).

Stripping sources is pretty easy with sed, even grep (really, people do it, no joke).

Stripping context
s may be a little harder, but still possible, in similar fashion.

No, even in 0.13 those strippers probably won't be available. Unless there is decision that 0.13 comes later or someone writes them soon enough.

If there is no issue for creating those deploy strippers (and integrating them in r.js workflow), then you are welcome to add it.

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

Re: Are we including st sources in deploy?

philippeback

Isn't there a grep/sed like node module to do just that?

Phil

Le 8 sept. 2014 14:00, "sebastian" <[hidden email]> a écrit :
Ok got it. Thanks Herby

We really need to work on it:

Lets understand / discuss strategy first?

That workaround with grep sounds like a desperate good start, is okay for a quick good enough result. How did you do that? Any command you can share? is okay that if it’s a shameless hack, we’re learning together

Can we share experiences on this?

We need professional Amber apps guys, who is interested in pairing on this? 





On Sep 8, 2014, at 8:28 AM, Herby Vojčík <[hidden email]> wrote:


Isn’t this a regression compared to older .deploy.js files?

We dropped .deploy.js files long ago, they created complications for loading and management; .js files (without .deploy) always included source in them.


I’m getting it right? In 0.13 are we calling “deploy" a process that has as output javascript code that includes smalltalk code that is never going to be used in production apps?

Stripping out unneeded dev data (source, class references, even runtime context) is a thing people occasionally ask for. But no one is working on that atm (maybe there is no issue for it).

Stripping sources is pretty easy with sed, even grep (really, people do it, no joke).

Stripping context
s may be a little harder, but still possible, in similar fashion.

No, even in 0.13 those strippers probably won't be available. Unless there is decision that 0.13 comes later or someone writes them soon enough.

If there is no issue for creating those deploy strippers (and integrating them in r.js workflow), then you are welcome to add it.

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/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: Are we including st sources in deploy?

Herby Vojčík


[hidden email] wrote:
> Isn't there a grep/sed like node module to do just that?

shelljs or something like that exists, to emulate most of bash
capabilities in node with function call syntax.

> Phil

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

Re: Are we including st sources in deploy?

philippeback

-
Le 8 sept. 2014 14:28, "Herby Vojčík" <[hidden email]> a écrit :
>
>
>
> [hidden email] wrote:
>>
>> Isn't there a grep/sed like node module to do just that?
>
>
> shelljs or something like that exists, to emulate most of bash capabilities in node with function call syntax.

I am learning everyday on this list...

>
>> Phil
>
>
> 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/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: Are we including st sources in deploy?

sebastianconcept
In reply to this post by Herby Vojčík

On Sep 8, 2014, at 8:28 AM, Herby Vojčík <[hidden email]> wrote:

The source is inside .js files?

Isn’t this a regression compared to older .deploy.js files?

We dropped .deploy.js files long ago, they created complications for loading and management; .js files (without .deploy) always included source in them.


I’m getting it right? In 0.13 are we calling “deploy" a process that has as output javascript code that includes smalltalk code that is never going to be used in production apps?

Stripping out unneeded dev data (source, class references, even runtime context) is a thing people occasionally ask for. But no one is working on that atm (maybe there is no issue for it).


if you (anyone) care about the size of the deployables please engage in discussing what you think is the best strategy here:

thanks for caring an paying attention to this as it has an impact on the outcome of Amber apps!



--
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.