forked from nickel-org/nickel.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(*): Request is now accessible through a Response instance
This is motivated to allow writing Plugins which are able to access both the current Response and Request without having to rely on odd syntax such as `(foo, bar).baz()`. BREAKING CHANGE: This breaks a *lot* of nickel usage, checking the diff from the examples should help to migrate code relying on the old structure.
- Loading branch information
Showing
21 changed files
with
294 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ebc6aa9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on that? Would the odd syntax (
(foo, bar).baz()
) only apply to Plugins? Because I think the average user writes far less plugins compared to route handler which seem too look a little odd after this change.ebc6aa9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't be for plugin authors, but for usage. For example, the
Session
plugin requires access to both Request and Response (one for incoming data, one to set outgoing), then the user would need to call something awkward like(req, res).session().use_the_session()
.I am concerned about this being unintuitive, can you pin-point which part you find weird in the diff? My guess is
response.request
? Do you think a renaming would add intuition? (response -> environment / better word)ebc6aa9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.