Current section

26 Versions

Jump to

Compare versions

46 files changed
+976 additions
-840 deletions
  @@ -159,7 +159,7 @@ Sprocket is still in its early stages and has a roadmap for future development.
159 159 - [x] Build out full set of base HTML functions for components
160 160 - [x] Expand the available hooks to enable more flexible component behavior
161 161 - [x] Add documentation to modules and simplify API
162 - - [ ] Add support for additional event types to handle various user interactions
162 + - [x] Add support for additional event types to handle various user interactions
163 163 - [ ] Improve unit test coverage to ensure code quality and reliability
164 164 - [ ] Add support for web-based client components
165 165 - [ ] Investigate extending to support more than just web views, such as native desktop, iOS, and Android applications.
  @@ -1,5 +1,5 @@
1 1 name = "sprocket"
2 - version = "0.3.2"
2 + version = "0.4.0"
3 3 description = "A library for building live views and real-time server components in Gleam"
4 4
5 5 # Fill out these fields if you intend to generate HTML documentation or publish
  @@ -1,6 +1,6 @@
1 1 {<<"name">>, <<"sprocket">>}.
2 2 {<<"app">>, <<"sprocket">>}.
3 - {<<"version">>, <<"0.3.2">>}.
3 + {<<"version">>, <<"0.4.0">>}.
4 4 {<<"description">>, <<"A library for building live views and real-time server components in Gleam"/utf8>>}.
5 5 {<<"licenses">>, [<<"MIT">>]}.
6 6 {<<"build_tools">>, [<<"gleam">>]}.
  @@ -9,35 +9,35 @@
9 9 {<<"Repository">>, <<"https://github.com/bitbldr/sprocket">>}
10 10 ]}.
11 11 {<<"requirements">>, [
12 - {<<"gleam_json">>, [
13 - {<<"app">>, <<"gleam_json">>},
14 - {<<"optional">>, false},
15 - {<<"requirement">>, <<">= 2.1.0 and < 3.0.0">>}
16 - ]},
17 12 {<<"gleam_erlang">>, [
18 13 {<<"app">>, <<"gleam_erlang">>},
19 14 {<<"optional">>, false},
20 15 {<<"requirement">>, <<">= 0.32.0 and < 1.0.0">>}
21 16 ]},
22 - {<<"gleam_regexp">>, [
23 - {<<"app">>, <<"gleam_regexp">>},
24 - {<<"optional">>, false},
25 - {<<"requirement">>, <<">= 1.0.0 and < 2.0.0">>}
26 - ]},
27 17 {<<"ids">>, [
28 18 {<<"app">>, <<"ids">>},
29 19 {<<"optional">>, false},
30 20 {<<"requirement">>, <<">= 0.13.0 and < 1.0.0">>}
31 21 ]},
22 + {<<"gleam_otp">>, [
23 + {<<"app">>, <<"gleam_otp">>},
24 + {<<"optional">>, false},
25 + {<<"requirement">>, <<">= 0.14.1 and < 1.0.0">>}
26 + ]},
32 27 {<<"gleam_stdlib">>, [
33 28 {<<"app">>, <<"gleam_stdlib">>},
34 29 {<<"optional">>, false},
35 30 {<<"requirement">>, <<">= 0.45.0 and < 1.0.0">>}
36 31 ]},
37 - {<<"gleam_otp">>, [
38 - {<<"app">>, <<"gleam_otp">>},
32 + {<<"gleam_regexp">>, [
33 + {<<"app">>, <<"gleam_regexp">>},
39 34 {<<"optional">>, false},
40 - {<<"requirement">>, <<">= 0.14.1 and < 1.0.0">>}
35 + {<<"requirement">>, <<">= 1.0.0 and < 2.0.0">>}
36 + ]},
37 + {<<"gleam_json">>, [
38 + {<<"app">>, <<"gleam_json">>},
39 + {<<"optional">>, false},
40 + {<<"requirement">>, <<">= 2.1.0 and < 3.0.0">>}
41 41 ]}
42 42 ]}.
43 43 {<<"files">>, [
  @@ -59,9 +59,8 @@
59 59 <<"include/sprocket@context_EffectResult.hrl">>,
60 60 <<"include/sprocket@context_Element.hrl">>,
61 61 <<"include/sprocket@context_Event.hrl">>,
62 + <<"include/sprocket@context_EventHandler.hrl">>,
62 63 <<"include/sprocket@context_Fragment.hrl">>,
63 - <<"include/sprocket@context_Handler.hrl">>,
64 - <<"include/sprocket@context_IdentifiableHandler.hrl">>,
65 64 <<"include/sprocket@context_IgnoreUpdate.hrl">>,
66 65 <<"include/sprocket@context_Keyed.hrl">>,
67 66 <<"include/sprocket@context_Memo.hrl">>,
  @@ -1,7 +1,7 @@
1 1 -record(context, {
2 2 view :: sprocket@context:element(),
3 3 wip :: sprocket@context:component_wip(),
4 - handlers :: list(sprocket@context:identifiable_handler()),
4 + handlers :: list(sprocket@context:event_handler()),
5 5 render_update :: fun(() -> nil),
6 6 update_hook :: fun((sprocket@internal@utils@unique:unique(sprocket@context:hook_id()), fun((sprocket@context:hook()) -> sprocket@context:hook())) -> nil),
7 7 emit :: fun((sprocket@internal@utils@unique:unique(sprocket@context:hook_id()), binary(), gleam@option:option(binary())) -> {ok,
  @@ -1,4 +1 @@
1 - -record(event, {
2 - name :: binary(),
3 - handler :: sprocket@context:identifiable_handler()
4 - }).
1 + -record(event, {kind :: binary(), cb :: fun((gleam@dynamic:dynamic_()) -> nil)}).
Loading more files…