Skip to content

Commit

Permalink
Fully cut over to tokio
Browse files Browse the repository at this point in the history
Cut over to [email protected]. Much more simple interface, and works
quite nicely with the async ecosystem.

Cut over to axum for web server. Much better!

The updated server stack is now more intelligently handling 404s. This
is a common issue where users may end up making a request for some
non-html static asset, but they get their path slightly wrong and are
served the index.html instead of a 404.

This typically results in users struggling to find the problem, and
often times users have opened issues in GH. This updated algorithm will
now evaluate 404s more closely and only respond with the index.html when
the `accept` header allows for text/html or */*.

Added an example demonstrating all proxy functionality.

closes #198
closes #202
closes #209
  • Loading branch information
thedodd committed Aug 4, 2021
1 parent f82ded8 commit da584d5
Show file tree
Hide file tree
Showing 38 changed files with 1,579 additions and 1,669 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ jobs:
uses: actions/checkout@v2

- name: Setup | Cache Cargo
# WHY? Because we are getting: error[E0463]: can't find crate for `structopt_derive` which `structopt` depends on
# only on macos when using the cache.
if: matrix.os != 'macos-latest'
# TODO: remove this if it didn't break CI to comment this out.
# # WHY? Because we are getting: error[E0463]: can't find crate for `structopt_derive` which `structopt` depends on
# # only on macos when using the cache.
# if: matrix.os != 'macos-latest'
uses: actions/cache@v2
with:
path: |
Expand All @@ -102,10 +103,10 @@ jobs:
- name: Setup | Cache Examples
uses: actions/cache@v2
with:
path: examples/yew/target
key: wasm32-example-yew-debug-${{ hashFiles('examples/yew/Cargo.lock') }}
path: examples/proxy/target
key: wasm32-example-proxy-debug-${{ hashFiles('examples/proxy/Cargo.lock') }}
restore-keys: |
wasm32-example-yew-debug-
wasm32-example-proxy-debug-
- name: Setup | Cache Examples
uses: actions/cache@v2
Expand All @@ -123,6 +124,14 @@ jobs:
restore-keys: |
wasm32-example-vanilla-debug-
- name: Setup | Cache Examples
uses: actions/cache@v2
with:
path: examples/yew/target
key: wasm32-example-yew-debug-${{ hashFiles('examples/yew/Cargo.lock') }}
restore-keys: |
wasm32-example-yew-debug-
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -139,8 +148,10 @@ jobs:

# Build examples via our newly built debug artifact.
- name: Build | Examples
run: ${{ matrix.binPath }} --config=examples/yew/Trunk.toml build
run: ${{ matrix.binPath }} --config=examples/proxy/Trunk.toml build
- name: Build | Examples
run: ${{ matrix.binPath }} --config=examples/seed/Trunk.toml build
- name: Build | Examples
run: ${{ matrix.binPath }} --config=examples/vanilla/Trunk.toml build
- name: Build | Examples
run: ${{ matrix.binPath }} --config=examples/yew/Trunk.toml build
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ This changelog follows the patterns described here: https://keepachangelog.com/e
Subheadings to categorize changes are `added, changed, deprecated, removed, fixed, security`.

## Unreleased
## 0.13.0
- Trunk has been fully cut over to [email protected].
- As part of the Tokio cut over, the Trunk network stack is now fully based on Axum.
- All download utilities have been made fully async. This will likely help us in the future as we continue to leverage this functionality more and more.
- Added a new CLI option `trunk clean -t/--tools` which will optionally clean/remove any cached tools used by Trunk, such as `wasm-bindgen` & `wasm-opt`. This may be useful if there are ever issues with old tools which need to be removed.
- Fixed [#198](https://github.com/thedodd/trunk/issues/198) which was a long-standing issue with the static file server. In essence, Trunk will now check the `accept` header of any `GET` request matching the static file server, and if the requested asset does not exist and the `accept` header allows either `*/*` or `text/html`, then return the `index.html`.
- This is expected functionality for SPAs which are using client side routing.
- This reduces the friction which has often been observed with Trunk where a user is expecting a 404 to be served when requesting a static image, CSS, or some other asset. With this update, 404s will now be returned as expected, and the `index.html` should only be returned for applicable cases.
- Added a new `proxy` example which demonstrates all functionality of the Trunk proxy system.
- Fixed [#209](https://github.com/thedodd/trunk/issues/209) where the default Rust App pipeline was causing wasm-opt to be used even for debug builds when the Rust App HTML link was being omitted.

## 0.12.1
### fixed
Expand Down
Loading

0 comments on commit da584d5

Please sign in to comment.