Skip to content

Conversation

@Sachanski
Copy link
Collaborator

  • Added manifest.json, thus making the app installable

  • Added a couple of screenshots used by app installers

  • Added support for opening zip files with the tapestry app

  • Caching all assets needed by the application

    • Extended the caching strategy so that GET requests to the backend and thumbnails are also cached. Contrary to the other chached resources these are used in a network first manner (instead of cache first)
    • Storing the current user and access token in the local storage so we can use it if we are offline
  • Created a vite plugin to ensure that all built web assets are included by the service worker and also there are no assets referenced by the service worker that not in the dist directory

  • Changed the vite configuration so that we have stable file names for assets

  • Added idb - used for persisting the tapestry in IndexedDB while offline

  • Added file-type - a library used for detecting the mimetype of a file by reading its header

  • When initializing a tapestry in case we are offline the tapestry is fetched from IndexedDB and the latest version is commited to the repo

  • When going back online we are making a diff between the local and remote tapestries and flushing the changes to the server (currently the local tapestry overwrites the remote; this could of course be improved upon)

    • To that end extracted some utility function that create patches based of two dtos
  • Created a DB service that is intantiated by the data sync and used to persist the tapestry while offline.

    • It provides a schema of models for a tapestry, items, rels, groups and presentation steps
    • It provides an interface for:
      • upserting - this happens when we go offline.
      • patching - accepts an array of patches and applies the corresponding changes in the database
      • geting - fetches a TapestryDto along with its PresentationStepDto[]
  • Small refactoring around file uploads

    • Removed the pending state (along with the prepare function)
    • When creating a media item an object url is directly assigned as its source without passing the file to the ItemUploadObservable
    • When uploading an item the blob url is converted to a file (using the file-type library in order to get its media type)

* Added manifest.json, thus making the app installable
* Added a couple of screenshots used by app installers
* Added support for opening zip files with the tapestry app

* Caching all assets needed by the application
  * Extended the caching strategy so that GET requests to the backend and thumbnails are also cached. Contrary to the other chached resources these are used in a network first manner (instead of cache first)
  * Storing the current user and access token in the local storage so we can use it if we are offline
* Created a vite plugin to ensure that all built web assets are included by the service worker and also there are no assets referenced by the service worker that not in the dist directory
* Changed the vite configuration so that we have stable file names for assets
* Added `idb` - used for persisting the tapestry in IndexedDB while offline
* Added `file-type` - a library used for detecting the mimetype of a file by reading its header
* When initializing a tapestry in case we are offline the tapestry is fetched from IndexedDB and the latest version is commited to the repo
* When going back online we are making a diff between the local and remote tapestries and flushing the changes to the server (currently the local tapestry overwrites the remote; this could of course be improved upon)
  * To that end extracted some utility function that create patches based of two dtos
* Created a DB service that is intantiated by the data sync and used to persist the tapestry while offline.
  * It provides a schema of models for a tapestry, items, rels, groups and presentation steps
  * It provides an interface for:
    * `upsert`ing - this happens when we go offline.
    * `patch`ing - accepts an array of patches and applies the corresponding changes in the database
    * `get`ing - fetches a `TapestryDto` along with its `PresentationStepDto[]`
* Small refactoring around file uploads
  * Removed the pending state (along with the prepare function)
  * When creating a media item an object url is directly assigned as its source without passing the file to the `ItemUploadObservable`
  * When uploading an item the blob url is converted to a file (using the **file-type** library in order to get its media type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants