Converting scripts in stacks to script only stack behaviors

Sannyasin Brahmanathaswami brahma at hindu.org
Mon Feb 6 01:40:13 EST 2017


@ trevor:  OK, understood. In fact we are doing a similar/ almost same thing though calling it "SivaSiva.json"  which is read on start up, 

re the stack files for the components: interesting… 

We have been adding *all* behaviors for all modules in the main stack, since many of these are reused by controls in different modules/components, but I can see if we externalize the *entire* stack script of a component as a behavior then, your layout is obviously the way to do it. Thanks for that! I have been thinking about this already this past week and wasn't clear, Levure shows the way forward… I’ll download 9 asap.

@ Mike

I think we may not be on the same page. There is certainly no "one file" for the entire project. Both in our SivaSiva app we have many "modules" aka "components" in Trevor's framework ("views" in a MVC way of looking at it) … OTOH  some modules benefit by having one more UI's on the same card, or at least different cards in the same stack.

Yeah.. I use to worry about the array of folder and files, but believe me, we have it pretty straight forward. Trevor's Levure and our new app are surprisingly close. Actually Ralf's RevIgniter was there way ahead of us…

 if you think about it there are only a few classes of objects, so you don't have to make it too complex:

assets # images, sound, text files, video, info files.
behaviors # code you may want to assign to controls in many different contexts
config # start up defaults store as plain text/json/yaml/ LC arrays whatever… 
libraries # code you want accessible everywhere all the time.
models  # re-usable code for doing "work/jobs"
modules  (aka components or "views")  # stacks users actually see
SuperApp.livecode # the "loader" stack

I don't think that is too much of a "jumble"  doesn't it add some obvious clarity?  If you want to "see" your app, open the components folder that's where the UI/views lives.… and this kind of frame work has a strong track record in web apps, CodeIgniter (PHP)  so it is well proven for usability.  

Anyway, the ability to diff previous commits and cross reference and "cherry pick" from other  branches has already saved me headaches in so many ways I can't ever go back.

AS for scary jumble snake pit, just expand some html5 apps, some of them are *really* scary. I unwrapped a Ionic app last month done in Angular2; it has 20,000+ files! Yikes! Of course this is like seeing the entire LC engine IDE files set right alongside your own, but with LiveCode we don’t' have to do that.

BR

On 2/5/17, 6:04 PM, "use-livecode on behalf of Trevor DeVore via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:

    I'm referring to the app.yml file here. The app.yml file is what ties
    together all of the files in the application folder into a single
    application. It is where you specify which libraries, frontscripts,
    backscripts, and other stacks make up the application. If I add a new UI
    stack named "Prompt User Prior to Delete" no other stack files will be
    modified. The only file that might be updated is the app.yml file and that
    is unlikely as well. In the app.yml file you can specify that the contents
    of a specific folder are components and Levure will treat all of the
    contents of that folder as such.
    
    



More information about the Use-livecode mailing list