{"action":"created","issue":{"url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2766","repository_url":"https://api.github.com/repos/aio-libs/aiohttp","labels_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2766/labels{/name}","comments_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2766/comments","events_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2766/events","html_url":"https://github.com/aio-libs/aiohttp/issues/2766","id":300344990,"node_id":"MDU6SXNzdWUzMDAzNDQ5OTA=","number":2766,"title":"UrlDispatcher refactoring","user":{"login":"asvetlov","id":356399,"node_id":"MDQ6VXNlcjM1NjM5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/356399?v=4","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aio-libs/aiohttp/milestones/22","html_url":"https://github.com/aio-libs/aiohttp/milestone/22","labels_url":"https://api.github.com/repos/aio-libs/aiohttp/milestones/22/labels","id":3324450,"node_id":"MDk6TWlsZXN0b25lMzMyNDQ1MA==","number":22,"title":"3.3","description":"","creator":{"login":"asvetlov","id":356399,"node_id":"MDQ6VXNlcjM1NjM5OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/356399?v=4","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":6,"state":"open","created_at":"2018-05-07T07:08:53Z","updated_at":"2018-06-12T05:09:35Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2018-02-26T18:24:17Z","updated_at":"2018-08-05T10:31:00Z","closed_at":null,"author_association":"MEMBER","body":"Long text, please read carefully.\r\n\r\nMy initial idea was supporting both *url mapper* (implemented as `UrlDispatcher` class) and *traversal*.\r\nIt follows Pyramid routing schema in some way.\r\nTraversal approach should be done by alternative router implementation.\r\n\r\nIn fact the idea has failed: too many aiohttp based libraries assumes that router is *url mapper*. Moreover `app.add_subapp` explicitly ignores the fact of alternative implementation existence.\r\n\r\nLet's state the fact: the router is `UrlDispatcher`. I want to go even further: deprecate *router* argument in `web.Application`. If user need a custom *url mapper based* router usually it means he adds a couple helper methods for registering resources **on top** of existing `.add_resource()`/`.add_route()`. Better to solve the need by wrapping the whole application by user-specific class with appropriate methods.\r\n\r\nIn practice it means raising up abstract classes from `web_urldispatcher.py` to `abc.py`.\r\n\r\nAlso I would add `add_static` and `add_routes` shortcuts to `web.Application`. People should use either URL table or `RouteTableDef` for defining routes, all others are internals. And we have `app.add_subapp` already, let's keep all casual route table definition in the same place. Other `add_*` methods are considered as low-level API and will not be replicated in application.\r\n\r\nP.S.\r\n*traversal* still could be built on top of *url mapper*: just make a resource for matching *all* paths like `'/{tail:.+}'` and do what you want in web handler."},"comment":{"url":"https://api.github.com/repos/aio-libs/aiohttp/issues/comments/410510943","html_url":"https://github.com/aio-libs/aiohttp/issues/2766#issuecomment-410510943","issue_url":"https://api.github.com/repos/aio-libs/aiohttp/issues/2766","id":410510943,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDUxMDk0Mw==","user":{"login":"amirouche","id":7444897,"node_id":"MDQ6VXNlcjc0NDQ4OTc=","avatar_url":"https://avatars3.githubusercontent.com/u/7444897?v=4","gravatar_id":"","url":"https://api.github.com/users/amirouche","html_url":"https://github.com/amirouche","followers_url":"https://api.github.com/users/amirouche/followers","following_url":"https://api.github.com/users/amirouche/following{/other_user}","gists_url":"https://api.github.com/users/amirouche/gists{/gist_id}","starred_url":"https://api.github.com/users/amirouche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amirouche/subscriptions","organizations_url":"https://api.github.com/users/amirouche/orgs","repos_url":"https://api.github.com/users/amirouche/repos","events_url":"https://api.github.com/users/amirouche/events{/privacy}","received_events_url":"https://api.github.com/users/amirouche/received_events","type":"User","site_admin":false},"created_at":"2018-08-05T10:31:00Z","updated_at":"2018-08-05T10:31:00Z","author_association":"NONE","body":"What does object traversal brings to the table in terms of higher level abstractions?\r\n\r\nIn the following describe the issue I have in my application https://github.com/amirouche/beyondjs/issues/1. I have a little experience with pyramid / zope object traversal but not enough to understand the deep implication. Will this be solved with something like Zope Component Architecture. with aiohttp, I tried in a project to implement PHP-like hierarchical mapping of files on disk along the disk to map to a visual hierarchy of the application. Each sub hierarchy was it's own Single Page Application. What I mean to say, that I tried somehow object tree traversal between different types of objects and it does seem overhelming."}}
{"actor":{"display_login":"amirouche"}}