@octanejs/styled-components 0.1.27 → 0.1.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/styled-components",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -42,7 +42,7 @@
42
42
  "stylis": "^4.4.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "octane": "0.1.35"
45
+ "octane": "0.1.36"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@tsrx/react": "^0.2.56",
@@ -52,7 +52,7 @@
52
52
  "react-dom": "^19.2.7",
53
53
  "styled-components": "6.4.3",
54
54
  "vitest": "^4.1.10",
55
- "octane": "0.1.35"
55
+ "octane": "0.1.36"
56
56
  },
57
57
  "scripts": {
58
58
  "test": "vitest run"
package/src/index.ts CHANGED
@@ -21,6 +21,9 @@ import ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from './models/T
21
21
  import styled from './constructors/styled';
22
22
  import isStyledComponent from './utils/isStyledComponent';
23
23
 
24
+ // Package contract (ordinary test evidence, not parity-counted):
25
+ // This runtime package intentionally exposes no Babel css-prop transform.
26
+
24
27
  export * from './secretInternals';
25
28
  export type {
26
29
  Attrs,
@@ -7,6 +7,7 @@
7
7
  // additionally accumulates rules in-memory so `getStyleTags()` /
8
8
  // `getStyleElement()` keep working. `interleaveWithNodeStream` is not
9
9
  // supported — octane's `renderToPipeableStream` already streams styles.
10
+ // Package contract (ordinary test evidence, not parity-counted).
10
11
  import { createElement } from 'octane';
11
12
 
12
13
  import { SC_ATTR, SC_ATTR_VERSION, SC_VERSION } from '../constants';
@@ -81,7 +82,8 @@ export default class ServerStyleSheet {
81
82
  };
82
83
 
83
84
  interleaveWithNodeStream(_input: unknown): never {
84
- // OCTANE DIVERGENCE: octane's renderToPipeableStream already emits each
85
+ // Package contract (ordinary test evidence, not parity-counted):
86
+ // Octane's renderToPipeableStream already emits each
85
87
  // pass's style chunks ahead of its html, so there is nothing to interleave.
86
88
  throw styledError(3);
87
89
  }
@@ -4,6 +4,7 @@
4
4
  // to the created element (octane attaches refs from props natively).
5
5
  // - No RSC/`__SERVER__` build flags: server output is selected by the active
6
6
  // stylesheet backend at runtime.
7
+ // Package contract (ordinary test evidence, not parity-counted):
7
8
  // - `defaultProps` is resolved by this factory at render time (octane's
8
9
  // compiled call sites do not apply component defaultProps).
9
10
  import isPropValid from '@emotion/is-prop-valid';
@@ -135,7 +136,8 @@ function buildPropsForElement(
135
136
  } else if (key === 'forwardedAs') {
136
137
  propsForElement.as = context.forwardedAs;
137
138
  } else if (key === 'ref') {
138
- // octane refs are plain props; a ref always attaches to the created
139
+ // Package contract (ordinary test evidence, not parity-counted):
140
+ // ref is a plain Octane prop that always attaches to the rendered
139
141
  // element and is never subject to shouldForwardProp filtering.
140
142
  propsForElement.ref = context.ref;
141
143
  } else if (!shouldForwardProp || shouldForwardProp(key, elementToBeCreated)) {
package/src/types.ts CHANGED
@@ -186,6 +186,7 @@ export interface IStyledStatics<
186
186
  }
187
187
 
188
188
  /**
189
+ * Package contract (ordinary typetest evidence, not parity-counted):
189
190
  * The pragmatic octane polymorphic call surface: declared own props are fully
190
191
  * typed; `as`/`forwardedAs` retarget rendering; all remaining DOM/`as`-target
191
192
  * props flow through a permissive prop bag (octane has no per-tag
@@ -1,3 +1,4 @@
1
+ // Package contract (ordinary test evidence, not parity-counted):
1
2
  // Octane adaptation: upstream detects styled() calls made during render by
2
3
  // probing the React hook dispatcher (monkey-patching console.error around a
3
4
  // throwaway useState call). Octane has no equivalent probe, so this uses a
@@ -5,7 +6,7 @@
5
6
  // displayName is the observable signature of in-render creation. The
6
7
  // threshold matches warnTooManyClasses so both warnings describe the same
7
8
  // runaway pattern.
8
- const CREATION_LIMIT = 200;
9
+ import { LIMIT as CREATION_LIMIT } from './createWarnTooManyClasses';
9
10
 
10
11
  const creationCounts: Map<string, number> = new Map();
11
12
  const warned: Set<string> = new Set();
@@ -1,6 +1,7 @@
1
1
  import { StyledComponentBrand } from '../types';
2
2
 
3
3
  /**
4
+ * Package contract (ordinary test evidence, not parity-counted):
4
5
  * Octane adaptation: upstream brands styled components with React's
5
6
  * forward-ref `$$typeof` so HOCs that hoist statics (and therefore inherit
6
7
  * `styledComponentId`) are not mistaken for real styled components. Octane
@@ -367,6 +367,7 @@ export default function createStylisInstance(
367
367
  // Upstream 6.4.3 calls the error factory here without `throw`ing its
368
368
  // result, so unnamed plugins silently collide. The octane port enforces
369
369
  // the documented error-15 contract.
370
+ // Package contract (ordinary test evidence, not parity-counted).
370
371
  if (!plugins[i].name) throw throwStyledError(15);
371
372
  h = phash(h, plugins[i].name);
372
373
  }