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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,12 @@ Here is a checklist that all Gloo utility crates should fulfill:
115
115
`FnOnce`) instead of taking `wasm_bindgen::Closure`s or
116
116
`js_sys::Function`s directly.
117
117
118
+
*[ ] If the API can be implemented as a Future / Stream, then it should first be implemented as a callback, with the callback API put into the `callback` submodule.
119
+
120
+
Then the Future / Stream should be implemented using the callback API, and should be put into the `future` or `stream` submodule.
121
+
122
+
Make sure that the callback and Future / Stream APIs properly support cancellation (if it is possible to do so).
123
+
118
124
*[ ] Uses nice Rust-y types and interfaces instead of passing around untyped
119
125
`JsValue`s.
120
126
@@ -123,6 +129,12 @@ Here is a checklist that all Gloo utility crates should fulfill:
123
129
escape hatch for dropping down to raw `web_sys` bindings when an API isn't
124
130
fully supported by the crate yet.
125
131
132
+
*[ ] There is a loose hierarchy with "mid-level" APIs (which are essentially thin wrappers over the low-level APIs), and "high-level" APIs (which make more substantial changes).
133
+
134
+
As a general rule, the high-level APIs should be built on top of the mid-level APIs, which in turn should be built on top of the low-level APIs (e.g. `web_sys`)
135
+
136
+
There are exceptions to this, but they have to be carefully decided on a case-by-case basis.
137
+
126
138
*[ ] Headless browser and/or Node.js tests via `wasm-pack test`.
0 commit comments