Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-08-23 11:27:20 +03:00
parent 01f7295da2
commit ae355de7b3
2 changed files with 26 additions and 2 deletions

View File

@ -50,6 +50,11 @@ module = {
// NOTE: trailing/leading '/' are represented by '' at end/start of
// path list...
normalize: function(path='.', format='auto'){
/*/ XXX RENORMALIZE...
// do not re-normalize...
if(path.normalized && format != 'array'){
return path }
//*/
format = format == 'auto' ?
(path instanceof Array ?
'array'
@ -83,11 +88,21 @@ module = {
return res }, [])
return format == 'string' ?
// special case: root -> keep '/'
/*/ XXX RENORMALIZE...
Object.assign(
new String((root
&& path.length == 1
&& path[0] == '') ?
('/'+ path.join('/'))
: path.join('/')),
{normalized: true})
/*/
((root
&& path.length == 1
&& path[0] == '') ?
('/'+ path.join('/'))
: path.join('/'))
//*/
: path },
split: function(path){
return this.normalize(path, 'array') },

View File

@ -6,6 +6,17 @@
* XXX CACHE/DEPENDS might be a good idea to add a dependencyUpdated event...
* ...and use it for cache invalidation...
* XXX CACHE creating a new page does not invalidate /tree cache...
* XXX OPTIMIZE: the actions that depend on lots of tiny requests (/tree)
* can get really slow...
* ...it feels like one reason is the async/await ping-pong...
* problems:
* - too many async requests
* micro cache?
* pack requests?
* - redundant path normalization (RENORMALIZE)
* mark the normalized string and return it as-is on
* renormalization...
* ...initial experiment made things slower...
* XXX need a uniform way to track some state in links in pwiki for things
* like paging and the like with simple user/macro access (???)...
* ...the simplest that comes to mind is to store in in path
@ -82,8 +93,6 @@
* list page/store info
* /storage
* list storage usage / limits
* XXX OPTIMIZE: /tree is really slow...
* ...is the problem purely in the async/await playing ping-pong???
* XXX BUG: FF: conflict between object.run and PouchDB...
* XXX add action to reset overloaded (bootstrap) pages...
* - per page