You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is exciting to see how much is possible with a framework like this, by expanding the options
244
-
developers have when building on top of the Workers platform. However, there is still much to be
245
-
done. Expect a few rough edges, some unimplemented APIs, and maybe a bug or two here and there. It’s
246
-
worth calling out here that some things that may have worked in your Rust code might not work here -
247
-
it’s all WebAssembly at the end of the day, and if your code or third-party libraries don’t target
248
-
`wasm32-unknown-unknown`, they can’t be used on Workers. Additionally, you’ve got to leave your
249
-
threaded async runtimes at home; meaning no Tokio or async_std support. However, async/await syntax
250
-
is still available and supported out of the box when you use the `worker` crate.
245
+
It is exciting to see how much is possible with a framework like this, by expanding the options
246
+
developers have when building on top of the Workers platform. However, there is still much to be
247
+
done. Expect a few rough edges, some unimplemented APIs, and maybe a bug or two here and there. It’s
248
+
worth calling out here that some things that may have worked in your Rust code might not work here -
249
+
it’s all WebAssembly at the end of the day, and if your code or third-party libraries don’t target
250
+
`wasm32-unknown-unknown`, they can’t be used on Workers. Additionally, you’ve got to leave your
251
+
threaded async runtimes at home; meaning no Tokio or async_std support. However, async/await syntax
252
+
is still available and supported out of the box when you use the `worker` crate.
251
253
252
-
We fully intend to support this crate and continue to build out its missing features, but your help
253
-
and feedback is a must. We don’t like to build in a vacuum, and we’re in an incredibly fortunate
254
-
position to have brilliant customers like you who can help steer us towards an even better product.
254
+
We fully intend to support this crate and continue to build out its missing features, but your help
255
+
and feedback is a must. We don’t like to build in a vacuum, and we’re in an incredibly fortunate
256
+
position to have brilliant customers like you who can help steer us towards an even better product.
255
257
256
-
So give it a try, leave some feedback, and star the repo to encourage us to dedicate more time and
258
+
So give it a try, leave some feedback, and star the repo to encourage us to dedicate more time and
257
259
resources to this kind of project.
258
260
259
-
If this is interesting to you and you want to help out, we’d be happy to get outside contributors
260
-
started. We know there are improvements to be made such as compatibility with popular Rust HTTP
261
-
ecosystem types (we have an example conversion for [Headers](https://github.com/cloudflare/workers-rs/blob/3d5876a1aca0a649209152d1ffd52dae7bccda87/libworker/src/headers.rs#L131-L167) if you want to make one), implementing additional Web APIs, utility crates,
262
-
and more. In fact, we’re always on the lookout for great engineers, and hiring for many open roles -
261
+
If this is interesting to you and you want to help out, we’d be happy to get outside contributors
262
+
started. We know there are improvements to be made such as compatibility with popular Rust HTTP
263
+
ecosystem types (we have an example conversion for [Headers](https://github.com/cloudflare/workers-rs/blob/3d5876a1aca0a649209152d1ffd52dae7bccda87/libworker/src/headers.rs#L131-L167) if you want to make one), implementing additional Web APIs, utility crates,
264
+
and more. In fact, we’re always on the lookout for great engineers, and hiring for many open roles -
263
265
please [take a look](https://www.cloudflare.com/careers/).
264
266
265
267
### FAQ
266
268
267
-
1. Can I deploy a Worker that uses `tokio` or `async_std` runtimes?
269
+
1. Can I deploy a Worker that uses `tokio` or `async_std` runtimes?
268
270
269
-
- Currently no. All crates in your Worker project must compile to `wasm32-unknown-unknown` target,
270
-
which is more limited in some ways than targets for x86 and ARM64.
271
+
- Currently no. All crates in your Worker project must compile to `wasm32-unknown-unknown` target,
272
+
which is more limited in some ways than targets for x86 and ARM64.
271
273
272
274
2. The `worker` crate doesn't have _X_! Why not?
273
275
274
-
- Most likely, it should, we just haven't had the time to fully implement it or add a library to
275
-
wrap the FFI. Please let us know you need a feature by [opening an issue](https://github.com/cloudflare/workers-rs/issues).
276
+
- Most likely, it should, we just haven't had the time to fully implement it or add a library to
277
+
wrap the FFI. Please let us know you need a feature by [opening an issue](https://github.com/cloudflare/workers-rs/issues).
276
278
277
279
3. My bundle size exceeds Workers 1MB limits, what do I do?
278
280
279
281
- We're working on solutions here, but in the meantime you'll need to minimize the number of crates
280
-
your code depends on, or strip as much from the `.wasm` binary as possible. Here are some extra
281
-
steps you can try: https://rustwasm.github.io/book/reference/code-size.html#optimizing-builds-for-code-size
282
+
your code depends on, or strip as much from the `.wasm` binary as possible. Here are some extra
283
+
steps you can try: https://rustwasm.github.io/book/reference/code-size.html#optimizing-builds-for-code-size
282
284
283
285
# Contributing
284
286
285
-
Your feedback is welcome and appreciated! Please use the issue tracker to talk about potential
286
-
implementations or make feature requests. If you're interested in making a PR, we suggest opening up
287
+
Your feedback is welcome and appreciated! Please use the issue tracker to talk about potential
288
+
implementations or make feature requests. If you're interested in making a PR, we suggest opening up
287
289
an issue to talk about the change you'd like to make as early as possible.
288
290
289
291
## Project Contents
290
292
291
-
-**worker**: the user-facing crate, with Rust-famaliar abstractions over the Rust<->JS/WebAssembly
292
-
interop via wrappers and convenience library over the FFI bindings.
293
+
-**worker**: the user-facing crate, with Rust-famaliar abstractions over the Rust<->JS/WebAssembly
294
+
interop via wrappers and convenience library over the FFI bindings.
293
295
-**worker-sys**: Rust extern "C" definitions for FFI compatibility with the Workers JS Runtime.
294
-
-**worker-macros**: exports `event` and `durable_object` macros for wrapping Rust entry point in a
295
-
`fetch` method of an ES Module, and code generation to create and interact with Durable Objects.
296
+
-**worker-macros**: exports `event` and `durable_object` macros for wrapping Rust entry point in a
297
+
`fetch` method of an ES Module, and code generation to create and interact with Durable Objects.
296
298
-**worker-sandbox**: a functioning Cloudflare Worker for testing features and ergonomics.
297
299
-**worker-build**: a cross-platform build command for `workers-rs`-based projects.
0 commit comments