Stupid question - how to configure JS libs so they show up in the class browser

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

Stupid question - how to configure JS libs so they show up in the class browser

aglynn42
I have managed to get most things working, however I haven't figured out how to configure JS libs I'm using so that they show up in the class browser. 

Having worked mainly in Smalltalk, Java and Objective C I'm unused to the very manual interactions between npm, bower, grunt and the Amber layer.

thanks
Andrew

--
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: Stupid question - how to configure JS libs so they show up in the class browser

Herby Vojčík


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

I have managed to get most things working, however I haven't figured out how to configure JS libs I'm using so that they show up in the class browser.  

You can't. Only Smalltalk classes and packages appear in Class Browser.

You gey to JS libs in using their JS way of access (though you can write it using Smalltalk notation). For libs that play nice with amd, you map them in your require.config (you can put as many mappings in paths section as you wish, it is not meant just for your Smalltalk packages of your project, but for all libs you use) and in code you write the JS require('amd/path/to/lib') in Smalltalk as (require value: 'amd/path/to/lib'). If the lib does not play nice with amd (though many of them do using shim: exports: thing), they then very probably export some global variable, just use it as-is in Smalltalk code (well, you must work around if it contains $ or _, but it is just a matter of defining some accessor method with body <return idWith$andOr_>).

Oh, and do not forget to mention the mapped libs in require(['amber/devel', ...1], function (amber) { ...2 }); call in ...1 part. Do not load JS libs by <script> tag if possible, integrate them in amd loader. It will then make deployment easier later when we make Amber project ready for r.js optimizer and include amber config stuff - they are all amd-heavy.

Having worked mainly in Smalltalk, Java and Objective C I'm unused to the very manual interactions between npm, bower, grunt and the Amber

Forget grunt. Bower just conveniently gets all dependencies for you, which is nice. Npm is same thing for development tooling.

 layer.
thanks
Andrew
--
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: Stupid question - how to configure JS libs so they show up in the class browser

aglynn42
Thanks very much.  Sometimes a negative insight (that there's nothing to know in a particular area) helps more than anything else :).

Andrew

On Saturday, June 7, 2014 11:16:08 AM UTC-5, Herby wrote:

Andrew Glynn <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="uGniY1jBBW8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">agly...@...>napísal/a:

I have managed to get most things working, however I haven't figured out how to configure JS libs I'm using so that they show up in the class browser.  

You can't. Only Smalltalk classes and packages appear in Class Browser.

You gey to JS libs in using their JS way of access (though you can write it using Smalltalk notation). For libs that play nice with amd, you map them in your require.config (you can put as many mappings in paths section as you wish, it is not meant just for your Smalltalk packages of your project, but for all libs you use) and in code you write the JS require('amd/path/to/lib') in Smalltalk as (require value: 'amd/path/to/lib'). If the lib does not play nice with amd (though many of them do using shim: exports: thing), they then very probably export some global variable, just use it as-is in Smalltalk code (well, you must work around if it contains $ or _, but it is just a matter of defining some accessor method with body <return idWith$andOr_>).

Oh, and do not forget to mention the mapped libs in require(['amber/devel', ...1], function (amber) { ...2 }); call in ...1 part. Do not load JS libs by <script> tag if possible, integrate them in amd loader. It will then make deployment easier later when we make Amber project ready for r.js optimizer and include amber config stuff - they are all amd-heavy.

Having worked mainly in Smalltalk, Java and Objective C I'm unused to the very manual interactions between npm, bower, grunt and the Amber

Forget grunt. Bower just conveniently gets all dependencies for you, which is nice. Npm is same thing for development tooling.

 layer.
thanks
Andrew
--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="uGniY1jBBW8J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">amber-lang+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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.