@meonode/ui 0.4.4 → 0.4.5
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/CHANGELOG.md +25 -0
- package/dist/core.node.d.ts.map +1 -1
- package/dist/core.node.js +3 -3
- package/dist/helper/navigation-cache-manager.helper.d.ts +17 -3
- package/dist/helper/navigation-cache-manager.helper.d.ts.map +1 -1
- package/dist/helper/navigation-cache-manager.helper.js +29 -13
- package/dist/helper/theme.helper.d.ts +1 -0
- package/dist/helper/theme.helper.d.ts.map +1 -1
- package/dist/helper/theme.helper.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.5] - 2025-11-15
|
|
9
|
+
|
|
10
|
+
### Feat
|
|
11
|
+
- **cache**: implement robust cache management and theme caching ([`c453cb8`](https://github.com/l7aromeo/meonode-ui/commit/c453cb872e96c5ea49ddb39b189c79e53e46082a))
|
|
12
|
+
Refactor NavigationCacheManager for robustness, add memory monitoring and auto-cleanup.
|
|
13
|
+
Implement LRU eviction for ThemeResolverCache and integrate with BaseNode cache clearing.
|
|
14
|
+
|
|
15
|
+
### Refactor
|
|
16
|
+
- **test**: split node.test.ts into smaller, more focused test files ([`930f998`](https://github.com/l7aromeo/meonode-ui/commit/930f998e5f91faef3ff42fcafc6b02fc23f422ff))
|
|
17
|
+
This commit refactors the test suite by splitting the monolithic `node.test.ts`
|
|
18
|
+
file into several smaller, more focused test files, each covering a specific
|
|
19
|
+
aspect of the BaseNode functionality.
|
|
20
|
+
|
|
21
|
+
Specifically, `memoization.test.ts` was created to house tests related to
|
|
22
|
+
dependency tracking and memoization in real-world scenarios. During this
|
|
23
|
+
refactoring, a `console.error` related to duplicate keys in a memoization
|
|
24
|
+
test was identified and suppressed to prevent noisy test output while
|
|
25
|
+
preserving the test's original intent of verifying cache collision prevention.
|
|
26
|
+
|
|
27
|
+
### Fix
|
|
28
|
+
- **core**: pass disableEmotion flag to _renderProcessedNode for improved processing ([`b68e3d4`](https://github.com/l7aromeo/meonode-ui/commit/b68e3d49a732ee590805a0298f733b800a9b172d))
|
|
29
|
+
|
|
30
|
+
### Chore
|
|
31
|
+
- **test**: adjust performance test cleanup by removing cache clearing from afterEach ([`77e9fa4`](https://github.com/l7aromeo/meonode-ui/commit/77e9fa4a8731935048ea4bf5c8e8e7169fd88df2))
|
|
32
|
+
|
|
8
33
|
## [0.4.4] - 2025-11-15
|
|
9
34
|
|
|
10
35
|
### Perf
|
package/dist/core.node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts"],"names":[],"mappings":"AAAA,OAAc,EAKZ,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EAEd,gBAAgB,EAChB,WAAW,EAEX,eAAe,EAEf,YAAY,EACZ,UAAU,EACV,SAAS,EAET,OAAO,EACP,cAAc,EACd,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts"],"names":[],"mappings":"AAAA,OAAc,EAKZ,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EAEd,gBAAgB,EAChB,WAAW,EAEX,eAAe,EAEf,YAAY,EACZ,UAAU,EACV,SAAS,EAET,OAAO,EACP,cAAc,EACd,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAWhC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,eAAe,CAAE,YAAW,YAAY,CAAC,CAAC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CAAC,CAAC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjE,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,UAAU,CAAC,EACxD,IAAI,CAAC,EAAE,cAAc,KAClB,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,GACtC,CAAC,CAAC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjE,QAAQ,CAAC,EAAE,QAAQ,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,UAAU,CAAC,EACzD,IAAI,CAAC,EAAE,cAAc,KAClB,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAQzC"}
|
package/dist/core.node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _BaseNode,_excluded=["key","children","ref"],_excluded2=["ref","key","children","css","props","disableEmotion"],_excluded3=["style"],_excluded4=["children","key","css","nativeProps","disableEmotion"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function F(){};return{s:f,n:function n(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function e(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function s(){d=d.call(b)},n:function n(){var a=d.next();return h=a.done,a},e:function e(a){i=!0,g=a},f:function f(){try{h||null==d["return"]||d["return"]()}finally{if(i)throw g}}}}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],-1===b.indexOf(c)&&{}.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c={};for(var d in a)if({}.hasOwnProperty.call(a,d)){if(-1!==b.indexOf(d))continue;c[d]=a[d]}return c}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import React,{createElement,isValidElement,Fragment,StrictMode}from"react";import{isNodeInstance}from"./helper/node.helper.js";import{isForwardRef,isFragment,isMemo,isReactClassComponent,isValidElementType}from"./helper/react-is.helper.js";import{createRoot}from"react-dom/client";import{getComponentType,getCSSProps,getDOMProps,getElementTypeName,hasNoStyleTag,omitUndefined}from"./helper/common.helper.js";import StyledRenderer from"./components/styled-renderer.client.js";import{__DEV__}from"./constants/common.const.js";import{MountTracker}from"./helper/mount-tracker.helper.js";import{NavigationCacheManager}from"./helper/navigation-cache-manager.helper.js";/**
|
|
1
|
+
var _BaseNode,_excluded=["key","children","ref"],_excluded2=["ref","key","children","css","props","disableEmotion"],_excluded3=["style"],_excluded4=["children","key","css","nativeProps","disableEmotion"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function F(){};return{s:f,n:function n(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function e(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function s(){d=d.call(b)},n:function n(){var a=d.next();return h=a.done,a},e:function e(a){i=!0,g=a},f:function f(){try{h||null==d["return"]||d["return"]()}finally{if(i)throw g}}}}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],-1===b.indexOf(c)&&{}.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c={};for(var d in a)if({}.hasOwnProperty.call(a,d)){if(-1!==b.indexOf(d))continue;c[d]=a[d]}return c}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import React,{createElement,isValidElement,Fragment,StrictMode}from"react";import{isNodeInstance}from"./helper/node.helper.js";import{isForwardRef,isFragment,isMemo,isReactClassComponent,isValidElementType}from"./helper/react-is.helper.js";import{createRoot}from"react-dom/client";import{getComponentType,getCSSProps,getDOMProps,getElementTypeName,hasNoStyleTag,omitUndefined}from"./helper/common.helper.js";import StyledRenderer from"./components/styled-renderer.client.js";import{__DEV__}from"./constants/common.const.js";import{MountTracker}from"./helper/mount-tracker.helper.js";import{NavigationCacheManager}from"./helper/navigation-cache-manager.helper.js";import{clearThemeCache}from"./helper/theme.helper.js";/**
|
|
2
2
|
* The core abstraction of the MeoNode library. It wraps a React element or component,
|
|
3
3
|
* providing a unified interface for processing props, normalizing children, and handling styles.
|
|
4
4
|
* This class is central to the library's ability to offer a JSX-free, fluent API for building UIs.
|
|
@@ -147,7 +147,7 @@ if(Array.isArray(b)){// Helper to generate a stable key for array items, crucial
|
|
|
147
147
|
var e=function safeGetKey(a,b){try{// Attempt to get a meaningful name for the element type.
|
|
148
148
|
return"".concat(getElementTypeName(a),"-").concat(b)}catch(a){// Fallback to a generic key if type name cannot be determined.
|
|
149
149
|
return __DEV__&&console.error("MeoNode: Could not determine element type name for key in function-as-a-child.",a),"item-".concat(b)}};// Map over the array, processing each item and assigning a key.
|
|
150
|
-
return b.map(function(a,b){return BaseNode._renderProcessedNode({processedElement:BaseNode._processRawNode(a,d),passedKey:e(a,b)})})}if(b instanceof React.Component)return BaseNode._renderProcessedNode({processedElement:BaseNode._processRawNode(b.render(),d),disableEmotion:d});// Handle primitive types directly, as they are valid React children.
|
|
150
|
+
return b.map(function(a,b){return BaseNode._renderProcessedNode({processedElement:BaseNode._processRawNode(a,d),passedKey:e(a,b),disableEmotion:d})})}if(b instanceof React.Component)return BaseNode._renderProcessedNode({processedElement:BaseNode._processRawNode(b.render(),d),disableEmotion:d});// Handle primitive types directly, as they are valid React children.
|
|
151
151
|
if("string"==typeof b||"number"==typeof b||"boolean"==typeof b)return b;// For any other non-primitive, non-array result, process it as a single NodeElement.
|
|
152
152
|
var f=BaseNode._processRawNode(b,d);// If processing yields a valid element, render it.
|
|
153
153
|
return f?BaseNode._renderProcessedNode({processedElement:f,disableEmotion:d}):b;// Fallback: return the original result if it couldn't be processed into a renderable node.
|
|
@@ -234,7 +234,7 @@ return d.update=function(a){try{var b=isNodeInstance(a)?a.render():a;d.render(b)
|
|
|
234
234
|
BaseNode._portalInfrastructure["delete"](a)},d}catch(a){return __DEV__&&console.error("MeoNode: Error creating portal handle.",a),d}}/**
|
|
235
235
|
* A static method to clear all internal caches.
|
|
236
236
|
* @method clearCaches
|
|
237
|
-
*/static clearCaches(){BaseNode._propProcessingCache.clear(),BaseNode._elementCache.clear()}}// --- Factory Functions ---
|
|
237
|
+
*/static clearCaches(){BaseNode._propProcessingCache.clear(),BaseNode._elementCache.clear(),clearThemeCache()}}// --- Factory Functions ---
|
|
238
238
|
/**
|
|
239
239
|
* The primary factory function for creating a `BaseNode` instance.
|
|
240
240
|
* It's the simplest way to wrap a component or element.
|
|
@@ -2,11 +2,18 @@
|
|
|
2
2
|
* NavigationCacheManager listens for navigation events in the browser
|
|
3
3
|
* and triggers safe cleanup of the element cache to prevent memory leaks.
|
|
4
4
|
* It supports standard browser navigation as well as SPA routing changes.
|
|
5
|
+
*
|
|
6
|
+
* Framework-agnostic: Works with Next.js, React Router, Vue Router, etc.
|
|
5
7
|
*/
|
|
6
8
|
export declare class NavigationCacheManager {
|
|
7
9
|
private static _instance;
|
|
10
|
+
private static _originalPushState;
|
|
11
|
+
private static _originalReplaceState;
|
|
12
|
+
private static _isPatched;
|
|
8
13
|
private _isListening;
|
|
9
14
|
private _cleanupTimeout;
|
|
15
|
+
private _memoryCheckInterval;
|
|
16
|
+
private constructor();
|
|
10
17
|
static getInstance(): NavigationCacheManager;
|
|
11
18
|
/**
|
|
12
19
|
* Starts listening for navigation events to trigger cache cleanup.
|
|
@@ -14,11 +21,18 @@ export declare class NavigationCacheManager {
|
|
|
14
21
|
*/
|
|
15
22
|
start(): void;
|
|
16
23
|
/**
|
|
17
|
-
* Stops listening for navigation events.
|
|
24
|
+
* Stops listening for navigation events and restores original browser APIs.
|
|
25
|
+
* This is important for cleanup during HMR or when unmounting the library.
|
|
18
26
|
*/
|
|
19
|
-
|
|
27
|
+
private _stop;
|
|
20
28
|
private _handleNavigation;
|
|
21
29
|
private _patchHistoryMethods;
|
|
22
|
-
private
|
|
30
|
+
private _unpatchHistoryMethods;
|
|
31
|
+
private _startMemoryMonitoring;
|
|
32
|
+
/**
|
|
33
|
+
* Setup automatic cleanup on page unload.
|
|
34
|
+
* Covers HMR, navigation away, and browser close.
|
|
35
|
+
*/
|
|
36
|
+
private _setupAutoCleanup;
|
|
23
37
|
}
|
|
24
38
|
//# sourceMappingURL=navigation-cache-manager.helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-cache-manager.helper.d.ts","sourceRoot":"","sources":["../../src/helper/navigation-cache-manager.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-cache-manager.helper.d.ts","sourceRoot":"","sources":["../../src/helper/navigation-cache-manager.helper.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAsC;IAC9D,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAwC;IACzE,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA2C;IAC/E,OAAO,CAAC,MAAM,CAAC,UAAU,CAAQ;IAEjC,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,oBAAoB,CAAY;IAExC,OAAO,eAEN;IAED,OAAc,WAAW,IAAI,sBAAsB,CAKlD;IAED;;;OAGG;IACI,KAAK,SAoBX;IAED;;;OAGG;IACH,OAAO,CAAC,KAAK;IA0Bb,OAAO,CAAC,iBAAiB,CAWxB;IAED,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,sBAAsB;IAkB9B,OAAO,CAAC,sBAAsB;IAqB9B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CAyB1B"}
|
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{SafeCacheManager}from"./safe-cache-manager.helper.js";import{__DEV__}from"../constants/common.const.js";/**
|
|
1
|
+
function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{SafeCacheManager}from"./safe-cache-manager.helper.js";import{__DEV__}from"../constants/common.const.js";import{BaseNode}from"../core.node.js";/**
|
|
2
2
|
* NavigationCacheManager listens for navigation events in the browser
|
|
3
3
|
* and triggers safe cleanup of the element cache to prevent memory leaks.
|
|
4
4
|
* It supports standard browser navigation as well as SPA routing changes.
|
|
5
|
-
|
|
5
|
+
*
|
|
6
|
+
* Framework-agnostic: Works with Next.js, React Router, Vue Router, etc.
|
|
7
|
+
*/export class NavigationCacheManager{constructor(){var a=this;_defineProperty(this,"_isListening",!1),_defineProperty(this,"_cleanupTimeout",null),_defineProperty(this,"_memoryCheckInterval",null),_defineProperty(this,"_handleNavigation",function(){a._cleanupTimeout&&clearTimeout(a._cleanupTimeout),a._cleanupTimeout=setTimeout(function(){var a=SafeCacheManager.safeCleanup();__DEV__&&0<a&&console.log("[MeoNode] Navigation detected. Safely evicted ".concat(a," unmounted elements from cache."))},100)})}// Private constructor for singleton
|
|
8
|
+
static getInstance(){return this._instance||(this._instance=new NavigationCacheManager),this._instance}/**
|
|
6
9
|
* Starts listening for navigation events to trigger cache cleanup.
|
|
7
10
|
* This method is idempotent and safe to call multiple times.
|
|
8
|
-
*/start(){this._isListening||"undefined"==typeof window||(// Listen for standard browser navigation event
|
|
9
|
-
// Patch history methods to catch SPA routing changes
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
|
|
11
|
+
*/start(){this._isListening||"undefined"==typeof window||(// Listen for standard browser navigation event
|
|
12
|
+
// Patch history methods to catch SPA routing changes
|
|
13
|
+
// Optional: Start memory pressure monitoring
|
|
14
|
+
// Setup automatic cleanup on page unload ← ADD THIS
|
|
15
|
+
this._isListening=!0,window.addEventListener("popstate",this._handleNavigation),this._patchHistoryMethods(),this._startMemoryMonitoring(),this._setupAutoCleanup(),__DEV__&&console.log("[MeoNode] NavigationCacheManager started"))}/**
|
|
16
|
+
* Stops listening for navigation events and restores original browser APIs.
|
|
17
|
+
* This is important for cleanup during HMR or when unmounting the library.
|
|
18
|
+
*/_stop(){this._isListening&&"undefined"!=typeof window&&(// Restore original history methods
|
|
19
|
+
window.removeEventListener("popstate",this._handleNavigation),this._unpatchHistoryMethods(),this._cleanupTimeout&&(clearTimeout(this._cleanupTimeout),this._cleanupTimeout=null),this._memoryCheckInterval&&(clearInterval(this._memoryCheckInterval),this._memoryCheckInterval=null),this._isListening=!1,__DEV__&&console.log("[MeoNode] NavigationCacheManager stopped"))}_patchHistoryMethods(){var a=this;// Guard against multiple patches (HMR safety)
|
|
20
|
+
NavigationCacheManager._isPatched||(// Store original methods
|
|
21
|
+
// Patch pushState
|
|
22
|
+
// Patch replaceState
|
|
23
|
+
NavigationCacheManager._originalPushState=history.pushState,NavigationCacheManager._originalReplaceState=history.replaceState,history.pushState=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];NavigationCacheManager._originalPushState.apply(history,c),a._handleNavigation()},history.replaceState=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];NavigationCacheManager._originalReplaceState.apply(history,c),a._handleNavigation()},NavigationCacheManager._isPatched=!0,__DEV__&&console.log("[MeoNode] History methods patched for SPA navigation detection"))}_unpatchHistoryMethods(){NavigationCacheManager._isPatched&&(NavigationCacheManager._originalPushState&&(history.pushState=NavigationCacheManager._originalPushState),NavigationCacheManager._originalReplaceState&&(history.replaceState=NavigationCacheManager._originalReplaceState),NavigationCacheManager._isPatched=!1,__DEV__&&console.log("[MeoNode] History methods restored"));// Restore original methods
|
|
24
|
+
}_startMemoryMonitoring(){// Only in development or if explicitly enabled
|
|
25
|
+
__DEV__&&"undefined"!=typeof performance&&"memory"in performance&&(this._memoryCheckInterval=setInterval(function(){var a=performance.memory;if(a){var b=a.usedJSHeapSize/a.jsHeapSizeLimit;// Trigger emergency cleanup at 85% memory usage
|
|
26
|
+
if(.85<b){var c=SafeCacheManager.emergencyCleanup();console.warn("[MeoNode] High memory usage (".concat((100*b).toFixed(1),"%). ")+"Emergency cleanup evicted ".concat(c," entries."))}}},3e4));// Check if Performance Memory API is available (Chrome/Edge only)
|
|
27
|
+
}/**
|
|
28
|
+
* Setup automatic cleanup on page unload.
|
|
29
|
+
* Covers HMR, navigation away, and browser close.
|
|
30
|
+
*/_setupAutoCleanup(){var a=this;// Only set up once
|
|
31
|
+
window.__MEONODE_CLEANUP_REGISTERED||(// Handle page unload (navigation away, refresh, close)
|
|
32
|
+
// Handle visibility change (tab switching, minimize)
|
|
33
|
+
// Good opportunity for lazy cleanup
|
|
34
|
+
window.addEventListener("beforeunload",function(){a._stop(),BaseNode.clearCaches()}),document.addEventListener("visibilitychange",function(){document.hidden&&setTimeout(function(){document.hidden&&SafeCacheManager.safeCleanup()},5e3)}),window.__MEONODE_CLEANUP_REGISTERED=!0)}}_defineProperty(NavigationCacheManager,"_instance",null),_defineProperty(NavigationCacheManager,"_originalPushState",null),_defineProperty(NavigationCacheManager,"_originalReplaceState",null),_defineProperty(NavigationCacheManager,"_isPatched",!1);
|
|
@@ -11,4 +11,5 @@ import type { Theme } from '../types/node.type.js';
|
|
|
11
11
|
export declare const resolveObjWithTheme: (obj?: Record<string, any>, theme?: Theme | undefined, options?: {
|
|
12
12
|
processFunctions?: boolean | undefined;
|
|
13
13
|
}) => any;
|
|
14
|
+
export declare const clearThemeCache: () => void;
|
|
14
15
|
//# sourceMappingURL=theme.helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.helper.d.ts","sourceRoot":"","sources":["../../src/helper/theme.helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"theme.helper.d.ts","sourceRoot":"","sources":["../../src/helper/theme.helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,yBAAyB,CAAA;AA0GjE;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;;SAoH/B,CAAA;AAED,eAAO,MAAM,eAAe,YAE3B,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{getValueByPath}from"./common.helper.js";import{ObjHelper}from"./obj.helper.js";/**
|
|
1
|
+
function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{getValueByPath}from"./common.helper.js";import{ObjHelper}from"./obj.helper.js";var CACHE_SIZE_LIMIT=500,CACHE_EVICTION_BATCH_SIZE=50;/**
|
|
2
2
|
* Cache manager for theme resolution operations.
|
|
3
3
|
*/class ThemeResolverCache{constructor(){_defineProperty(this,"_resolutionCache",new Map),_defineProperty(this,"_pathLookupCache",new Map),_defineProperty(this,"_themeRegex",/theme\.([a-zA-Z0-9_.-]+)/g)}static getInstance(){return ThemeResolverCache._instance||(ThemeResolverCache._instance=new ThemeResolverCache),ThemeResolverCache._instance}/**
|
|
4
4
|
* Generate a stable cache key from object and theme, including the theme mode.
|
|
5
5
|
*/_generateCacheKey(a,b){// Including theme.mode is critical for cache correctness.
|
|
6
|
-
return"".concat(ObjHelper.stringify(a),"_").concat(b.mode,"_").concat(ObjHelper.stringify(b.system))}getResolution(a,b){var c=this._generateCacheKey(a,b);return this._resolutionCache.
|
|
6
|
+
return"".concat(ObjHelper.stringify(a),"_").concat(b.mode,"_").concat(ObjHelper.stringify(b.system))}getResolution(a,b){var c=this._generateCacheKey(a,b),d=this._resolutionCache.get(c);return d&&(this._resolutionCache["delete"](c),this._resolutionCache.set(c,d)),d||null}setResolution(a,b,c){var d=this._generateCacheKey(a,b);this._resolutionCache.set(d,c),this._resolutionCache.size>CACHE_SIZE_LIMIT&&this._evict(this._resolutionCache)}getPathLookup(a,b){var c="".concat(ObjHelper.stringify(a),"_").concat(b),d=this._pathLookupCache.get(c);return d&&(this._pathLookupCache["delete"](c),this._pathLookupCache.set(c,d)),d||null}setPathLookup(a,b,c){var d="".concat(ObjHelper.stringify(a),"_").concat(b);this._pathLookupCache.set(d,c),this._pathLookupCache.size>CACHE_SIZE_LIMIT&&this._evict(this._pathLookupCache)}_evict(a){for(var b,c=a.keys(),d=0;d<CACHE_EVICTION_BATCH_SIZE&&(b=c.next().value,b);d++)a["delete"](b)}getThemeRegex(){return this._themeRegex.lastIndex=0,this._themeRegex}shouldCache(){return"undefined"==typeof window}clear(){this._resolutionCache.clear(),this._pathLookupCache.clear()}}_defineProperty(ThemeResolverCache,"_instance",null);var themeCache=ThemeResolverCache.getInstance(),isPlainObject=function isPlainObject(a){if("object"!==_typeof(a)||null===a)return!1;var b=Object.getPrototypeOf(a);return null===b||b===Object.prototype};/**
|
|
7
7
|
* Resolves theme variable references in an object's values iteratively.
|
|
8
8
|
* This function uses a manual work stack to traverse the object, which prevents
|
|
9
9
|
* "Maximum call stack size exceeded" errors for deeply nested objects.
|
|
@@ -13,4 +13,4 @@ return"".concat(ObjHelper.stringify(a),"_").concat(b.mode,"_").concat(ObjHelper.
|
|
|
13
13
|
* React's reconciliation and memoization.
|
|
14
14
|
*/export var resolveObjWithTheme=function resolveObjWithTheme(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=1<arguments.length?arguments[1]:void 0,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},e=d.processFunctions;if(!c||!c.system||"object"!==_typeof(c.system)||0===Object.keys(c.system).length||0===Object.keys(b).length)return b;var f=c.system;if(themeCache.shouldCache()){var g=themeCache.getResolution(b,c);if(null!==g)return g}// Used for cycle detection within the current traversal path.
|
|
15
15
|
for(var h=[{value:b,isProcessed:!1}],j=new Map,k=new Set,l=function processThemeString(a){var b=themeCache.getThemeRegex(),c=!1,d=a.replace(b,function(a,b){var d=themeCache.getPathLookup(f,b);return null===d&&(d=getValueByPath(f,b),themeCache.setPathLookup(f,b,d)),void 0!==d&&null!==d?(c=!0,"object"===_typeof(d)&&!Array.isArray(d)&&"default"in d?d["default"]:d):a});return c?d:a};0<h.length;){var m=h[h.length-1],n=m.value;if(!isPlainObject(n)&&!Array.isArray(n)){h.pop();continue}if(j.has(n)){h.pop();continue}if(!m.isProcessed){m.isProcessed=!0,k.add(n);for(var o,p=Array.isArray(n)?n:Object.values(n),q=p.length-1;0<=q;q--)o=p[q],(isPlainObject(o)||Array.isArray(o))&&!k.has(o)&&h.push({value:o,isProcessed:!1})}else{h.pop(),k["delete"](n);// Unwind the path
|
|
16
|
-
var r=n;if(Array.isArray(n)){for(var s=null,t=0;t<n.length;t++){var u,v=n[t],w=null!==(u=j.get(v))&&void 0!==u?u:v;w!==v&&(null===s&&(s=[...n]),s[t]=w)}null!==s&&(r=s)}else{var x=null;for(var y in n)if(Object.prototype.hasOwnProperty.call(n,y)){var z,A=n[y],B=null!==(z=j.get(A))&&void 0!==z?z:A;if("function"==typeof B&&void 0!==e&&e){var C=B(c);B="string"==typeof C&&C.includes("theme.")?l(C):C}else"string"==typeof B&&B.includes("theme.")&&(B=l(B));B!==A&&(null===x&&(x=_objectSpread({},n)),x[y]=B)}null!==x&&(r=x)}j.set(n,r)}}var D=null!==(a=j.get(b))&&void 0!==a?a:b;return themeCache.shouldCache()&&themeCache.setResolution(b,c,D),D};
|
|
16
|
+
var r=n;if(Array.isArray(n)){for(var s=null,t=0;t<n.length;t++){var u,v=n[t],w=null!==(u=j.get(v))&&void 0!==u?u:v;w!==v&&(null===s&&(s=[...n]),s[t]=w)}null!==s&&(r=s)}else{var x=null;for(var y in n)if(Object.prototype.hasOwnProperty.call(n,y)){var z,A=n[y],B=null!==(z=j.get(A))&&void 0!==z?z:A;if("function"==typeof B&&void 0!==e&&e){var C=B(c);B="string"==typeof C&&C.includes("theme.")?l(C):C}else"string"==typeof B&&B.includes("theme.")&&(B=l(B));B!==A&&(null===x&&(x=_objectSpread({},n)),x[y]=B)}null!==x&&(r=x)}j.set(n,r)}}var D=null!==(a=j.get(b))&&void 0!==a?a:b;return themeCache.shouldCache()&&themeCache.setResolution(b,c,D),D};export var clearThemeCache=function clearThemeCache(){themeCache.clear()};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meonode/ui",
|
|
3
3
|
"description": "A structured approach to component composition, direct CSS-first prop styling, built-in theming, smart prop handling (including raw property pass-through), and dynamic children.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|