@sprlab/wccompiler 0.16.0 → 0.16.2

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/lib/codegen.js CHANGED
@@ -1548,6 +1548,11 @@ export function generateComponent(parseResult, options = {}) {
1548
1548
  lines.push(` __val ? this.${ab.varName}.classList.add(__k) : this.${ab.varName}.classList.remove(__k);`);
1549
1549
  lines.push(' }');
1550
1550
  lines.push(' }));');
1551
+ } else if (ab.expression.trimStart().startsWith('[')) {
1552
+ // Array expression: join with spaces
1553
+ lines.push(' this.__disposers.push(__effect(() => {');
1554
+ lines.push(` this.${ab.varName}.className = (${expr}).join(' ');`);
1555
+ lines.push(' }));');
1551
1556
  } else {
1552
1557
  // String expression: set className
1553
1558
  lines.push(' this.__disposers.push(__effect(() => {');
package/lib/compiler.js CHANGED
@@ -34,6 +34,7 @@ import {
34
34
  extractConstants,
35
35
  extractExpose,
36
36
  extractModels,
37
+ detectBatchUsage,
37
38
  validatePropsAssignment,
38
39
  validateDuplicateProps,
39
40
  validatePropsConflicts,
@@ -164,6 +165,7 @@ async function compileSFC(filePath, config) {
164
165
  const constantVars = extractConstants(sourceForExtraction);
165
166
  const exposeNames = extractExpose(source);
166
167
  const modelDefs = extractModels(sourceForExtraction);
168
+ const usesBatch = detectBatchUsage(sourceForExtraction);
167
169
 
168
170
  // 9. Extract props (array form — after type strip, if generic didn't find any)
169
171
  const propsFromArray = propsFromGeneric.length > 0 ? [] : extractPropsArray(source);
@@ -295,6 +297,7 @@ async function compileSFC(filePath, config) {
295
297
  exposeNames,
296
298
  modelDefs,
297
299
  dynamicComponents: [],
300
+ usesBatch,
298
301
  };
299
302
 
300
303
  // 16. Process template through linkedom → tree-walker → codegen
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprlab/wccompiler",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "description": "Zero-runtime compiler that transforms .wcc single-file components into native web components with signals-based reactivity",
5
5
  "type": "module",
6
6
  "exports": {