Commit Graph

13 Commits

Author SHA1 Message Date
Jesse D. McDonald cb99962074 completely redesign the user interface 2020-05-10 15:42:23 -05:00
Jesse D. McDonald 3f37803c34 use view boxes instead of CSS :target to allow theme preview 2020-05-04 00:18:10 -05:00
Jesse D. McDonald 106e43e8ad create combined SVGs for each chess icon theme using :target selectors 2020-05-03 21:29:23 -05:00
Jesse D. McDonald 0fc3787432 support running as a standalone server for development 2020-05-02 16:08:54 -05:00
Jesse D. McDonald 33d1c84fe7 precache all static assets in service worker with Workbox 2020-04-27 00:55:05 -05:00
Jesse D. McDonald 7c4b5972db add a Progressive Web App (PWA) manifest 2020-04-06 02:02:01 -05:00
Jesse D. McDonald accbc316ff add an optional in-page notification sound 2020-04-05 17:24:22 -05:00
Jesse D. McDonald 75b66e6ce3 fix for sw.js not copied to dist directory 2020-04-05 04:39:55 -05:00
Jesse D. McDonald 644a140b65 remove CSS optimizer plugin; fixes 1% opacity on badges 2020-04-05 04:39:10 -05:00
Jesse D. McDonald 7ebea1d1fc restructure data to limit indirect links; breaking change
I found that the game list was wiped out (again) and I suspect that the
issue was that some client pushed an update to the game list before
receiving the current data for the top-level object. That would have
caused it to create new objects for the game and metadata lists
containing only the single newly-created game and store links to them in
the 'games' and 'meta' fields of the top-level object. This data would
not be merged because the new objects have no connection to the original
objects which should have been linked from those fields. The top-level
object would be merged, but only to the extent of updating the links.

To fix this, I moved the 'meta' object to the top level with a fixed
identifier (UUID + '/meta'). This identifier _is_ the object's identity
("soul") so even if a client initializes it with an empty object the new
fields should be merged when syncing resumes. I removed the 'games'
object altogether, since the meta object keeps track of which game IDs
are available. Individual games are assigned "souls" based on their game
IDs (UUID + ('/game/' or '/meta/') + game ID). The resulting structure
looks like:

    'UUID/meta': {
      '12345abcde': <link to 'UUID/meta/12345abcde'>,
      '3a2b5c7e1f': <link to 'UUID/meta/3a2b5c7e1f'>,
      ...
    },
    'UUID/meta/12345abcde': { ... darkName, lightName, moves, etc. ... },
    'UUID/game/12345abcde': { 'board': 'JSON' },
    'UUID/meta/3a2b5c7e1f': { ... darkName, lightName, moves, etc. ... },
    'UUID/game/3a2b5c7e1f': { 'board': 'JSON' },
    ...

Besides being more resilient, this structure should also be more
performant since there are fewer links to traverse to access the game
data. So far in my admittedly limited testing I haven't seen any of the
syncronization issues that plagued the older version.
2020-04-04 05:24:59 -05:00
Jesse D. McDonald e1722cf589 fix remaining hard-coded paths & extend cache lifetimes with content hashes 2020-04-02 05:25:49 -05:00
Jesse D. McDonald 68f1618597 integrate SVG optimization with webpack 2020-04-02 03:05:52 -05:00
Jesse D. McDonald 2e68c3b7b1 replace submodules with proper NPM dependencies & webpack 2020-04-02 02:51:41 -05:00