Skip to content

What useful computed properties can we provide? #16

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

Closed
aturon opened this issue Nov 8, 2018 · 8 comments
Closed

What useful computed properties can we provide? #16

aturon opened this issue Nov 8, 2018 · 8 comments
Labels
design Open design question

Comments

@aturon
Copy link
Collaborator

aturon commented Nov 8, 2018

When a value can be lazily computed by request information, it's much nicer to make that value available through the Compute trait (and Computed extractor) rather than e.g. using middleware or plumbing the Head data manually in an endpoint.

What are some examples of such values? One might be: a parsed version of the query segment. Let's generate a bunch of ideas and then implement them!

@aturon aturon added the design Open design question label Nov 8, 2018
@pickfire
Copy link
Contributor

pickfire commented Nov 9, 2018

Maybe we can pre-compute the ETag and Last-Modified? This might be a usecase for some API but I have yet seen some interesting implementation for this.

@aturon
Copy link
Collaborator Author

aturon commented Nov 9, 2018

@pickfire Interesting thought! Feel free to play with this idea and open up a PR.

@tzilist
Copy link
Contributor

tzilist commented Nov 11, 2018

Another one might be a passport type thing to handle different types of authentication? This may not be something worth providing out of the box from tide but certainly worth showing an example of?

@chrisabruce
Copy link

While good idea, think most frameworks leave this to middleware. Maybe a good approach would be to create a middleware piece for that. Unless we talking about common header types like basic auth?

@tzilist
Copy link
Contributor

tzilist commented Nov 12, 2018

@chrisabruce agreed. I wonder if we can provide scaffolding for something like basic auth, oath, etc. But I think you are right, that should probably be middleware.

@tzilist
Copy link
Contributor

tzilist commented Nov 13, 2018

We could also provide a set of tools for performing health checks?

@pickfire
Copy link
Contributor

@aturon From what I looked at it, Compute are used for routes, I wonder if it could be used for middlewares for caching.

@aturon
Copy link
Collaborator Author

aturon commented Apr 10, 2019

Closing as of #156, which eliminated the concept of "computed values".

@aturon aturon closed this as completed Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Open design question
Projects
None yet
Development

No branches or pull requests

4 participants