8000 Release v0.30.0 · savashn/ecewo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

v0.30.0

Compare
Choose a tag to compare
@savashn savashn released this 05 Jul 18:01
· 6 commits to main since this release

BREAKING CHANGES

Macros were removed for better code clarity. They relied on hidden variables, which made the code fragile and easy to misuse, especially in the async operations. If the expected variable was not in scope, the macro would silently fail or produce misleading behavior. Additionally, they caused poor debugging experiences and could have surprising side effects. static inline functions are now used instead where necessary. However, developers can define their own macros.

Read the docs.

// BEFORE

send_text(200, "Hello, World!);
send_json(200, json_string);
send_cbor(200, buf, len);

get_params("slug");
get_query("query");
get_headers("header");

then(context, work_fn, done_fn);
// NOW

send_text(res, 200, "Hello, World!);
send_json(res, 200, json_string);
send_cbor(res, 200, buf, len);

get_params(req, "slug");
get_query(req, "query");
get_headers(req, "header");

then(context, success, error, work_fn, done_fn);

This change was critical, as data frequently passes through context structures, and macros introduce a high risk of misuse and hidden bugs.

NEWS

Four new functions have been added:

These functions allow deep copying and proper destruction of Req and Res objects during asynchronous operations. This change prevents dangling pointer issues caused by shallow copy and improves memory safety.

0