Meta tags:
description= A promise-based JavaScript library for building single-page web applications from reusable components, called gadgets.;
keywords= javascript, asynchronous;
Headings (most frequently used words):
gadget, dom, child, definition, loading, interacting, with, renderjs, concepts, instanciation, management, reference, creating, logic, root, api, automatically, triggering, code, on, tree, ancestor, preventing, write, concurrency, ready, declareservice, onevent, declarative, from, the, calling, declaregadget, method,
Text of the page (most frequently used words):
gadget (50), the (45), dom (15), script (14), #renderjs (13), html (12), child (10), definition (10), body (9), defined (8), only (8), all (7), head (7), src (7), and (7), when (7), not (6), url (6), can (6), callback (6), one (5), parent (5), changestate (5), onevent (5), declareservice (5), logic (5), element (5), this (4), which (4), reference (4), with (4), declaremethod (4), declaregadget (4), are (4), gadgets (4), css (4), state (4), executed (4), onloop (4), loads (4), rjs (4), ancestor (3), method (3), call (3), should (3), methods (3), have (3), rsvp (3), there (3), create (3), window (3), you (3), class (3), instance (3), setstate (3), javascript (3), its (3), document (3), code (3), ready (3), api (3), file (3), concepts (3), found (2), will (2), allowpublicacquisition (2), possible (2), get (2), declareacquiredmethod (2), interacting (2), been (2), calling (2), div (2), loading (2), from (2), ways (2), created (2), many (2), every (2), getdeclaredgadget (2), available (2), tree (2), default (2), change (2), needed (2), called (2), dict (2), update (2), attribute (2), object (2), must (2), done (2), onstatechange (2), manage (2), started (2), declared (2), slow (2), also (2), creation (2), has (2), calls (2), callbacks (2), copy (2), instanciate (2), instanciation (2), declarejob (2), referenced (2), minimal (2), legal, mention, 沪icp备14008524号, copyright, 2001, 2026, rights, reserved, nexedi, matching, acquisitionerror, thrown, check, until, for, access, data, url_of_the_gadget_definition, declarative, could, inside, iframe, provide, isolation, prevent, 3rd, party, destroy, pollute, global, needs, creating, never, don, know, variable, self, return, application, may, different, prevents, was, modification, key, onchangestate, take, parameter, keys, like, modifications, sequential, previous, resolved, rejected, mutex, level, acquiremethod, due, asynchronous, concurrently, modified, managing, hard, preventing, write, concurrency, allowed, modify, globally, management, fact, service, specific, event, click, submit, input, triggered, multiple, concurrent, services, attached, run, blocking, here, block, during, trigger, execution, after, automatically, triggering, built, attributes, gettitle, getpath, getrequiredjslist, getrequiredcsslist, getmethodlist, getinterfacelist, jobs, dropgadget, removed, cancelled, added, property, already, loaded, first, second, fast, url1, twice, once, generate, any, loadable, browser, bar, root, function, use, strict, var, gadget_definition, accessible, configurable, requires, generates, keep, clone, fetches, parse, new, example, contain, link, acts, documentation, interface, consists, single, dependencies, header, language, 001, version, 2020, last, home, apps, chain,
Text of the page (random words):
renderjs concepts renderjs javascript apps on a chain renderjs concepts home renderjs concepts last update 2020 06 05 version 001 language en gadget definition the definition of a renderjs gadget consists of a single html file and its js css dependencies defined in the dom header this definition is referenced by the url of the html document html can also contain a link to the gadget interface url which acts a documentation minimal example html head script src rsvp js script script src renderjs js script head body a minimal renderjs gadget body html gadget definition loading when renderjs loads a new definition url it fetches the html and parse it keep a copy of the body to clone it on every instance loads all js css defined in the head generates the class methods defined by declaremethod and declarejob gadget s logic the gadget logic is configurable in javascript only it requires you to create a file referenced by the html html head script src rsvp js script script src renderjs js script script src logic js script head body body html in the logic js file the gadget s definition is accessible by calling rjs window function rjs use strict var gadget_definition rjs window rjs the gadget s definition object api is ready declaremethod declareservice declarejob onevent onloop declareacquiredmethod allowpublicacquisition setstate onstatechange root gadget any gadget definition should be loadable in the browser url bar when done renderjs generate the gadget definition instanciate the gadget gadget instanciation loads the class definition if not already loaded if declaregadget url1 is called twice it only loads html js css once first instanciation is slow second one is fast instanciate child gadgets defined in the body copy the body on gadget element property calls setstate callbacks calls ready callbacks when gadget element is added to the dom declareservice onevent onloop are started when gadget element is removed from the dom declareservice onevent onloop are cancelled gadget api the api available on a gadget is declaregadget getdeclaredgadget dropgadget changestate all declared methods and jobs getinterfacelist getmethodlist getrequiredcsslist getrequiredjslist getpath gettitle a gadget has 2 built in attributes by default element state automatically triggering code on gadget there are 3 ways to trigger code execution after a gadget has been created ready the callback is executed during the creation of the gadget do not run slow blocking code here as it will also block the parent gadget creation declareservice the callback is executed when the gadget is attached to the document dom multiple concurrent services can be declared and executed if needed onevent the callback is in fact a service started when a specific dom event click submit change input is triggered dom management a gadget is not allowed to modify the document dom globally it should only manage its element attribute it must not manage its child gadget dom preventing dom write concurrency managing the dom of the gadget is hard due to the asynchronous logic of javascript the dom can be concurrently modified by declaremethod callback declareservice onevent onloop acquiremethod changestate is a mutex on the gadget level changestate is executed only when the previous call is resolved rejected sequential all dom modifications must be done in onstatechange gadget state attribute dict like object changestate take dict as parameter and update all gadget state keys onchangestate callback is only called by changestate and only if there was a modification on 1 key it prevents dom change if not needed default state is defined by setstate gadget s tree one gadget can have many child gadgets of different url one gadget may have one parent gadget an application is a tree of gadgets gadget s reference gadget s reference is available with declaregadget getdeclaredgadget which return a child instance on every renderjs callback the this variable is the self instance you can never get the parent gadget reference you don t know the parent gadget class creating gadget s child a gadget can create as many child gadget it needs all gadgets could be created inside an iframe to provide isolation to prevent 3rd party js css to destroy pollute the global window dom there are 2 ways to create a gadget child declarative child loading from the dom html head script src rsvp js script script src renderjs js script head body div data gadget url url_of_the_gadget_definition div body html calling declaregadget method interacting with a gadget s child a gadget should only call child methods which have been defined by declaremethod interacting with a gadget ancestor as it is not possible to get access to the parent gadget reference it is only possible to call a gadget method defined with declareacquiredmethod this will check all gadget ancestor until renderjs found one which defined a allowpublicacquisition for this method if no matching ancestor is found a acquisitionerror is thrown nexedi sa copyright c 2001 2026 all rights reserved 沪icp备14008524号 legal mention
|