diff --git a/pwiki2.js b/pwiki2.js index a3f24c4..814ea36 100755 --- a/pwiki2.js +++ b/pwiki2.js @@ -1,21 +1,18 @@ /********************************************************************** * * -* XXX BUG CHROME: can't .get(..) a generator... -* affected code: -* BaseStore's .get(..) -* bug report: -* https://bugs.chromium.org/p/chromium/issues/detail?id=1361981 -* when done test: -* .get('/test/list/generator').asPages() -* .get('/test/list/generator').raw -* .get('/test/list/generator').data -* .get('/test/list/generator').text -* potential temporaty fix: -* wrap all .__get__(..) call in an async function testing if -* it's return value is a generator function (return) or anything -* else (await)... +* XXX Q: can we access fs from a pwa??? +* XXX start writing docs in pwiki +* - WYSIWYG markdown editor/viewer (ASAP) +* - fs store/export in browser * XXX CACHE need to explicitly prevent caching of some actions/pages... +* XXX the parser should handle all action return values, including: +* - lists -- XXX +* - iterators -- XXX +* - strings -- DONE +* - numbers -- DONE +* - misc: +* dates -- ??? * XXX FEATURE tags and accompanying API... * - add tags to page -- macro/filter * - .text -> .tags (cached on .update(..)) @@ -32,7 +29,25 @@ * i.e. a way to pass tags through path... * /some/path:tags=a,b,c * XXX FEATURE images... -* XXX might be fun to push the async parts of the render to the dom... +* XXX BUG CHROME: can't .get(..) a generator... +* affected code: +* BaseStore's .get(..) +* bug report: +* https://bugs.chromium.org/p/chromium/issues/detail?id=1361981 +* when done test: +* .get('/test/list/generator').asPages() +* .get('/test/list/generator').raw +* .get('/test/list/generator').data +* .get('/test/list/generator').text +* potential temporaty fix: +* wrap all .__get__(..) call in an async function testing if +* it's return value is a generator function (return) or anything +* else (await)... +* XXX rename?? +* System -> .system +* Config -> .pwiki +* XXX async/live render... +* might be fun to push the async parts of the render to the dom... * ...i.e. return a partially rendered DOM with handlers to fill * in the blanks wen they are ready... * something like: @@ -45,15 +60,18 @@ * @include(./path ..) * -> * XXX prevent paths from using reserved chars like: ":", "#", ... -* XXX OPTIMIZE CACHE match pattern paths -- to catch page creation... +* XXX OPTIMIZE CACHE catch page creation -- match pattern path... * 1) explicit subpath matching -- same as .match(..) * 2) identify recursive patterns -- same as ** * XXX Q: empty title??? * - special default name * a timestamp or some thing similar * this can be hidden until changed by user +* - do we split .name/.path and .title??? +* ...since pWiki is a wiki, the system-level answer is NO. * XXX do we need something like /System/Actions/.. for fast actions called * in the same way as direct page actions??? +* ...experiment?? * XXX FEATURE list macro paging... * ...should this be macro level or handled in .each() * what mode? @@ -86,9 +104,10 @@ * XXX OPTIMIZE might be a good idea to make some methods that only access * the index sync -- this will make the store unusable while indexing * though... -* XXX OPTIMIZE might be a good idea to move stuff down the stack to Store: +* XXX OPTIMIZE load pages in packs... +* might be a good idea to move stuff down the stack to Store: * .each() -> .store.each() -* ...this will enable ups to optimize page loading on a store +* ...this will enable us to optimize page loading on a store * level... * ...another approach would be to make .get(..) accept a list of * paths and return an iterator... @@ -106,7 +125,7 @@ * e.g. when searching for xxx/tree the only "tree" available is * System/tree, and if it is overloaded it's now a question of * picking one out of two and not out of tens generated by .paths() -* XXX OPTIMIZE CACHE track store changes... +* XXX OPTIMIZE CACHE track store (external) changes... * XXX OPTIMIZE CACHE/DEPENDS might be a good idea to add a dependencyUpdated event... * ...and use it for cache invalidation... * XXX OPTIMIZE NORMCACHE .normalize(..) cache normalized strings... @@ -143,17 +162,9 @@ * 2) all the macros that can source pages to produce generators (DONE) * XXX might be a good idea to parse a page into an executable/function * that would render self in a given context... -* XXX the parser should handle all action return values, including: -* - lists -- DONE -* - iterators -- DONE -* - strings -- DONE -* - numbers -- DONE -* - misc: -* dates -- ??? * XXX BUG: .move(..) behaves in an odd way... * see: System/move page action * ...deletes the original and moves an empty page -- sync error??? -* XXX DELETE ./delete is triggered twice... * XXX differences in behaviour between _abc and abc, either need to make * them the same or document the differences and the reasons behind * them... @@ -164,24 +175,20 @@ * - make filters run a bit more globaly -- per block... * - find a local parser... * XXX introspection: -* /stores +* /stores -- DONE * list stores... -* /info +* /info -- DONE? * list page/store info -* /storage +* /storage -- XXX * list storage usage / limits * XXX BUG: FF: conflict between object.run and PouchDB... -* XXX add action to reset overloaded (bootstrap) pages... +* XXX add action to reset overloaded (bootstrap/.next) pages... * - per page * - global -* XXX Q: can we access fs from a pwa??? -* ...looks like no :| -* XXX DEPENDS @now() makes the template uncachable, to we actually need it??? * XXX CHECK: @macro(..) and @slot(..) must overload in the same way... * XXX DEPENDS/CACHE @macro(..) introduces a dependency on count (pattern) * ...not sure how we track these... * XXX revise how we handle .strict mode in page's .raw and .text... -* XXX NEXT might be a good idea to add an API to restore page(s) from .next... * * * @@ -201,7 +208,7 @@ * - page actions * - delete -- DONE * - copy/move -- DONE -* - resolved (async) -- +* - resolved (async) -- DONE * - migrate/rewrite bootstrap -- * - store topology -- DONE * - sync and sync conf -- @@ -271,26 +278,35 @@ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * Architecture: -* store -* page -* renderer +* +* store +* ^ +* | +* page <--> renderer +* ^ +* | +* client +* +* * * Modules: -* page - base pages and page APIs (XXX should this be in lib???) -* parser - pWiki macro parser (XXX should this be in lib???) -* store - stores -* base - memory store and store utils -* file - file storage -* localstorage - localStorage / sessionStorage stores -* pouchdb - -* ... -* filter - page filters -* base - base filters incl. wikiword -* markdown - markdown renderer -* ... -* pwiki2 - main cli / node entry point -* browser - browser entry point -* pwiki2-test - testing and experimenting (XXX move to test.js) +* pwiki/ +* page - base pages and page APIs +* parser - pWiki macro parser +* path - base path API +* store/ - stores +* base - memory store and store API and utils +* file - file store +* localstorage - localStorage / sessionStorage stores +* pouchdb - PouchDB store +* ... +* filter/ - page filters +* base - base filters incl. wikiword +* markdown - markdown renderer +* ... +* pwiki2 - main cli / node entry point +* browser - browser entry point +* pwiki2-test - testing and experimenting (XXX move to test.js) * * * Q: can we make this a single module with +/- some plugins??