aberdeen 1.7.0 → 1.7.1

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
@@ -1,23 +1,29 @@
1
1
  # [Aberdeen](https://aberdeenjs.org/) [![](https://img.shields.io/badge/license-ISC-blue.svg)](https://github.com/vanviegen/aberdeen/blob/master/LICENSE.txt) [![](https://badge.fury.io/js/aberdeen.svg)](https://badge.fury.io/js/aberdeen) ![](https://img.shields.io/bundlejs/size/aberdeen) [![](https://img.shields.io/github/last-commit/vanviegen/aberdeen)](https://github.com/vanviegen/aberdeen)
2
2
 
3
- Build fast reactive UIs in pure TypeScript/JavaScript without a virtual DOM.
3
+ Reactive UIs in plain TypeScript. Simple to learn, fast to ship.
4
4
 
5
- Aberdeen's approach is refreshingly simple:
6
-
7
- > Use many small anonymous functions for emitting DOM elements, and automatically rerun them when their underlying data changes. JavaScript `Proxy` is used to track reads and updates to this data, which can consist of anything, from simple values to complex, typed, and deeply nested data structures.
5
+ Aberdeen wraps your state in ES6 `Proxy` objects for fine-grained property access tracking, then automatically re-executes only the DOM-building closures that depend on changed data. So we get precise DOM updates with neither virtual DOM diffing nor compiler magic.
8
6
 
9
7
  ## Why use Aberdeen?
10
8
 
11
- - 🎩 **Simple:** Express UIs naturally in JavaScript/TypeScript, without build steps or JSX, and with a minimal amount of concepts you need to learn.
12
- - **Fast:** No virtual DOM. Aberdeen intelligently updates only the minimal, necessary parts of your UI when proxied data changes.
13
- - 👥 **Awesome lists**: It's very easy and performant to reactively display data sorted by whatever you like.
14
- - 🔬 **Tiny:** Around 6KB (minimized and gzipped) for the core system. Zero runtime dependencies.
15
- - 🔋 **Batteries included**: Comes with browser history management, routing, revertible patches for optimistic user-interface updates, component-local CSS, SVG support, helper functions for transforming reactive data (mapping, partitioning, filtering, etc) and hide/unhide transition effects. No bikeshedding required!
9
+ - **Simple:** Express UIs naturally in JavaScript/TypeScript, without requiring build steps or JSX, and with a minimal amount of concepts you need to learn.
10
+ - **Type-safe:** Your reactive state can be regular TypeScript objects and arrays, with full type safety and autocompletion.
11
+ - **Fast:** No virtual DOM. Aberdeen intelligently updates only the minimal, necessary parts of your UI when proxied data changes.
12
+ - **Awesome lists**: It's very easy and performant to reactively display data sorted by whatever you like.
13
+ - **Tiny:** Around 7KB (minimized and gzipped) for the core system. Zero runtime dependencies.
14
+ - **Batteries included**: Comes with...
15
+ - Browser history management
16
+ - Routing
17
+ - Revertible patches for optimistic user-interface updates
18
+ - Component-local CSS with Tailwind-like shorthands
19
+ - SVG support
20
+ - Helper functions for transforming reactive data (mapping, partitioning, filtering, etc)
21
+ - Hide/unhide transition effects
16
22
 
17
23
  ## Why *not* use Aberdeen?
18
24
 
19
- - 🤷 **Lack of community:** There are not many of us -Aberdeen developers- yet, so don't expect terribly helpful Stack Overflow/AI answers.
20
- - 📚 **Lack of ecosystem:** You'd have to code things yourself, instead of duct-taping together a gazillion React ecosystem libraries.
25
+ - **Lack of community:** There are not many of us -Aberdeen developers- yet, so don't expect terribly helpful Stack Overflow/AI answers.
26
+ - **Lack of ecosystem:** You'd have to code things yourself, instead of duct-taping together a gazillion React ecosystem libraries.
21
27
 
22
28
  ## Examples
23
29
 
package/dist/aberdeen.js CHANGED
@@ -1366,6 +1366,15 @@ function insertCss(style) {
1366
1366
  $(`style#${css}`);
1367
1367
  return prefix;
1368
1368
  }
1369
+ function combinePrefixSelector(prefix, key) {
1370
+ const sel = [];
1371
+ for (const p of prefix.split(",")) {
1372
+ for (const k of key.split(",")) {
1373
+ sel.push(k.includes("&") ? k.trim().replace(/&/g, p) : `${p} ${k.trim()}`.trim());
1374
+ }
1375
+ }
1376
+ return sel.join(",");
1377
+ }
1369
1378
  function objectToCss(style, prefix) {
1370
1379
  let css = "";
1371
1380
  for (const [key, val] of Object.entries(style)) {
@@ -1375,8 +1384,7 @@ function objectToCss(style, prefix) {
1375
1384
  ${objectToCss(val, prefix)}}
1376
1385
  `;
1377
1386
  } else {
1378
- const sel = key === "&" ? prefix : key.includes("&") ? key.replace(/&/g, prefix) : `${prefix} ${key}`.trim();
1379
- css += objectToCss(val, sel);
1387
+ css += objectToCss(val, combinePrefixSelector(prefix, key));
1380
1388
  }
1381
1389
  } else if (typeof val === "string") {
1382
1390
  if (key.startsWith("@")) {
@@ -1384,8 +1392,7 @@ ${objectToCss(val, prefix)}}
1384
1392
  ${styleStringToCss(val, prefix)}}
1385
1393
  `;
1386
1394
  } else {
1387
- const sel = key.includes("&") ? key.replace(/&/g, prefix) : `${prefix} ${key}`.trim();
1388
- css += styleStringToCss(val, sel);
1395
+ css += styleStringToCss(val, combinePrefixSelector(prefix, key));
1389
1396
  }
1390
1397
  }
1391
1398
  }
@@ -1666,5 +1673,5 @@ export {
1666
1673
  $
1667
1674
  };
1668
1675
 
1669
- //# debugId=77770EA398EEA24264756E2164756E21
1676
+ //# debugId=453EEBC759CEDD8964756E2164756E21
1670
1677
  //# sourceMappingURL=aberdeen.js.map