@meonode/ui 1.2.0-0 → 1.3.0-beta.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.
Files changed (31) hide show
  1. package/dist/cjs/core.node.cjs +1 -1
  2. package/dist/cjs/util/node.util.cjs +1 -1
  3. package/dist/esm/components/html.node.d.ts +262 -262
  4. package/dist/esm/components/portal-host.client.d.ts +1 -15
  5. package/dist/esm/components/portal-host.client.d.ts.map +1 -1
  6. package/dist/esm/components/portal-host.d.ts +1 -1
  7. package/dist/esm/components/portal-provider.d.ts +1 -1
  8. package/dist/esm/components/react.node.d.ts +3 -3
  9. package/dist/esm/components/style-registry.client.d.ts.map +1 -1
  10. package/dist/esm/components/styled-renderer.client.d.ts +1 -1
  11. package/dist/esm/components/styled-renderer.client.d.ts.map +1 -1
  12. package/dist/esm/components/theme-provider.d.ts +1 -1
  13. package/dist/esm/constant/common.const.d.ts +1 -1
  14. package/dist/esm/core.node.d.ts.map +1 -1
  15. package/dist/esm/core.node.js +1 -1
  16. package/dist/esm/helper/common.helper.d.ts +1 -1
  17. package/dist/esm/helper/common.helper.d.ts.map +1 -1
  18. package/dist/esm/helper/react-is.helper.d.ts +1 -1
  19. package/dist/esm/helper/react-is.helper.d.ts.map +1 -1
  20. package/dist/esm/hook/usePortal.d.ts +2 -2
  21. package/dist/esm/hook/usePortal.d.ts.map +1 -1
  22. package/dist/esm/nextjs-registry/index.d.ts +1 -1
  23. package/dist/esm/util/mount-tracker.util.d.ts.map +1 -1
  24. package/dist/esm/util/navigation-cache-manager.util.d.ts.map +1 -1
  25. package/dist/esm/util/node.util.d.ts +13 -2
  26. package/dist/esm/util/node.util.d.ts.map +1 -1
  27. package/dist/esm/util/node.util.js +1 -1
  28. package/dist/esm/util/theme.util.d.ts +2 -2
  29. package/dist/esm/util/theme.util.d.ts.map +1 -1
  30. package/package.json +26 -21
  31. package/CHANGELOG.md +0 -1352
package/CHANGELOG.md DELETED
@@ -1,1352 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## [1.2.0-0] - 2026-02-15
6
-
7
- ### Feat
8
-
9
- - **portal**: implement stack-based portal system with PortalProvider and PortalHost ([`7196f6f`](https://github.com/l7aromeo/meonode-ui/commit/7196f6f))
10
- - Introduced `PortalProvider` and `PortalHost` for managed overlay stacks.
11
- - **helper**: add data-channel helper for efficient portal updates ([`6508c0a`](https://github.com/l7aromeo/meonode-ui/commit/6508c0a))
12
- - Added `createDataChannel` for high-performance, subscription-based state updates between components.
13
- - **hook**: add usePortal and useDataChannel hooks ([`b2f7d19`](https://github.com/l7aromeo/meonode-ui/commit/b2f7d19))
14
- - Added reactive hooks to interact with the new portal system and data channels.
15
-
16
- ### Refactor
17
-
18
- - **portal**: remove legacy portal system and update core ([`91ced63`](https://github.com/l7aromeo/meonode-ui/commit/91ced63))
19
- - **BREAKING CHANGE**: Removed legacy `portal.hoc.ts` and associated logic in favor of the new stack-based architecture.
20
- - Updated `BaseNode` and `NodeUtil` for better portal integration.
21
-
22
- ### Test
23
-
24
- - **portal**: add tests for new portal system ([`92cd3c0`](https://github.com/l7aromeo/meonode-ui/commit/92cd3c0))
25
- - Added integration tests for stack management and data synchronization.
26
-
27
- ### Docs
28
-
29
- - **portal**: update README with new portal system examples ([`3f7a314`](https://github.com/l7aromeo/meonode-ui/commit/3f7a314))
30
-
31
- ## [1.1.4] - 2026-02-15
32
-
33
- ### Fix
34
-
35
- - **nextjs**: prevent duplicate style tags and content in StyleRegistry ([`91bec99`](https://github.com/l7aromeo/meonode-ui/commit/91bec99))
36
- - Renamed `registry.client.ts` to `style-registry.client.ts` and implemented tracking of inserted IDs during SSR to avoid duplicate CSS injection in Next.js streaming.
37
-
38
- ### Test
39
-
40
- - **emotion**: add style tag generation monitoring test ([`0576f0c`](https://github.com/l7aromeo/meonode-ui/commit/0576f0c))
41
- - Added tests to verify that nested `Div` structures efficiently batch styles into a single style tag and that state changes correctly append new rules.
42
-
43
- ## [1.1.3] - 2026-02-15
44
-
45
- ### Feat
46
-
47
- - **hook**: remove deprecated `usePortal` hook and related portal update logic ([`eb40bd1`](https://github.com/l7aromeo/meonode-ui/commit/eb40bd1))
48
- - Deleted the unstable `usePortal` hook and removed the `update` method from `NodePortal` and `Portal` HOC to streamline the API.
49
-
50
- ### Refactor
51
-
52
- - **core**: optimize core logic, instance ID generation, and utility helpers ([`27fdd1b`](https://github.com/l7aromeo/meonode-ui/commit/27fdd1b))
53
- - Switched `instanceId` to use a static counter for deterministic IDs.
54
- - Optimized the iterative render loop by reducing array allocations and improving capacity checks.
55
- - Refactored `NodeUtil.isNodeInstance` to use `instanceof BaseNode` for better performance.
56
- - Improved `getGlobalState` to use a shared internal scope.
57
- - Enhanced `NodeUtil` with a weak map cache for function prop hashes.
58
-
59
- ### Build
60
-
61
- - **rollup**: update configuration to use `.cjs` extension for CommonJS output ([`7f6a130`](https://github.com/l7aromeo/meonode-ui/commit/7f6a130))
62
- - Updated `rollup.config.ts` and `package.json` to use `.cjs` for CJS bundles to ensure compatibility in ESM-first environments.
63
-
64
- ### Chore
65
-
66
- - **deps**: update dependencies to latest versions ([`f95591e`](https://github.com/l7aromeo/meonode-ui/commit/f95591e))
67
- - Updated various devDependencies including `typescript-eslint`, `next`, `react`, and `rollup`.
68
- - **git**: update `.gitignore` to include AI-related directories ([`0607574`](https://github.com/l7aromeo/meonode-ui/commit/0607574))
69
- - Added `.claude` to the ignore list.
70
-
71
- ## [1.1.2] - 2025-12-22
72
-
73
- ### Fix
74
-
75
- - **types**: fix `ThemedCSSObject` to support nested selectors and theme functions in deeply nested objects ([`f938be5`](https://github.com/l7aromeo/meonode-ui/commit/f938be5ca17cb5af076e567cfb7df8a7df97cf0d))
76
- - Updated `ThemedCSSObject` to use an intersection type with an index signature, allowing arbitrary string keys (like pseudo-selectors and media queries) to correctly resolve theme functions.
77
-
78
- ### Chore
79
-
80
- - **deps**: update dependencies to latest versions ([`51925b1`](https://github.com/l7aromeo/meonode-ui/commit/51925b152ac8406f16ce627adc61ba4c3f442fc7))
81
- - Updated `next` to `^16.1.0`, `react-router-dom` to `^7.11.0`, `rollup` to `^4.54.0`, `@testing-library/react` to `^16.3.1` and `@typescript/native-preview` to `^7.0.0`.
82
-
83
- ## [1.1.1] - 2025-12-05
84
-
85
- ### Fix
86
- - **types**: update HasCSSCompatibleStyleProp to use CSSProperties directly ([`4e23499`](https://github.com/l7aromeo/meonode-ui/commit/4e234990147baba72064a2f7b4ff03fedfe23a98))
87
-
88
- ## [1.1.0] - 2025-12-05
89
-
90
- ### Feat
91
-
92
- - **types**: enforce strict component props and improve type inference ([`047c0f8`](https://github.com/l7aromeo/meonode-ui/commit/047c0f8))
93
- - Redefined `MergedProps` and introduced `ValidateComponentProps` to strictly validate props passed to `Node` and `createNode`.
94
- - Added `ExactProps` generic constraint to prevent excess property passing, improving type safety.
95
- - Enhanced `PropsOf` to better infer props from React components, including `forwardRef` and `Memo` components.
96
- - **theme**: enable theme variable resolution in style keys ([`30ca1fd`](https://github.com/l7aromeo/meonode-ui/commit/30ca1fd))
97
- - Updated `ThemeUtil` to resolve theme variables within style keys (e.g., media queries like `@media (max-width: theme.breakpoint.lg)`).
98
-
99
- ### Refactor
100
-
101
- - **portal**: optimize portal implementation and fix types ([`9643682`](https://github.com/l7aromeo/meonode-ui/commit/9643682))
102
- - Refactored `Portal` HOC to use a cleaner, more efficient implementation for provider wrapping.
103
- - Improved type definitions for `PortalLauncher` and `PortalProps` to ensure correct prop inference.
104
-
105
- ### Fix
106
-
107
- - **util**: correct function child detection and rendering logic ([`944cfbd`](https://github.com/l7aromeo/meonode-ui/commit/944cfbd))
108
- - Updated `isFunctionChild` type definition to correctly identify function children while excluding React components (Class, Memo, ForwardRef).
109
- - Updated `functionRenderer` type definition to properly handle function child execution.
110
-
111
- ### Test
112
-
113
- - **test**: refactor tests to align with strict types and fix leaks ([`40c87c7`](https://github.com/l7aromeo/meonode-ui/commit/40c87c7))
114
- - Updated various tests (`advanced-features`, `leak-repro`, `memoization`) to comply with the new strict type requirements.
115
- - Added `strict-component-props.test.ts` and `theme-key-resolution.test.ts` to verify new features.
116
-
117
- ### Chore
118
-
119
- - **build**: update build config and dependencies ([`a9367e0`](https://github.com/l7aromeo/meonode-ui/commit/a9367e0))
120
- - Updated `package.json` scripts and `tsconfig.json` for better build and test processes.
121
-
122
- ## [1.0.1] - 2025-11-30
123
-
124
- ### Fix
125
-
126
- - **core**: fix style prop extraction for React Components ([`19618b4`](https://github.com/l7aromeo/meonode-ui/commit/19618b4))
127
- - Modified `processRawNode` to prevent `style` props from being extracted and flattened into HTML attributes when the node is a React Component.
128
- - This ensures components receive their `style` prop intact as an object, preventing invalid attribute errors.
129
-
130
- ## [1.0.0] - 2025-11-28
131
-
132
- ### Perf
133
-
134
- - **cache**: Remove props, CSS, and theme caching to improve performance and reduce overhead. ([`206361d`](https://github.com/l7aromeo/meonode-ui/commit/206361d)), ([`d7baa16`](https://github.com/l7aromeo/meonode-ui/commit/d7baa16))
135
-
136
- ### Fix
137
-
138
- - **theme-provider**: Allow `setTheme` to accept an updater function for more flexible state management. ([`be8d261`](https://github.com/l7aromeo/meonode-ui/commit/be8d261))
139
- - **core**: Improve mount tracking for cached elements by ensuring `MeoNodeUnmounter` wraps all renderable nodes. ([`d0ca27e`](https://github.com/l7aromeo/meonode-ui/commit/d0ca27e))
140
- - **theme-provider**: Remove incorrect `@private` JSDoc tag from `ThemeProvider` component. ([`816e398`](https://github.com/l7aromeo/meonode-ui/commit/816e398))
141
-
142
- ### Test
143
-
144
- - **performance**: Add controlled input performance tests to simulate human typing and measure `deps` memoization effectiveness. ([`bba48b8`](https://github.com/l7aromeo/meonode-ui/commit/bba48b8))
145
-
146
- ### Docs
147
-
148
- - **readme**: Update `README.md` to reflect the removal of automatic caching and emphasize `deps`-based memoization. ([`2600d9c`](https://github.com/l7aromeo/meonode-ui/commit/2600d9c))
149
-
150
- ## [1.0.0-0] - 2025-11-27
151
-
152
- ### Fix
153
-
154
- - **core**: Overhaul mount tracking, caching, and fix stableKey generation to prevent memory leaks ([`af1b707`](https://github.com/l7aromeo/meonode-ui/commit/af1b707187b66cdbf9fe88f791aee30cfc7d2835))
155
- - Replaced the simple `Set` in `MountTrackerUtil` with a reference-counting system (`Map`) to ensure a node is only considered unmounted when all its instances are gone.
156
- - The root element of a render cycle is now wrapped with a `MeoNodeUnmounter` component before being cached to guarantee that the unmount logic is always present, even for cached elements.
157
- - Improved `stableKey` generation in `NodeUtil.createPropSignature` to correctly differentiate function props by hashing their string representation, preventing cache collisions for components with different `onClick` or similar handlers.
158
- - Added new test suites (`leak-repro.test.ts`, `props-caching-leak.test.ts`) to specifically target and verify the leak fixes.
159
-
160
- ### Perf
161
-
162
- - **cache**: Improve props cache eviction strategy ([`ce2f561`](https://github.com/l7aromeo/meonode-ui/commit/ce2f5616b21d68873dff0f1c4466bf9a2a40ce4d))
163
- - Adjusted the `propProcessingCache` eviction logic in `NodeUtil` to be more aggressive, removing enough items to get back to the `CACHE_SIZE_LIMIT` plus an additional buffer batch, preventing unbounded growth under high load.
164
-
165
- ### Feat
166
-
167
- - **deps**: Add react-router-dom and test polyfills ([`29dcf13`](https://github.com/l7aromeo/meonode-ui/commit/29dcf137b5ebcba0e09e5acf13aadac6a0a0f513))
168
- - Introduced `react-router-dom` as a new development dependency to enable integration testing with React Router.
169
- - Added `whatwg-fetch` and Node.js `util` polyfills to `jest.setup.ts` for compatibility in the Jest environment.
170
-
171
- ### Test
172
-
173
- - **react-router**: Add integration tests for react-router-dom ([`8478623`](https://github.com/l7aromeo/meonode-ui/commit/8478623add6bc66b9805a3ec9c0661f4df223f63))
174
- - Introduced a new test suite to verify the proper functioning and caching behavior of MeoNode components when used within a React Router environment.
175
- - Includes tests for declarative and programmatic navigation, ensuring that component lifecycles and caching mechanisms interact correctly with React Router's dynamic rendering.
176
-
177
- ### Chore
178
- - **package**: Rename publish:pre script to publish:prerelease and add publish:premajor script in package.json ([`a98ba69`](https://github.com/l7aromeo/meonode-ui/commit/a98ba697a6e024126256a0e2517c839bbecd8058))
179
-
180
- ## [0.4.14] - 2025-11-23
181
-
182
- ### Perf
183
-
184
- - **cache**: enforce dependency-based caching with shouldCacheElement helper ([
185
- `fab5525`](https://github.com/l7aromeo/meonode-ui/commit/fab55253093fbd2958ad84bcc98b1f0d1a07349c))
186
- - Introduces NodeUtil.shouldCacheElement() helper to centralize and enforce the opt-in caching strategy where only
187
- nodes with explicit dependencies are cached
188
- - Completes the memory optimization by closing loopholes where nodes without dependencies were still being cached
189
- based on stableKey alone
190
- - Replaces 4 inconsistent cache eligibility checks in BaseNode.render():
191
- - Cache lookup for parent nodes
192
- - Cache lookup for child nodes
193
- - Cache storage during rendering
194
- - MeoNodeUnmounter wrapping decision
195
- - Impact: Reduces memory usage, ensures mount tracking and cache operations stay in sync, improves code
196
- maintainability
197
-
198
- ### Test
199
-
200
- - **memoization**: refine test to assert precise cache size after rendering components ([
201
- `8ded697`](https://github.com/l7aromeo/meonode-ui/commit/8ded6974cc1565c384abe1a3ca54e1f7bc8a9619))
202
-
203
- ### Chore
204
-
205
- - **type**: remove src/types/env.d.ts as it is no longer needed ([aab4299](https://github.com/l7aromeo/meonode-ui/commit/aab429944bf12269d5e6116d3460ff354a42f673))
206
-
207
- ## [0.4.13] - 2025-11-23
208
-
209
- ### Fix
210
-
211
- - **props**: improve prop handling and prevent leakage ([
212
- `73cc696`](https://github.com/l7aromeo/meonode-ui/commit/73cc696b3df8c1bd2ddef789de58febc6cd2f1c5))
213
- - This commit refactors prop handling within the MeoNode ecosystem to ensure that internal processing props are not
214
- leaked to the DOM.
215
- - Key changes:
216
- - The `MeoNodeUnmounter` is updated to correctly isolate and pass through props intended for the underlying DOM
217
- element, improving compatibility with libraries like MUI.
218
- - Internal props such as `node`, `css`, and `disableEmotion` are now explicitly prevented from being rendered as
219
- HTML attributes.
220
- - Added comprehensive tests to verify that standard HTML attributes are passed through while internal props are
221
- successfully filtered out.
222
- - This improves the robustness and predictability of component rendering.
223
-
224
- ### Test
225
-
226
- - **props**: add tests for prop handling and leakage ([
227
- `a508e10`](https://github.com/l7aromeo/meonode-ui/commit/a508e107539d9ce84e8d99b63a0af329b28f3249))
228
- - Added new tests to verify that component props are correctly passed as HTML attributes, handle createNode and
229
- Node() correctly, and crucially, that internal MeoNode props are not leaked to the DOM.
230
-
231
- ### Chore
232
-
233
- - **core**: remove unnecessary type assertion from finalChildren assignment ([
234
- `827b3ef`](https://github.com/l7aromeo/meonode-ui/commit/827b3ef4490bca08d58ef5fe1fd885aadbbb1524))
235
-
236
- ## [0.4.12] - 2025-11-21
237
-
238
- ### Feat
239
-
240
- - **build**: migrate from Babel to Rollup with ESM and CJS support ([
241
- `70326a1`](https://github.com/l7aromeo/meonode-ui/commit/70326a107259c095d571b838dda15ffbf845af1d))
242
- - Replace Babel build system with Rollup configuration to prevent output legacy javascript code
243
- - Add support for both ESM and CJS output formats
244
- - Update package.json exports to point to new build outputs
245
- - Add Rollup plugins for TypeScript, commonjs, minification, and preserve directives
246
- - Remove Babel-related dependencies and configuration files
247
- - Update tsconfig.json to use 'preserve' module setting and bundler resolution
248
- - Configure build to output to separate ESM and CJS directories
249
-
250
- ## [0.4.11] - 2025-11-21
251
-
252
- ### Fix
253
-
254
- - **core**: enhance MeoNodeUnmounter cleanup logic and support additional props cloning ([
255
- `02c17f7`](https://github.com/l7aromeo/meonode-ui/commit/02c17f7))
256
- - Refactor MeoNodeUnmounter to use useEffectEvent for stable cleanup on unmount
257
- - Cleanup removes node from BaseNode.elementCache, untracks mount via MountTrackerUtil, unregisters from
258
- BaseNode.cacheCleanupRegistry, and clears lastSignature to prevent memory leaks
259
- - Support cloning and forwarding additional props to valid React children elements
260
-
261
- ### Refactor
262
-
263
- - **node.util**: enhance documentation for utility methods and improve clarity ([
264
- `ee42c24`](https://github.com/l7aromeo/meonode-ui/commit/ee42c24))
265
- - **theme**: reorder ThemeResolverCache methods for clarity ([
266
- `cb842c8`](https://github.com/l7aromeo/meonode-ui/commit/cb842c8))
267
- - Moved `_generateCacheKey` and `_evict` methods below the main logic in `ThemeResolverCache` for better readability
268
- and organization
269
- - Removed duplicate declaration of `_instance` property
270
- - Kept functionality unchanged, improving code structure and maintainability
271
-
272
- ### Test
273
-
274
- - **perf**: add memory leak detection test for navigation cycles and improve formatMemory function ([
275
- `ba139fc`](https://github.com/l7aromeo/meonode-ui/commit/ba139fc))
276
- - Added a new performance test to detect memory leaks during repeated navigation cycles between pages
277
- - The test measures heap memory usage before, during, and after navigation, ensuring memory growth stays within
278
- acceptable limits
279
- - Enhanced the formatMemory utility to correctly handle negative byte values and added JSDoc comments for clarity
280
- - Removed an obsolete shallowly equal props performance test to streamline the test suite
281
- - **unmounter**: add regression test for MeoNodeUnmounter to forward implicit props in MUI RadioGroup integration ([
282
- `2ecaabd`](https://github.com/l7aromeo/meonode-ui/commit/2ecaabd))
283
- - Added a test to ensure MeoNodeUnmounter correctly forwards props injected via React.cloneElement, addressing
284
- issues with libraries like MUI where RadioGroup injects 'checked' and 'onChange' into Radio components
285
- - This prevents swallowing of props and verifies proper behavior of controlled radio inputs
286
- - Also updated an existing cache size assertion to allow equality, reflecting improved mount tracking
287
- - **perf**: update react-createelement comparison tests with 5000 nested nodes and fix typings ([
288
- `b345ec0`](https://github.com/l7aromeo/meonode-ui/commit/b345ec0))
289
- - Changed rerender to use React.cloneElement<any> for proper typing
290
- - Updated NUM_NODES constant to 5000 for nested structure tests
291
- - Removed redundant comments about node count reduction to prevent stack overflow
292
-
293
- ### Chore
294
-
295
- - **deps**: upgrade devDependencies and update test scripts ([
296
- `2ea128e`](https://github.com/l7aromeo/meonode-ui/commit/2ea128e))
297
- - add new devDependencies: @emotion/is-prop-valid@1.4.0, @emotion/styled@11.14.1, @mui/material@7.3.5, and related
298
- packages
299
- - update yarn to version 4.11.0
300
- - update test scripts to increase max-old-space-size to 8192 and include react-createelement-comparison.test.ts in
301
- test and perf runs
302
- - update various package resolutions in yarn.lock to align with new versions and dependencies
303
- - **babel**: add "builtIns": false to minify plugin configuration ([
304
- `e16cdfb`](https://github.com/l7aromeo/meonode-ui/commit/e16cdfb))
305
- - **yarn**: update yarnPath to version 4.11.0 ([`ecb6c68`](https://github.com/l7aromeo/meonode-ui/commit/ecb6c68))
306
-
307
- ### Docs
308
-
309
- - **CONTRIBUTING**: improve formatting and readability of contribution guidelines ([
310
- `a7462ed`](https://github.com/l7aromeo/meonode-ui/commit/a7462ed))
311
-
312
- ## [0.4.10] - 2025-11-20
313
-
314
- ### Fix
315
-
316
- - **unmounter**: prevent redundant FinalizationRegistry callbacks ([
317
- `59f5adf`](https://github.com/l7aromeo/meonode-ui/commit/59f5adf2f553aa49a88d1b44366b004d829ca107))
318
- - Explicitly unregister node from cacheCleanupRegistry on unmount
319
- - Prevents double cleanup when node is both unmounted and GC'd
320
- - Improves cleanup efficiency and reduces unnecessary registry callbacks
321
-
322
- ### Perf
323
-
324
- - **util**: optimize prop processing and child handling ([
325
- `be26488`](https://github.com/l7aromeo/meonode-ui/commit/be26488e304629dd13851dfcaa7fedf43ad8b5c3))
326
- - Conditional sort: only sort keys if length > 1 (eliminates unnecessary sorts)
327
- - Replace for...in with Object.keys() iteration for better performance and safety
328
- - Add fast path for single child processing (non-array or 1-element array)
329
- - Avoid unnecessary array operations for common single-child case
330
- - Performance impact:
331
- - Reduced CPU overhead for small prop objects
332
- - Faster iteration with Object.keys() vs for...in
333
- - Eliminates array map() call for single child components
334
-
335
- - **core**: add exception safety and optimize render method ([
336
- `5aad000`](https://github.com/l7aromeo/meonode-ui/commit/5aad000335ff29f078a9d40192d5a70fe9b61d12))
337
- - Wrap render logic in try-finally to ensure renderContext is always released
338
- - Null out workStack slots before releasing to help GC
339
- - Pre-allocate finalChildren array to avoid resizing during iteration
340
- - Replace non-null assertion with explicit error handling for better debugging
341
- - Add object pooling for workStack and renderedElements (reduces GC pressure)
342
- - Pool capped at 50 contexts with 2048-item limit to prevent memory issues
343
- - Exception safety ensures cleanup even if rendering throws
344
-
345
- ### Test
346
-
347
- - **perf**: add React comparison tests with memory tracking ([
348
- `bc66d54`](https://github.com/l7aromeo/meonode-ui/commit/bc66d540c4ffa4ad083322dbdbc201f652ea5314))
349
- - Add comprehensive performance comparison between React.createElement and MeoNode
350
- - Test both flat (10k nodes) and nested (5k nodes) structures
351
- - Include memory usage measurements (initial + after 100 updates)
352
- - Reduce nested nodes from 10k to 5k to prevent stack overflow with StyledRenderer
353
- - Add table output with time and memory columns for clear comparison
354
- - Add GC availability warning for accurate measurements
355
- - Provides detailed performance and memory behavior insights during re-renders
356
- - Avoids stack overflow in deeply nested test scenarios
357
-
358
- - **performance**: enhance performance metrics report formatting and adjust thresholds ([
359
- `6f3abe4`](https://github.com/l7aromeo/meonode-ui/commit/6f3abe4442938aa6cd414341fdf2aba25a9ece58))
360
- - Improve table formatting for performance metrics
361
- - Adjust test thresholds based on optimization results
362
- - Enhanced reporting for better visibility into performance characteristics
363
-
364
- ## [0.4.9] - 2025-11-19
365
-
366
- ### Feat
367
-
368
- - **build**: add support for @tests alias and include tests folder in build and test configs ([
369
- `4dfd165`](https://github.com/l7aromeo/meonode-ui/commit/4dfd165fa52f93fe63ac7338344b91dfa5622c4b))
370
-
371
- ### Perf
372
-
373
- - **core**: optimize rendering, caching, and memory management ([
374
- `4f599be`](https://github.com/l7aromeo/meonode-ui/commit/4f599be44458fef208a30849545606b060c4ec6b))
375
- - Reworks the core rendering loop to use a more efficient, manually-managed work stack with exponential growth,
376
- reducing reallocations and improving performance for deep and wide node trees.
377
- - Optimizes stable key generation by removing expensive shallow equality checks in favor of strict reference
378
- equality, significantly speeding up prop processing for cached components.
379
- - Implements a high-performance MinHeap-based LRU cache eviction strategy for prop processing, replacing a slower
380
- sort-based method. This ensures that the most relevant props are kept in the cache with minimal overhead.
381
- - Introduces CSS object hashing to accelerate prop signature generation, avoiding costly serialization of large
382
- style objects.
383
- - Fixes several memory leaks by ensuring proper cleanup of node properties (lastSignature, lastPropsObj) and
384
- unregistering nodes from the cache cleanup registry upon eviction.
385
- - Decouples element cache deletion from mount tracking to prevent race conditions and ensure reliable cleanup during
386
- component unmounting.
387
-
388
- ### Refactor
389
-
390
- - **build**: rename constants directory from constants to constant and update imports accordingly ([
391
- `9531947`](https://github.com/l7aromeo/meonode-ui/commit/9531947af9b304c11c0865e8deafa1a633220753))
392
-
393
- ### Test
394
-
395
- - **perf**: overhaul performance test suite ([
396
- `e3bd6ac`](https://github.com/l7aromeo/meonode-ui/commit/e3bd6ac6ceca474f935da644ff0c23b2f1de7692))
397
- - Introduces a new, structured performance reporting system using cli-table3 for clear, grouped metrics.
398
- - Refactors the entire performance test suite into logical groups: Layout Rendering, Memory Management, and Prop
399
- Processing.
400
- - Adds comprehensive memory leak detection tests for heavy state changes and repeated mount/unmount cycles, using
401
- forced garbage collection for more accurate heap analysis.
402
- - Extracts the large, complex CSS object into a dedicated test constant for better separation of concerns.
403
- - Updates memoization tests to align with the new, weighted LRU cache eviction scoring.
404
-
405
- ### Chore
406
-
407
- - **deps**: update dependencies including typescript-eslint to 8.47.0 and add cli-table3 0.6.5 ([
408
- `6064555`](https://github.com/l7aromeo/meonode-ui/commit/6064555f0108ed47f9b31e98c4758f7449a67ff2))
409
-
410
- ## [0.4.8] - 2025-11-18
411
-
412
- ### Feat
413
-
414
- - **client**: add generic type parameter to render function for stronger type safety ([
415
- `90a770e`](https://github.com/l7aromeo/meonode-ui/commit/90a770e))
416
- - **core**: improve BaseNode rendering with iterative traversal and memory optimizations ([
417
- `1d5330a`](https://github.com/l7aromeo/meonode-ui/commit/1d5330a))
418
- - Introduce WorkItem interface to represent nodes in the iterative work stack during BaseNode rendering.
419
- - Replace recursive render traversal with an iterative depth-first approach using a preallocated workStack array for
420
- better performance and reduced call stack usage.
421
- - Implement dynamic resizing of workStack array to handle arbitrary tree sizes efficiently.
422
- - Update BaseNode’s internal caching fields (`lastPropsRef` and `lastSignature`) to be public and consistently used
423
- for stable key generation.
424
- - Modify MeoNodeUnmounter component to accept BaseNode instance and clear its `lastPropsRef` and `lastSignature` on
425
- unmount to prevent memory leaks.
426
- - Refine type annotations across node utilities and factory functions for stronger type safety (
427
- `Record<string, unknown>` instead of `any`).
428
- - Optimize critical prop extraction logic by replacing Set and startsWith checks with faster inline charCode
429
- comparisons.
430
- - Clean up and clarify utility methods related to prop signature creation, shallow equality, and portal management.
431
- - Improve node.util.ts by adjusting caching strategies, prop categorization, and React element handling for better
432
- robustness and maintainability.
433
-
434
- ### Fixes
435
-
436
- - **navigation-cache-manager**: add proper typing and global window declaration for cleanup flag ([
437
- `6180d40`](https://github.com/l7aromeo/meonode-ui/commit/6180d40))
438
-
439
- ### Refactor
440
-
441
- - improve typings and type safety in theme util and styled renderer ([
442
- `dbe1f33`](https://github.com/l7aromeo/meonode-ui/commit/dbe1f33))
443
- - Added explicit TypeScript types (e.g., CssProp, Record<string, unknown>) for variables and function signatures in
444
- `styled-renderer.client.ts` and `theme.util.ts`.
445
- - Updated cache maps to use more precise generic types for better type inference and safety.
446
- - Enhanced `resolveObjWithTheme` and related theme resolution logic with stronger typing and nullish coalescing.
447
- - Improved error handling for invalid theme path values.
448
- - Applied copy-on-write pattern with properly typed arrays and objects during theme resolution.
449
- - Strengthened type guards, e.g., `isPlainObject` type predicate.
450
- - Minor fixes to variable declarations with explicit types for clarity and consistency.
451
-
452
- ### Chore
453
-
454
- - **babel**: update preset-env targets and expand plugin exclusions ([
455
- `f38cd24`](https://github.com/l7aromeo/meonode-ui/commit/f38cd24))
456
- - Set preset-env targets to support ES modules
457
- - Enable bugfixes option
458
- - Add multiple plugins to exclude list for better optimization
459
- - Clean up formatting of root, alias, extensions, and exclude fields
460
-
461
- ### Test
462
-
463
- - **performance**: add comprehensive performance tests and metrics reporting ([
464
- `c3d7a81`](https://github.com/l7aromeo/meonode-ui/commit/c3d7a81))
465
- - Add detailed performance tests measuring render times for realistic layouts, 10,000 flat nodes, and 10,000 deeply
466
- nested nodes.
467
- - Introduce a heavy state changes test to detect memory leaks and ensure responsiveness under frequent updates.
468
- - Collect and log performance metrics including median render times and memory usage for analysis.
469
- - Add tests for stableKey generation performance with identical, shallowly equal, unique, large, and complex CSS
470
- props.
471
- - Enhance test suite with CSS styling for better visualization and interaction during tests.
472
- - Improve cleanup and reporting to avoid resource leaks and provide clearer performance insights.
473
-
474
- ## [0.4.7] - 2025-11-17
475
-
476
- ### Fixes
477
-
478
- - **core/cache:** optimize navigation cache debounce timing and enhance stableKey handling ([
479
- `fff6f207`](https://github.com/l7aromeo/meonode-ui/commit/fff6f2070a06cc5ad461a2f992b111fb957fae6f))
480
- - Adjust navigation cleanup debounce duration dynamically based on cache size for better performance.
481
- - Change stableKey and _lastSignature to be optional to better represent their possible undefined state.
482
- - Refactor _getStableKey to return undefined on server instead of empty string.
483
- - Optimize critical props extraction by introducing NodeUtil.extractCriticalProps helper.
484
- - Improve client-side caching logic to avoid lookups when stableKey is absent.
485
- - Remove unused imports and redundant code in node.util.ts; improve shallowEqual implementation.
486
- - Update createPropSignature to return undefined on server and use getElementTypeName directly.
487
- - Add detailed comments and refine hashString combining FNV-1a and djb2 hashes for robustness.
488
-
489
- ## [0.4.6] - 2025-11-17
490
-
491
- ### Fixes
492
-
493
- - **core/cache:** enhance memoization & caching system to prevent memory leaks and ensure safe lifecycle management ([
494
- `253d7d00`](https://github.com/l7aromeo/meonode-ui/commit/253d7d006121dc588a51580d5120c7123a5f8777))
495
- This introduces a robust, three-layered cleanup strategy to ensure cache integrity:
496
- 1. An immediate, lifecycle-driven cleanup via the new `MeoNodeUnmounter` component.
497
- 2. A debounced, event-driven cleanup for SPA navigations via `NavigationCacheManagerUtil`.
498
- 3. A final, GC-driven safety net using the `FinalizationRegistry` API.
499
-
500
- ### Refactor
501
-
502
- - **core:** migrate core logic from `src/helper/` to a new `src/util/` directory for better separation of concerns.
503
- - **core:** extract internal utility functions from `core.node.ts` into `node.util.ts`.
504
- - **core:** make internal caches on `BaseNode` public to support the new externalized management architecture.
505
-
506
- ### Chore
507
-
508
- - **tooling:** enable TypeScript's `strict: true` mode and update codebase to be fully compliant.
509
- - **tooling:** add CommonJS (`require`) exports to `package.json` for improved module compatibility.
510
- - **tooling:** add `NODE_OPTIONS='--expose-gc'` to the test script to allow for explicit garbage collection during
511
- tests.
512
- - **tests:** refine test suite by standardizing `afterEach` hooks and updating memoization tests to directly validate
513
- internal caching.
514
-
515
- ## [0.4.5] - 2025-11-15
516
-
517
- ### Feat
518
-
519
- - **cache**: implement robust cache management and theme caching ([
520
- `9ed749f6`](https://github.com/l7aromeo/meonode-ui/commit/9ed749f6d877fdc8b6a736788add13225b07dd63))
521
- Refactor NavigationCacheManager for robustness, add memory monitoring and auto-cleanup.
522
- Implement LRU eviction for ThemeResolverCache and integrate with BaseNode cache clearing.
523
-
524
- ### Refactor
525
-
526
- - **test**: split node.test.ts into smaller, more focused test files ([
527
- `930f998e`](https://github.com/l7aromeo/meonode-ui/commit/930f998e5f91faef3ff42fcafc6b02fc23f422ff))
528
- This commit refactors the test suite by splitting the monolithic `node.test.ts`
529
- file into several smaller, more focused test files, each covering a specific
530
- aspect of the BaseNode functionality.
531
-
532
- Specifically, `memoization.test.ts` was created to house tests related to
533
- dependency tracking and memoization in real-world scenarios. During this
534
- refactoring, a `console.error` related to duplicate keys in a memoization
535
- test was identified and suppressed to prevent noisy test output while
536
- preserving the test's original intent of verifying cache collision prevention.
537
-
538
- ### Fix
539
-
540
- - **core**: pass disableEmotion flag to _renderProcessedNode for improved processing ([
541
- `b68e3d4`](https://github.com/l7aromeo/meonode-ui/commit/b68e3d49a732ee590805a0298f733b800a9b172d))
542
-
543
- ### Chore
544
-
545
- - **test**: adjust performance test cleanup by removing cache clearing from afterEach ([
546
- `f72cea5e`](https://github.com/l7aromeo/meonode-ui/commit/f72cea5ef983fdaba012a7d446b58c7da06f5e1a))
547
-
548
- ## [0.4.4] - 2025-11-15
549
-
550
- ### Perf
551
-
552
- - **core**: implement intelligent caching and memory management ([
553
- `0e5671b`](https://github.com/l7aromeo/meonode-ui/commit/0e5671b36189c964d66676ef633f3ccdbd9004e2))
554
- Introduces a sophisticated caching and memory management system to prevent memory leaks and improve performance in
555
- Single Page Applications (SPAs).
556
-
557
- This new system intelligently tracks mounted components and automatically cleans up caches of unmounted components
558
- during navigation events.
559
-
560
- Key features and improvements include:
561
-
562
- - **Navigation-aware Cache Eviction:** A new `NavigationCacheManager` listens for browser navigation events (
563
- popstate, pushState, etc.) and triggers a safe cleanup of the element cache. This prevents the cache from growing
564
- indefinitely with stale entries from previous pages.
565
-
566
- - **Mount Tracking:** A `MountTracker` class now keeps a record of all mounted `BaseNode` instances. This allows the
567
- cache eviction logic to accurately determine which components are safe to remove from the cache.
568
-
569
- - **Advanced Eviction Policies:** The `SafeCacheManager` implements several eviction policies, including evicting
570
- unmounted components, old unmounted components, and an emergency eviction policy for high memory pressure
571
- scenarios.
572
-
573
- - **Memory-Safe Portal System:** The portal implementation has been refactored to use a `WeakMap`. This ensures that
574
- portal-related DOM elements and React roots are automatically garbage collected when the corresponding `BaseNode`
575
- instance is no longer in use, preventing a common source of memory leaks.
576
-
577
- - **Improved Cache Entry Metadata:** The element cache entries now store additional metadata, such as creation
578
- timestamp, access count, and a `WeakRef` to the node instance, enabling more intelligent eviction decisions.
579
-
580
- - **Enhanced Stability:** Component identifiers for caching are now generated using a `WeakMap`, providing more
581
- stable and reliable keys than relying on component names, which can be affected by minification.
582
-
583
- - **Comprehensive Test Coverage:** Added a suite of new integration tests to validate the caching and memory
584
- management system. These tests cover key scenarios including cache collision, rapid navigation, React 18 Strict
585
- Mode compatibility, large prop object fingerprinting, and LRU eviction logic.
586
-
587
- ### Fix
588
-
589
- - **core**: simplify property assignment in common helper ([
590
- `312af57`](https://github.com/l7aromeo/meonode-ui/commit/312af574712202a25bdd62fab94441a937f159f2))
591
-
592
- ### Refactor
593
-
594
- - **core**: add ElementCacheEntry interface for memoization and update css prop type ([
595
- `6a8381c`](https://github.com/l7aromeo/meonode-ui/commit/6a8381c4c85cb22df4ba398637401d420461e413))
596
-
597
- ## [0.4.3] - 2025-11-14
598
-
599
- ### Docs
600
-
601
- - **core**: add detailed comments to rendering methods ([
602
- `731c83e`](https://github.com/l7aromeo/meonode-ui/commit/731c83e))
603
-
604
- ### Fix
605
-
606
- - **core**: adjust isStyledComponent logic to improve style handling ([
607
- `ff7a59e`](https://github.com/l7aromeo/meonode-ui/commit/ff7a59e))
608
-
609
- ### Refactor
610
-
611
- - **core**: simplify _processProps by removing style prop handling ([
612
- `b3570b4`](https://github.com/l7aromeo/meonode-ui/commit/b3570b4))
613
-
614
- ## [0.4.2] - 2025-11-14
615
-
616
- ### Fix
617
-
618
- - **core**: remove deps property from props since it should not be passed to element attribute ([
619
- `6b01cbe`](https://github.com/l7aromeo/meonode-ui/commit/6b01cbe))
620
-
621
- ## [0.4.1] - 2025-11-14
622
-
623
- ### Test
624
-
625
- - **node**: enhance dependency and memoization tests with real-world scenarios ([
626
- `d7452fa`](https://github.com/l7aromeo/meonode-ui/commit/d7452fae9b3ef22a82dc83210851849d82de479f))
627
-
628
- ### Fix
629
-
630
- - **core**: enhance error handling and improve style property detection ([
631
- `ca79c27`](https://github.com/l7aromeo/meonode-ui/commit/ca79c277cdfea5b62b54779ec2492518681639d1))
632
-
633
- ### Chore
634
-
635
- - **deps**: update dependencies in package.json for improved stability and performance ([
636
- `eba2108`](https://github.com/l7aromeo/meonode-ui/commit/eba21080c953b1c6b6c1bbb6a401257845116f09))
637
-
638
- ### Perf
639
-
640
- - **core**: Optimize prop processing and caching with new signature generation ([
641
- `8cf0319`](https://github.com/l7aromeo/meonode-ui/commit/8cf0319fd99c3c8496b6e63207cb378b6c521ae2))
642
-
643
- ### Refactor
644
-
645
- - **types**: move node.type.ts to types directory and update imports ([
646
- `ccf769a`](https://github.com/l7aromeo/meonode-ui/commit/ccf769a2670e4546bfa776034a4fa8925ca2d27d))
647
-
648
- ## [0.4.0] - 2025-11-13
649
-
650
- ### Feature
651
-
652
- - **core**: Implemented an advanced memoization and caching system to optimize rendering performance. This includes:
653
- - **Dependency-Based Memoization**: Nodes can now be created with a dependency array, similar to React's `useMemo`,
654
- to prevent unnecessary re-renders of the node and its entire subtree if dependencies have not changed. ([
655
- `3b0a110`](https://github.com/l7aromeo/meonode-ui/commit/3b0a110eb3db25862476d020182be9f0dba663e4))
656
- - **Enhanced Prop Caching**: The prop signature generation is now more robust, and the cache uses an advanced LRU
657
- eviction strategy to remain efficient. ([
658
- `3b0a110`](https://github.com/l7aromeo/meonode-ui/commit/3b0a110eb3db25862476d020182be9f0dba663e4))
659
- - **API Updates**: The `Node`, `createNode`, `createChildrenFirstNode`, and `Component` HOCs have been updated to
660
- accept an optional `deps` array to enable memoization. ([
661
- `3b0a110`](https://github.com/l7aromeo/meonode-ui/commit/3b0a110eb3db25862476d020182be9f0dba663e4))
662
-
663
- ### Test
664
-
665
- - **core**: Added a comprehensive suite of tests for the new memoization and caching system, covering dependency-based
666
- memoization, reactive and non-reactive children, complex state updates, and memoization of Higher-Order Components (
667
- HOCs). ([`6bcd1b1`](https://github.com/l7aromeo/meonode-ui/commit/6bcd1b1bc6b2450c3d4296cb4af326f61cfee401))
668
-
669
- ## [0.3.18] - 2025-11-12
670
-
671
- ### Fixed
672
-
673
- - **core**: refine prop caching to handle dynamic props correctly ([
674
- `4c0641e`](https://github.com/l7aromeo/meonode-ui/commit/4c0641e892f934551f100629cac72fc3f4649ab0))
675
-
676
- ## [0.3.17] - 2025-11-12
677
-
678
- ### Perf
679
-
680
- - **core**: implement iterative renderer and prop caching ([
681
- `8a3a264`](https://github.com/l7aromeo/meonode-ui/commit/8a3a264be68bd041b6340636f5f7ee2b0caa63ff))
682
- - **helper**: refactor theme resolution logic for improved performance and cache correctness ([
683
- `9614cb8`](https://github.com/l7aromeo/meonode-ui/commit/9614cb8d2aeae0d9bd2f9cf3edd51c022cd93273))
684
-
685
- ### Chore
686
-
687
- - fix typo in JSDoc comment for useTheme hook ([
688
- `de0ddd9`](https://github.com/l7aromeo/meonode-ui/commit/de0ddd9a6308f4a76b6ad843a6139d42bd3fcf53))
689
- - add deprecation notice to usePortal hook for future removal ([
690
- `f8a2923`](https://github.com/l7aromeo/meonode-ui/commit/f8a29230cad3962addb8cf28ed3538e6de236181))
691
- - update PortalProps type definition to provide a default type parameter ([
692
- `de73ba5`](https://github.com/l7aromeo/meonode-ui/commit/de73ba5b9d9dd51637b24b0309d681309d9338ae))
693
- - update isNodeInstance type guard to use BaseNode instead of NodeInstance ([
694
- `2c69d05`](https://github.com/l7aromeo/meonode-ui/commit/2c69d05b3d1593a976e439ca7404696b781e5012))
695
- - rename jest.config.mjs to jest.config.ts and update configuration for TypeScript support ([
696
- `a3213eb`](https://github.com/l7aromeo/meonode-ui/commit/a3213eb5b91a55364cb4f5362005bc2a46934de5))
697
- - **scripts**: increase stack size for jest test and fix build commands ([
698
- `e046cdf`](https://github.com/l7aromeo/meonode-ui/commit/e046cdf397e2cf418e09e149a9e0cf1e48f3d926))
699
- - update tsconfig.json to exclude dist and node_modules directories ([
700
- `eeb9577`](https://github.com/l7aromeo/meonode-ui/commit/eeb957722ab7a26cbe59047c068f9955b082502e))
701
- - update tsconfig.json with enhanced compiler options and path mappings for better development experience ([
702
- `89bc1a4`](https://github.com/l7aromeo/meonode-ui/commit/89bc1a42c23f015acfed1bcb860ebb6a4c684fc1))
703
-
704
- ## [0.3.16] - 2025-11-05
705
-
706
- ### Added
707
-
708
- - **tests**: add tests for Fragment, Suspense, and Activity components to verify styling prop handling ([
709
- `2af386f`](https://github.com/l7aromeo/meonode-ui/commit/2af386f))
710
- - **core**: enhance NodeProps type to conditionally include built-in React components ([
711
- `3b8a4cb`](https://github.com/l7aromeo/meonode-ui/commit/3b8a4cb))
712
- - **react**: add REACT_ACTIVITY_TYPE to react-is helper ([
713
- `e91e48f`](https://github.com/l7aromeo/meonode-ui/commit/e91e48f))
714
- - **core**: export NO_STYLE_TAGS type for better type inference ([
715
- `a6db6e8`](https://github.com/l7aromeo/meonode-ui/commit/a6db6e8))
716
- - **react**: add Fragment component to create a container without extra DOM elements ([
717
- `d5e376a`](https://github.com/l7aromeo/meonode-ui/commit/d5e376a))
718
-
719
- ## [0.3.15] - 2025-11-04
720
-
721
- ### Added
722
-
723
- - **core**: add disableEmotion prop to disable emotion styling and propagate to children ([
724
- `377a9e9`](https://github.com/l7aromeo/meonode-ui/commit/377a9e9d4844ba7869155e686c9b31f0f9ce2329))
725
- - **react**: enhance isContextProvider and isReactClassComponent checks ([
726
- `e8839e4`](https://github.com/l7aromeo/meonode-ui/commit/e8839e4c231bdd66686f7b43d9889a18cd9fc791))
727
-
728
- ## [0.3.14] - 2025-10-30
729
-
730
- ### Added
731
-
732
- - **core**: Add handling for Suspense and Activity components ([
733
- `0f9fcb1`](https://github.com/l7aromeo/meonode-ui/commit/0f9fcb171fdce28b5a880e69e2d591543e3af817))
734
-
735
- ## [0.3.13] - 2025-10-30
736
-
737
- ### Fixed
738
-
739
- - **theme.helper**: process theme strings returned from functions ([
740
- `286fd89`](https://github.com/l7aromeo/meonode-ui/commit/286fd89e28cc10b467a208be4cdf1b7508d0be8c))
741
-
742
- ## [0.3.12] - 2025-10-23
743
-
744
- ### Added
745
-
746
- - **react**: add Suspense component and JSDoc for Activity and Suspense ([
747
- `c1760fd`](https://github.com/l7aromeo/meonode-ui/commit/c1760fd))
748
-
749
- ## [0.3.11] - 2025-10-19
750
-
751
- ### Added
752
-
753
- - **components**: add react activity node and export it in main ([
754
- `aadbc2d`](https://github.com/l7aromeo/meonode-ui/commit/aadbc2d08a928f1ba88bd4572b45eed8cb100a87))
755
- - **theme.helper**: update resolveObjWithTheme to improve object type checking ([
756
- `da1ce4c`](https://github.com/l7aromeo/meonode-ui/commit/da1ce4cd53ccbe2d2a562a49730151434177dc59))
757
-
758
- ### Changed
759
-
760
- - **chore**: update dependencies in package.json and yarn.lock ([
761
- `0c0ced6`](https://github.com/l7aromeo/meonode-ui/commit/0c0ced68662bb701634d49dc79da86e4ddce5392))
762
- - **chore**: remove \'use strict\' directive from multiple files ([
763
- `17d79dc`](https://github.com/l7aromeo/meonode-ui/commit/17d79dcb105a8c2062695071c3f587f6db9a5711))
764
-
765
- ### Docs
766
-
767
- - **docs**: update Node.js version requirement in CONTRIBUTING.md ([
768
- `4c577c3`](https://github.com/l7aromeo/meonode-ui/commit/4c577c3e23294bdc188cda5b14375af1cb967888))
769
-
770
- ### Test
771
-
772
- - **node**: add test case for preserving Node instances passed through props and theme resolution ([
773
- `f4d1344`](https://github.com/l7aromeo/meonode-ui/commit/f4d1344355f2a4631ccdf04998bcf618d4ce1dc6))
774
-
775
- ## [0.3.10] - 2025-10-09
776
-
777
- ### Fixed
778
-
779
- - **core**: Re-hydrate BaseNode instances that lose class identity during React lifecycle.
780
-
781
- ### Changed
782
-
783
- - **deps**: update dependencies to latest versions in package.json
784
-
785
- ## [0.3.9] - 2025-09-30
786
-
787
- ### Fixed
788
-
789
- - **html.node**: update `Root` node default minHeight and minWidth to use dynamic viewport units
790
-
791
- ## [0.3.8] - 2025-09-29
792
-
793
- ### Added
794
-
795
- - **styling**: Enabled theme-aware functions for css props, allowing for more dynamic styling (e.g.,
796
- `color: theme => theme.system.colors.primary`).
797
-
798
- ### Refactor
799
-
800
- - **core**: Refactored the style resolution logic (`resolveObjWithTheme` and `StyledRenderer`) to selectively process
801
- the `css` prop. This enables the new theme-function feature while ensuring that other props (like `children`) are not
802
- processed, maintaining compatibility with Next.js Server Components.
803
-
804
- ## [0.3.7] - 2025-09-27
805
-
806
- ### Added
807
-
808
- - **rsc:** make client components RSC compatible
809
-
810
- ### Refactor
811
-
812
- - **node:** isolate css prop for StyledRenderer
813
-
814
- ## [0.3.6] - 2025-09-27
815
-
816
- ### Changed
817
-
818
- - **changelog:** update missing changelog entries
819
-
820
- ## [0.3.5] - 2025-09-27
821
-
822
- ### Refactor
823
-
824
- - **refactor:** remove automatic key generation and use spread children in createElement
825
- - Remove _generateKey method and all automatic key generation logic
826
- - Simplify _processRawNode by removing nodeIndex parameter and complex case handling
827
- - Update render() to spread array children as individual arguments to createElement
828
- - Only preserve explicit non-null keys from original React elements
829
- - Fix component remounting issues when children content changes (e.g., during typing)
830
-
831
- ## [0.3.4] - 2025-09-26
832
-
833
- ### Fixed
834
-
835
- - **fix:** add cookie path to prevent duplicate theme cookie
836
-
837
- ## [0.3.3] - 2025-09-26
838
-
839
- ### Fixed
840
-
841
- - **fix:** enhance element type validation to allow `createPortal` to be a children
842
-
843
- ## [0.3.2] - 2025-09-26
844
-
845
- ### Fixed
846
-
847
- - **fix**: update import paths for Node component to improve module structure
848
- - **fix(theme-provider):** update type imports and enhance function return type for better clarity
849
-
850
- ## [0.3.1] - 2025-09-26
851
-
852
- ### Docs
853
-
854
- - **docs(readme):** update readme with new theme system
855
-
856
- ## [0.3.0] - 2025-09-26
857
-
858
- ### Added
859
-
860
- - **feat(theme):** use React Context for theme propagation
861
-
862
- ### Refactor
863
-
864
- - **refactor(core):** remove unused _childrenHash property from Node class
865
-
866
- ### Example
867
-
868
- - **feat(theme):** use React Context for theme propagation
869
-
870
- **Before**:
871
- ```typescript
872
- import { Div } from '@meonode/ui';
873
-
874
- const App = () => {
875
- return Div({
876
- theme: {
877
- // theme object
878
- },
879
- children: 'Hello world!',
880
- });
881
- };
882
- ```
883
-
884
- **After**:
885
- ```typescript
886
- import { Div, ThemeProvider } from '@meonode/ui';
887
-
888
- const App = () => {
889
- return ThemeProvider({
890
- theme: {
891
- mode: 'light', // or 'dark' or any custom mode
892
- system: {
893
- base: {
894
- default: '#ffffff',
895
- content: '#000000',
896
- }
897
- }
898
- },
899
- children: [
900
- Div({
901
- backgroundColor: 'theme.base',
902
- color: 'theme.content',
903
- children: 'Hello world!',
904
- }),
905
- ],
906
- });
907
- };
908
- ```
909
-
910
- ## [0.2.21] - 2025-09-23
911
-
912
- ### Refactor
913
-
914
- - **refactor(core):** make node processing logic static and robust
915
-
916
- ### Added
917
-
918
- - **feat:** update NodeFunction type to improve dynamic node content generation and update FunctionRendererProps
919
- interface to use NodeFunction
920
-
921
- ### Fixed
922
-
923
- - **fix(component.hoc.ts):** enhance node instance check in Renderer for improved stability
924
- - **fix(node.type.ts):** remove unused processRawNode property from Node type
925
-
926
- ### Changed
927
-
928
- - **package:** update dependencies to latest versions
929
-
930
- ## [0.2.20] - 2025-09-22
931
-
932
- ### Refactor
933
-
934
- - **refactor(obj.helper)**: streamline serialization logic and improve performance
935
-
936
- ### Fixed
937
-
938
- - **fix(eslint)**: enforce no-unsafe-function-type rule for better type safety
939
- - **fix(node.helper.ts)**: update nodeSignature function to accept Children type and improve circular reference handling
940
-
941
- ## [0.2.19] - 2025-09-21
942
-
943
- ### Refactor
944
-
945
- - **refactor(core)**: simplify PortalLauncher type definition for improved readability
946
- - **refactor(core)**: enhance usePortal by improving component creation and cleanup logic
947
- - **refactor(core)**: remove redundant re-render logic in portal rendering
948
-
949
- ### Test
950
-
951
- - **test**: add unit tests for dynamic portal creation and management
952
- - **test**: remove dynamic portal test case on node.test.ts
953
-
954
- ### Changed
955
-
956
- - **chore**: update Yarn version to 4.10.2 and configure yarnPath in .yarnrc.yml
957
-
958
- ## [0.2.18] - 2025-09-19
959
-
960
- ### Added
961
-
962
- - **feat(core)**: support function children and enhance rendering logic
963
- - **feat(core)**: enhance portal with update method and NodePortal type
964
- - **feat(hook)**: introduce usePortal hook for reactive portals
965
-
966
- ### Example
967
-
968
- - **feat(portal)**: use `usePortal` hook to make the portal reactive to state changes
969
-
970
- ```typescript
971
- import { Button, Div, Node, Portal, type PortalProps } from '@meonode/ui';
972
- import { usePortal } from '@meonode/ui';
973
- import { useState } from 'react';
974
-
975
- const MyPortal = () => {
976
- const [state, setState] = useState<number>(0);
977
- const { setPortal, createComponent } = usePortal([state]);
978
-
979
- const PortalContent = createComponent(({ portal, text }: { text: string } & PortalProps<any>) => {
980
- return Div({
981
- children: [
982
- 'This is portal content!',
983
- state === 1 ? text : 'Initial text value',
984
- Button(`Update Portal (${state + 1})`, {
985
- onClick: () => {
986
- setState((s: number) => s + 1);
987
- },
988
- }),
989
- Button('Close Portal', {
990
- onClick: () => {
991
- portal?.unmount();
992
- },
993
- }),
994
- ],
995
- }).render();
996
- });
997
-
998
- return Div({
999
- children: [
1000
- Button('Open Portal', {
1001
- onClick: () => {
1002
- const portal = Portal<{ text: string }>(PortalContent)({ text: `Text prop still passed after update` });
1003
- setPortal(portal);
1004
- },
1005
- }),
1006
- ],
1007
- }).render();
1008
- };
1009
- ```
1010
-
1011
- ## [0.2.17] - 2025-09-14
1012
-
1013
- ### Added
1014
-
1015
- - **feat(common.helper)**: add omit and omitUndefined utility functions to create object copies without specified keys
1016
- or undefined values
1017
- - **feat**: integrate omit and omitUndefined functions to manage finalProps for standard HTML tags and custom components
1018
-
1019
- ### Refactor
1020
-
1021
- - **refactor**: remove unnecessary type assertions for children in core.node.ts
1022
- - **refactor(core.node.ts)**: streamline element creation logic
1023
-
1024
- ### Test
1025
-
1026
- - **test**: add test case for rendering Div node using Component HOC
1027
- - **feat(test)**: replace Div components with Container for consistency in performance tests
1028
- - **test(node.test.ts)**: add test for rendering an empty prop Div node
1029
-
1030
- ### Removed
1031
-
1032
- - **types**: removed redundant `key` prop from `FinalNodeProps` and default `key` from `NodeProps` types for cleaner
1033
- type definitions
1034
-
1035
- ## [0.2.16] - 2025-09-13
1036
-
1037
- ### Added
1038
-
1039
- - **feat(core)**: introduce static _isServer property to optimize server-side checks in caching methods
1040
- - **feat(core)**: remove passedKey from _functionRenderer and simplify function-as-child wrapper; augment toPortal
1041
- unmount to clean portal container
1042
-
1043
- ### Refactor
1044
-
1045
- - **feat**: refactor children prop type to use `Children` type for better clarity and consistency across the codebase
1046
-
1047
- ## [0.2.15] - 2025-09-12
1048
-
1049
- ### Added
1050
-
1051
- - **feat(cache)**: implement hybrid caching strategy for processed children using WeakMap and Map to improve performance
1052
- and memory management
1053
- - **feat(helper)**: implement nodeSignature for stable signatures and improve createStableHash with bounded traversal
1054
- - **feat(helper)**: enhance ObjHelper.stringify method for deterministic serialization with sorted keys and special type
1055
- handling
1056
-
1057
- ### Refactor
1058
-
1059
- - **refactor**: improve type definitions and error handling in rendering methods
1060
-
1061
- ### Test
1062
-
1063
- - **test(tests)**: add performance tests for rendering a single-page layout in React
1064
- - **test**: add cleanup after each test and verify component display names for debugging
1065
-
1066
- ## [0.2.14] - 2025-09-12
1067
-
1068
- ### Added
1069
-
1070
- - **feat**: Add `Container` alias for `Div` to simplify general-purpose container usage.
1071
- - **feat**: Add caching for processed children to optimize performance in `BaseNode` class.
1072
-
1073
- ### Removed
1074
-
1075
- - **feat**: Remove `shallowEqual` utility function from `common.helper.ts`.
1076
-
1077
- ### Fixed
1078
-
1079
- - **feat**: Improve performance by optimizing existing key checks and handling null values in rendering functions.
1080
-
1081
- ## [0.2.13] - 2025-09-11
1082
-
1083
- ### Added
1084
-
1085
- - **feat**: Add pre-commit hook for linting and testing, update package.json scripts.
1086
- - **feat**: Add Jest configuration and setup for testing with TypeScript.
1087
- - **test**: Add comprehensive tests for BaseNode core functionality.
1088
-
1089
- ### Fixed
1090
-
1091
- - **core**: Remove stylable elements from NO_STYLE_TAGS to ensure only non-visual/metadata tags are excluded from CSS
1092
- styling.
1093
-
1094
- ## [0.2.12] - 2025-09-11
1095
-
1096
- ### Fixed
1097
-
1098
- - **core.node**: Removed the child processing cache to fix a critical bug that caused infinite page loads in server-side
1099
- rendering environments.
1100
- - **helper**: Corrected the element type retrieval logic within the hashing function used for child node processing.
1101
-
1102
- ## [0.2.11] - 2025-09-11
1103
-
1104
- ### Enhanced
1105
-
1106
- - **core.node**: Significantly improved JSDoc documentation for the `BaseNode` class, providing better clarity on prop
1107
- processing, child handling, and rendering logic.
1108
- - **core.node**: Overhauled the child processing and caching mechanism to improve server-side performance and resolve a
1109
- memory leak. This includes a move from object stringification to a more performant hashing strategy for cache keys and
1110
- the introduction of a cache management policy.
1111
-
1112
- ### Fixed
1113
-
1114
- - **helper**: Corrected an issue in flexbox style processing where an unnecessary string check was performed.
1115
- - **core.node**: Updated a function placeholder to adhere to the unused parameter naming convention.
1116
-
1117
- ## [0.2.10] - 2025-09-10
1118
-
1119
- ### Added
1120
-
1121
- - **core**: add top-level `render` function for a cleaner and simpler API when mounting a Meonode instance to the DOM.
1122
- This abstracts away the need to manually use `react-dom/client`.
1123
- - **Before**:
1124
- ```typescript
1125
- import { createRoot } from 'react-dom/client';
1126
- import { Div } from '@meonode/ui';
1127
-
1128
- const container = document.getElementById('root');
1129
- const root = createRoot(container);
1130
- root.render(Div({ children: 'Hello' }).render());
1131
- ```
1132
- - **After**:
1133
- ```typescript
1134
- import { Div } from '@meonode/ui';
1135
- import { render } from '@meonode/ui/client';
1136
-
1137
- const container = document.getElementById('root');
1138
- render(Div({ children: 'Hello' }), container);
1139
- ```
1140
- - **constants**: add `NO_STYLE_TAGS` array and `noStyleTagsSet` for quick lookup of tags that should not receive styles
1141
-
1142
- ### Enhanced
1143
-
1144
- - **core**: enhance `StyledRenderer` integration to check for no-style tags
1145
-
1146
- ### Changed
1147
-
1148
- - **helper**: update CSS property set to use constants and add no-style tag check
1149
- - **package**: update dependencies to latest versions
1150
- - **directory**: rename `data` directory to `constants` for clarity
1151
- - **file**: rename `cssProperties.ts` to `cssProperties.const.ts` to reflect its purpose
1152
-
1153
- ## [0.2.9] - 2025-09-05
1154
-
1155
- ### Fixed
1156
-
1157
- - **core.types**: corrected `MergedProps` definition to restore proper TypeScript inference and props autocomplete
1158
- - Fixes regression from v0.2.8 where `createNode` and `createChildrenFirstNode` lost autocomplete for props due to
1159
- incorrect `MergedProps` typing
1160
-
1161
- ## [0.2.8] - 2025-09-05
1162
-
1163
- ### Changed
1164
-
1165
- - **core.node**: refactor props handling to use a single utility type:
1166
- - `MergedProps<E, AdditionalProps>` — merges `NodeProps<E>` with custom props, giving precedence to overlapping keys
1167
- from `AdditionalProps`.
1168
- - Simplifies and unifies the typing system for node factories (`createNode`, `createChildrenFirstNode`).
1169
- - Improves developer experience when working with prebuilt components:
1170
- - Example:
1171
- ```typescript
1172
- import { Div, Input } from '@meonode/ui'
1173
-
1174
- // Add new props
1175
- Div<{ field: string }>({ field: 'Hello' })
1176
-
1177
- // Override existing React props
1178
- Input<{ onChange: (e: { target: { value: string } }) => void }>({
1179
- onChange: ({ target }) => console.log(target.value),
1180
- })
1181
- ```
1182
- Extending prebuilt components is now safer and more predictable, with generic props always taking precedence when keys
1183
- overlap.
1184
-
1185
- - **helpers**: reorganize helper files and update import paths
1186
-
1187
- ### Fixed
1188
-
1189
- - **styled-renderer**: make `children` prop optional in `StyledRendererProps`
1190
-
1191
- ## [0.2.7] - 2025-09-04
1192
-
1193
- ### Changed
1194
-
1195
- - **core.node**: rename `childIndex` to `nodeIndex` and update key generation logic
1196
-
1197
- ## [0.2.6] - 2025-09-04
1198
-
1199
- - **deps**: update TypeScript ESLint, native-preview, and jsdoc to latest versions
1200
- - **core.node**: improve generateIndexedKeyIfNeeded to accept object parameters and enhance key uniqueness with children
1201
- count
1202
- - **imports**: update import paths to include file extensions for compatibility
1203
-
1204
- ## [0.2.5] - 2025-09-03
1205
-
1206
- - **imports**: Update import paths to include file extensions for compatibility.
1207
-
1208
- ## [0.2.4] - 2025-09-02
1209
-
1210
- ### Added
1211
-
1212
- - **core**: Exposed the original element via the created Node for easier access and debugging.
1213
- ```typescript
1214
- import { createNode } from "@meonode/ui";
1215
-
1216
- // Create a Node wrapping a 'div' element
1217
- const MyComp = createNode('div');
1218
-
1219
- // Access the underlying element type
1220
- console.log(MyComp.element); // 'div'
1221
- ```
1222
-
1223
- ## [0.2.3] - 2025-09-01
1224
-
1225
- ### Fixed
1226
-
1227
- - **types**: Remove forbidden css import to resolve RSC error
1228
-
1229
- ### Changed
1230
-
1231
- - **package**: Bump version to 0.2.3
1232
-
1233
- ## [0.2.2] - 2025-09-01
1234
-
1235
- ### Added
1236
-
1237
- - **core**: Include nativeProps in props extraction for improved component flexibility
1238
-
1239
- ### Enhanced
1240
-
1241
- - **types**: Enhance StyledRendererProps and FinalNodeProps for improved type safety
1242
-
1243
- ### Changed
1244
-
1245
- - **package**: Bump version to 0.2.2
1246
-
1247
- ## [0.2.1] - 2025-09-01
1248
-
1249
- ### Changed
1250
-
1251
- - **types**: Update CSS type from CSSObject to CSSInterpolation for better compatibility
1252
- - **package**: Bump version to 0.2.1
1253
-
1254
- ## [0.2.0] - 2025-08-31
1255
-
1256
- ### Added
1257
-
1258
- - **docs**: Add badges for NPM version, license, and bundle size to README
1259
-
1260
- ### Enhanced
1261
-
1262
- - **docs**: Update installation instructions and enhance clarity in core concepts
1263
- - **docs**: Enhance documentation with new examples and improved clarity
1264
-
1265
- ### Removed
1266
-
1267
- - **package**: Remove deprecated hook entry from package.json
1268
-
1269
- ### Fixed
1270
-
1271
- - **core.node**: Add suppressHydrationWarning to propsForCreateElement
1272
-
1273
- ### Changed
1274
-
1275
- - **package**: Bump version to 0.2.0
1276
-
1277
- ## [0.1.121] - 2025-08-30
1278
-
1279
- ### Changed
1280
-
1281
- - **core.node**: Simplify style resolution and improve prop handling
1282
- - **StyledRenderer**: Remove unused style prop and simplify component
1283
- - **package**: Bump version to 0.1.121
1284
-
1285
- ## [0.1.120] - 2025-08-30
1286
-
1287
- ### Added
1288
-
1289
- - **styles**: Add Emotion support and Next.js style registry integration
1290
- - Add @emotion/react and @emotion/cache dependencies
1291
- - Add StyledRenderer and StyleRegistry components for Emotion
1292
- - Integrate StyledRenderer into BaseNode for style prop rendering
1293
- - Add nextjs-registry export for Next.js style registry
1294
-
1295
- ### Enhanced
1296
-
1297
- - **core**: Enhance style handling with StyledRenderer for Emotion support
1298
-
1299
- ### Fixed
1300
-
1301
- - **deps**: Update peerDependencies for Emotion and React to use version constraints
1302
- - **deps**: Update @types/react and @types/react-dom to latest versions
1303
-
1304
- ### Changed
1305
-
1306
- - **package**: Update peerDependencies for @emotion/cache
1307
- - **package**: Bump version to 0.1.120
1308
-
1309
- ## [0.1.118] - 2025-08-30
1310
-
1311
- ### Fixed
1312
-
1313
- - **deps**: Update peerDependencies for Emotion and React to use version constraints
1314
-
1315
- ### Changed
1316
-
1317
- - **package**: Bump version to 0.1.118
1318
-
1319
- ## [0.1.117] - 2025-08-30
1320
-
1321
- ### Added
1322
-
1323
- - **flexbox**: Improve default style resolution and add flex shorthand parser
1324
- - Add parseFlexShorthand to extract flex-grow, shrink, and basis
1325
- - Enhance resolveDefaultStyle to respect explicit flex/flexShrink values
1326
- - Improve handling of minHeight, minWidth, and flexShrink for flex items
1327
-
1328
- ### Enhanced
1329
-
1330
- - **core**: Refine type of finalChildren for improved type safety
1331
- - **docs**: Update documentation for clarity on flexbox scrolling fixes
1332
-
1333
- ### Changed
1334
-
1335
- - **core**: Move comments position for better readability
1336
- - **imports**: Remove .js extensions from internal imports
1337
- - **package**: Bump version to 0.1.117
1338
-
1339
- ## [0.1.116] - 2025-08-27
1340
-
1341
- ### Changed
1342
-
1343
- - **package**: Bump version to 0.1.116
1344
-
1345
- ---
1346
-
1347
- ## Notes
1348
-
1349
- - This changelog covers the most recent development history available
1350
- - The project focuses on building React UIs with type-safe fluency without JSX syntax
1351
- - Recent development has emphasized Emotion integration, type safety improvements, and enhanced flexbox support
1352
- - For a complete history, view all commits on GitHub: [View all commits](https://github.com/l7aromeo/meonode-ui/commits)