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

Handle re-exported types #2

Merged
merged 17 commits into from
Oct 2, 2022
Merged

Conversation

LukeMathWalker
Copy link
Owner

@LukeMathWalker LukeMathWalker commented Oct 2, 2022

This is a pretty massive changeset that snowballed from a deceptively simple problem: make sure that pavex can handle hyper::Body.

That requires us to handle public re-exports (i.e. pub use hyper::body::Body where hyper::body is a private module) which in turn forces us to handle types from the standard library.
On the way I also took the opportunity to refactor ResolvedPath and make sure that we are resolving all generic parameters on top of the base type.

When rust-lang/rust#102241 lands I should be able to remove the hard-coded path to std's docs.

@LukeMathWalker LukeMathWalker merged commit f8848cf into main Oct 2, 2022
@LukeMathWalker LukeMathWalker deleted the fix-hyper-body-import-path branch October 2, 2022 18:13
LukeMathWalker added a commit that referenced this pull request Feb 14, 2023
* Remove hack to fix the import path of hyper::body::Body.
First step in fixing a problem is admitting you have one!

* Improve test output on failure - it should always include stdout/stderr.
This allows more effective usage of dbg! to debug tests where the source generation command succeeded but other expectations are broken.

* Make sure that the path index only contains paths that are publicly reachable.

* Build a mechanism to find the publicly importable path for a type.

* Update snapshots for one test.

* Update snapshots for one test.

* Fix flaky test.

* Align example with current usage pattern. The example is broken (we can't render `std`).

* Hack together a flow to resolve std's types.

* Update rustdoc

* Add utility CLI to quickly review snapshots.

* Specify requirements.

* Refactor.

* Refactor.

* Clarify

* Do not use `syn` in the path-related types in `language`.
Ensure that all generic type parameters are using fully-qualified paths, instead of checking just the base path.

* Remove dead code that was commented out.

Co-authored-by: Luca Palmieri <rust@lpalmieri.com>
LukeMathWalker added a commit that referenced this pull request Feb 14, 2023
LukeMathWalker added a commit that referenced this pull request Aug 14, 2023
The registered middlewares are now properly validation by `pavexc`: 
- they take `Next` as input (once)
- they return a type that can be converted into a `Response` (either
directly or in the happy case)
- they don't use generic parameters that we can't reliably infer

I did some refactorings along the way, especially in the component
database (arguably the messiest part of the codebase).
LukeMathWalker added a commit that referenced this pull request Dec 22, 2023
Cookbook ✅ 

The `Limitations` section will be flashed out in another PR.
LukeMathWalker added a commit that referenced this pull request Jan 17, 2024
Another piece of the version management story: the `pavex` CLI can now
install a more recent version of itself.
For completeness, we also provide an uninstall command that removes the
binary as well as all the transient data that Pavex builds when
compiling projects.
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.

1 participant