Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static resource type #163

Closed
jirenius opened this issue Jun 9, 2020 · 3 comments
Closed

Static resource type #163

jirenius opened this issue Jun 9, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@jirenius
Copy link
Collaborator

jirenius commented Jun 9, 2020

Issue

A static resource type should be added that allows arbitrary structures of JSON to be passed to the client.

The type will have no events describing mutations. It can be used for data which does not change, or data which the client should not be notified of changes.

Implementation

Service get response

The response to a get request follows the same pattern as for model resources, but with the parameter key "static".

It may look like this:

{
    "result": {
        "static": { "foo": { "bar": [ null ] }, "int": 42 }
    }
}

Client get response

The response follows the same pattern, but the resource set will have an additional optional field, "statics":

{
    "result": {
        "statics": {
            "example.static": { "foo": { "bar": [ null ] }, "int": 42 }
        }
    }
}

Notes

  • static resources have no modifying events (such as change/add/remove)
  • static resources may have any JSON value, including nested objects and arrays, without limitation
  • static resources cannot have resource references
  • static resources are cacheable by Resgate
  • system.reset events will invalidate cached static resources, but will not trigger any event to the clients.
  • static resources may have custom events
  • For clients only supporting protocol <= v1.2.0, the static resource should be replaced by an error by Resgate.
@jirenius jirenius self-assigned this Jun 9, 2020
@jirenius jirenius added the enhancement New feature or request label Jun 9, 2020
jirenius added a commit that referenced this issue Jun 9, 2020
jirenius added a commit that referenced this issue Jun 10, 2020
…-type

Feature/gh 163 static resource type
@jirenius
Copy link
Collaborator Author

Resolved in #164

jirenius added a commit that referenced this issue Jun 11, 2020
@jirenius jirenius mentioned this issue Jun 11, 2020
jirenius added a commit that referenced this issue Jun 11, 2020
@jirenius
Copy link
Collaborator Author

Reopen after reverting the merge.

The revert was made as the feature added too much complexity to the protocol in comparison to what it solved. A less complex solution that solves the same need for arbitrary data, is tried out in the data value feature.

@jirenius jirenius reopened this Jun 12, 2020
@jirenius
Copy link
Collaborator Author

Closing as a static resource type will not be the solution for the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant