@bamboocss/vite 1.17.3 → 1.19.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/dist/index.cjs +4 -4
- package/dist/index.d.cts +4 -2
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +5 -5
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -693,9 +693,9 @@ const createCssContext = (ctx) => ({
|
|
|
693
693
|
});
|
|
694
694
|
const createRuntimeCss = (ctx) => {
|
|
695
695
|
const cssContext = createCssContext(ctx);
|
|
696
|
-
const cssFn = (0, _bamboocss_shared.
|
|
697
|
-
const {
|
|
698
|
-
return (...styles) => cssFn(
|
|
696
|
+
const cssFn = (0, _bamboocss_shared.createCssUncached)(cssContext);
|
|
697
|
+
const { mergeCssUncached } = (0, _bamboocss_shared.createMergeCss)(cssContext);
|
|
698
|
+
return (0, _bamboocss_shared.memo)((...styles) => cssFn(mergeCssUncached(...styles)));
|
|
699
699
|
};
|
|
700
700
|
/**
|
|
701
701
|
* The map is every token in the project, so it is built once per context and shared by
|
|
@@ -748,7 +748,7 @@ const createRuntimeRecipe = (ctx) => {
|
|
|
748
748
|
const className = slot ? ctx.recipes.getSlotKey(node.className, slot) : node.className;
|
|
749
749
|
const { defaultVariants = {} } = config;
|
|
750
750
|
const compoundVariants = slot ? (0, _bamboocss_shared.getSlotCompoundVariant)(config.compoundVariants ?? [], slot) : config.compoundVariants ?? [];
|
|
751
|
-
const recipeCss = (0, _bamboocss_shared.
|
|
751
|
+
const recipeCss = (0, _bamboocss_shared.createCssUncached)({
|
|
752
752
|
hash: Boolean(ctx.hash.className),
|
|
753
753
|
conditions: {
|
|
754
754
|
shift: ctx.conditions.shift,
|
package/dist/index.d.cts
CHANGED
|
@@ -18,8 +18,10 @@ import { Plugin } from "vite";
|
|
|
18
18
|
* construction. What still needs asserting — and is asserted in `__tests__` — is that
|
|
19
19
|
* these class names correspond to rules the build actually emits.
|
|
20
20
|
*
|
|
21
|
-
* Mirrors `generateCssFn` in `@bamboocss/generator`: `css = (...styles) =>
|
|
22
|
-
* cssFn(
|
|
21
|
+
* Mirrors `generateCssFn` in `@bamboocss/generator`: `css = memo((...styles) =>
|
|
22
|
+
* cssFn(mergeCssUncached(...styles)))`, with the memo on the argument list and neither
|
|
23
|
+
* inner cache. Unlike the generated runtime this one is built once per build and shared
|
|
24
|
+
* across every module, so the outer cache is what carries the repeats.
|
|
23
25
|
*/
|
|
24
26
|
interface RuntimeCss {
|
|
25
27
|
(...styles: Dict[]): string;
|
package/dist/index.d.mts
CHANGED
|
@@ -18,8 +18,10 @@ import { Plugin } from "vite";
|
|
|
18
18
|
* construction. What still needs asserting — and is asserted in `__tests__` — is that
|
|
19
19
|
* these class names correspond to rules the build actually emits.
|
|
20
20
|
*
|
|
21
|
-
* Mirrors `generateCssFn` in `@bamboocss/generator`: `css = (...styles) =>
|
|
22
|
-
* cssFn(
|
|
21
|
+
* Mirrors `generateCssFn` in `@bamboocss/generator`: `css = memo((...styles) =>
|
|
22
|
+
* cssFn(mergeCssUncached(...styles)))`, with the memo on the argument list and neither
|
|
23
|
+
* inner cache. Unlike the generated runtime this one is built once per build and shared
|
|
24
|
+
* across every module, so the outer cache is what carries the repeats.
|
|
23
25
|
*/
|
|
24
26
|
interface RuntimeCss {
|
|
25
27
|
(...styles: Dict[]): string;
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { box, maybeBoxNode, unbox } from "@bamboocss/extractor";
|
|
|
3
3
|
import MagicString from "magic-string";
|
|
4
4
|
import { Node, SyntaxKind, VariableDeclarationKind } from "ts-morph";
|
|
5
5
|
import { Recipes } from "@bamboocss/core";
|
|
6
|
-
import { compact,
|
|
6
|
+
import { compact, createCssUncached, createMergeCss, getSlotCompoundVariant, memo, withoutSpace } from "@bamboocss/shared";
|
|
7
7
|
import { resolve } from "node:path";
|
|
8
8
|
import { logger } from "@bamboocss/logger";
|
|
9
9
|
import { loadConfigAndCreateContext } from "@bamboocss/node";
|
|
@@ -666,9 +666,9 @@ const createCssContext = (ctx) => ({
|
|
|
666
666
|
});
|
|
667
667
|
const createRuntimeCss = (ctx) => {
|
|
668
668
|
const cssContext = createCssContext(ctx);
|
|
669
|
-
const cssFn =
|
|
670
|
-
const {
|
|
671
|
-
return (...styles) => cssFn(
|
|
669
|
+
const cssFn = createCssUncached(cssContext);
|
|
670
|
+
const { mergeCssUncached } = createMergeCss(cssContext);
|
|
671
|
+
return memo((...styles) => cssFn(mergeCssUncached(...styles)));
|
|
672
672
|
};
|
|
673
673
|
/**
|
|
674
674
|
* The map is every token in the project, so it is built once per context and shared by
|
|
@@ -721,7 +721,7 @@ const createRuntimeRecipe = (ctx) => {
|
|
|
721
721
|
const className = slot ? ctx.recipes.getSlotKey(node.className, slot) : node.className;
|
|
722
722
|
const { defaultVariants = {} } = config;
|
|
723
723
|
const compoundVariants = slot ? getSlotCompoundVariant(config.compoundVariants ?? [], slot) : config.compoundVariants ?? [];
|
|
724
|
-
const recipeCss =
|
|
724
|
+
const recipeCss = createCssUncached({
|
|
725
725
|
hash: Boolean(ctx.hash.className),
|
|
726
726
|
conditions: {
|
|
727
727
|
shift: ctx.conditions.shift,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/vite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Vite integration for Bamboo CSS",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"magic-string": "0.30.21",
|
|
37
37
|
"ts-morph": "28.0.0",
|
|
38
|
-
"@bamboocss/
|
|
39
|
-
"@bamboocss/
|
|
40
|
-
"@bamboocss/
|
|
41
|
-
"@bamboocss/
|
|
42
|
-
"@bamboocss/
|
|
43
|
-
"@bamboocss/types": "1.
|
|
44
|
-
"@bamboocss/shared": "1.
|
|
38
|
+
"@bamboocss/extractor": "1.19.0",
|
|
39
|
+
"@bamboocss/logger": "1.19.0",
|
|
40
|
+
"@bamboocss/core": "1.19.0",
|
|
41
|
+
"@bamboocss/node": "1.19.0",
|
|
42
|
+
"@bamboocss/config": "1.19.0",
|
|
43
|
+
"@bamboocss/types": "1.19.0",
|
|
44
|
+
"@bamboocss/shared": "1.19.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
48
48
|
"vite": "7.2.6",
|
|
49
|
-
"@bamboocss/fixture": "1.
|
|
49
|
+
"@bamboocss/fixture": "1.19.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"vite": ">=5"
|