Skip to content

Commit 1a6b907

Browse files
committed
Fully cut over to tokio
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
1 parent f82ded8 commit 1a6b907

38 files changed

+1580
-1669
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ jobs:
8686
uses: actions/checkout@v2
8787

8888
- name: Setup | Cache Cargo
89-
# WHY? Because we are getting: error[E0463]: can't find crate for `structopt_derive` which `structopt` depends on
90-
# only on macos when using the cache.
91-
if: matrix.os != 'macos-latest'
89+
# TODO: remove this if it didn't break CI to comment this out.
90+
# # WHY? Because we are getting: error[E0463]: can't find crate for `structopt_derive` which `structopt` depends on
91+
# # only on macos when using the cache.
92+
# if: matrix.os != 'macos-latest'
9293
uses: actions/cache@v2
9394
with:
9495
path: |
@@ -102,10 +103,10 @@ jobs:
102103
- name: Setup | Cache Examples
103104
uses: actions/cache@v2
104105
with:
105-
path: examples/yew/target
106-
key: wasm32-example-yew-debug-${{ hashFiles('examples/yew/Cargo.lock') }}
106+
path: examples/proxy/target
107+
key: wasm32-example-proxy-debug-${{ hashFiles('examples/proxy/Cargo.lock') }}
107108
restore-keys: |
108-
wasm32-example-yew-debug-
109+
wasm32-example-proxy-debug-
109110
110111
- name: Setup | Cache Examples
111112
uses: actions/cache@v2
@@ -123,6 +124,14 @@ jobs:
123124
restore-keys: |
124125
wasm32-example-vanilla-debug-
125126
127+
- name: Setup | Cache Examples
128+
uses: actions/cache@v2
129+
with:
130+
path: examples/yew/target
131+
key: wasm32-example-yew-debug-${{ hashFiles('examples/yew/Cargo.lock') }}
132+
restore-keys: |
133+
wasm32-example-yew-debug-
134+
126135
- name: Setup | Rust
127136
uses: actions-rs/toolchain@v1
128137
with:
@@ -139,8 +148,10 @@ jobs:
139148

140149
# Build examples via our newly built debug artifact.
141150
- name: Build | Examples
142-
run: ${{ matrix.binPath }} --config=examples/yew/Trunk.toml build
151+
run: ${{ matrix.binPath }} --config=examples/proxy/Trunk.toml build
143152
- name: Build | Examples
144153
run: ${{ matrix.binPath }} --config=examples/seed/Trunk.toml build
145154
- name: Build | Examples
146155
run: ${{ matrix.binPath }} --config=examples/vanilla/Trunk.toml build
156+
- name: Build | Examples
157+
run: ${{ matrix.binPath }} --config=examples/yew/Trunk.toml build

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ This changelog follows the patterns described here: https://keepachangelog.com/e
55
Subheadings to categorize changes are `added, changed, deprecated, removed, fixed, security`.
66

77
## Unreleased
8+
## 0.13.0
9+
- Trunk has been fully cut over to [email protected].
10+
- As part of the Tokio cut over, the Trunk network stack is now fully based on Axum.
11+
- 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.
12+
- 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.
13+
- 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`.
14+
- This is expected functionality for SPAs which are using client side routing.
15+
- 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.
16+
- Added a new `proxy` example which demonstrates all functionality of the Trunk proxy system.
17+
- 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.
818

919
## 0.12.1
1020
### fixed

0 commit comments

Comments
 (0)