cradova 2.3.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -41,7 +41,11 @@
41
41
 
42
42
  Cradova is a web development framework for building Single Page Applications and PWAs.
43
43
 
44
- It's a fast, simple and modern, it provides state management, routing system and a rest API utility out of the box.
44
+ It's a fast, simple and modern, with powerful state management and routing system.
45
+
46
+ ```
47
+ No matter how complex your UI, cradova helps you build fast, reactivity and scalable web apps.
48
+ ```
45
49
 
46
50
  Cradova follows the [VJS specification](https://github.com/fridaycandour/cradova/blob/main/spec.md)
47
51
 
@@ -58,7 +62,7 @@ Undoubtedly, this provides a significant advantage. You can experience it firsth
58
62
 
59
63
  Cradova has already been utilized in multiple production projects, and we will continuously update this page to showcase our advancements as we keep improving.
60
64
 
61
- [current version changes](https://github.com/fridaycandour/cradova/blob/main/CHANGELOG.md#v220)
65
+ [current version changes](https://github.com/fridaycandour/cradova/blob/main/CHANGELOG.md#v300)
62
66
 
63
67
  ## Installation
64
68
 
@@ -109,42 +113,7 @@ this a collection of basic examples
109
113
  you can choose any that best suite what problem you want to solve
110
114
 
111
115
  ```js
112
- import _, {
113
- button,
114
- createSignal,
115
- Ref,
116
- reference,
117
- h1,
118
- br,
119
- div,
120
- } from "../dist/index.js";
121
-
122
- function Hello(name) {
123
- return h1("Hello " + name, {
124
- className: "title",
125
- style: {
126
- color: "grey",
127
- },
128
- });
129
- }
130
-
131
- const html = div(Hello("peter"), Hello("joe"));
132
-
133
- // reference (not state)
134
-
135
- function typingExample() {
136
- const re = new reference();
137
- return _(
138
- "div",
139
- input({
140
- oninput() {
141
- re.text.innerText = this.value;
142
- },
143
- placeholder: "typing simulation",
144
- }),
145
- p(" no thing typed yet!", { reference: re.bindAs("text") })
146
- );
147
- }
116
+ import _, { button, createSignal, Ref, reference, h1, br, div } from "cradova";
148
117
 
149
118
  // setting shouldUpdate to true
150
119
  // gives you this.updateState binding
@@ -152,10 +121,9 @@ function typingExample() {
152
121
  function counter() {
153
122
  let num = 0;
154
123
  return _("h1| 0", {
155
- shouldUpdate: true,
156
124
  onclick() {
157
125
  num++;
158
- this.updateState({ text: num });
126
+ this.innerText = num;
159
127
  },
160
128
  });
161
129
  }
@@ -164,11 +132,11 @@ function counter() {
164
132
 
165
133
  function dataCounter() {
166
134
  return _("h1| 0", {
167
- shouldUpdate: true,
168
135
  "data-num": "0",
169
136
  onclick() {
170
137
  const num = this.getAttribute("data-num") * 1 + 1;
171
- this.updateState({ text: num, "data-num": num });
138
+ this.setAttribute("data-num", num });
139
+ this.innerText = num;
172
140
  },
173
141
  });
174
142
  }
@@ -177,13 +145,10 @@ function dataCounter() {
177
145
 
178
146
  function HelloMessage() {
179
147
  return div({
180
- shouldUpdate: true,
181
148
  text: "Click to get a greeting",
182
149
  onclick() {
183
150
  const name = prompt("what are your names");
184
- this.updateState({
185
- text: name ? "hello " + name : "Click to get a greeting",
186
- });
151
+ this.innerText = name ? "hello " + name : "Click to get a greeting";
187
152
  },
188
153
  });
189
154
  }
@@ -203,6 +168,22 @@ const nameRef = new Ref(function (name) {
203
168
  });
204
169
  });
205
170
 
171
+ // reference (not state)
172
+
173
+ function typingExample() {
174
+ const re = new reference();
175
+ return _(
176
+ "div",
177
+ input({
178
+ oninput() {
179
+ re.text.innerText = this.value;
180
+ },
181
+ placeholder: "typing simulation",
182
+ }),
183
+ p(" no thing typed yet!", { reference: re.bindAs("text") })
184
+ );
185
+ }
186
+
206
187
  function App() {
207
188
  return div(counter, dataCounter, HelloMessage, br, nameRef);
208
189
  }
@@ -227,7 +208,7 @@ import _, {
227
208
  p,
228
209
  Ref,
229
210
  reference,
230
- } from "../dist/index.js";
211
+ } from "cradova";
231
212
 
232
213
  function TodoList() {
233
214
  // can be used to hold multiple references
@@ -458,6 +439,7 @@ We are currently working to [set](https://github.com/fridaycandour/cradova/blob/
458
439
  - UI component libraries for cradova
459
440
  - Sample projects
460
441
  - maintenance and promotion
442
+ <!--
461
443
 
462
444
  ## Sponsor
463
445
 
@@ -465,4 +447,4 @@ Your support is appreciated and needed to advance Cradova for more performance a
465
447
 
466
448
  Sponsorships can be done via [Patreon](https://www.patreon.com/FridayCandour) and [KO-FI](https://www.ko-fi.com/fridaycandour).
467
449
 
468
- Both monthly-recurring sponsorships and one-time donations are accepted.
450
+ Both monthly-recurring sponsorships and one-time donations are accepted. -->