@dxtmisha/functional-basic 1.3.5 → 1.3.7

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 CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.3.6] - 2026-06-16
6
+
7
+ ### Added
8
+ - **GeoInstance**: Integrated cookie storage persistence/hydration fallback: now attempts to retrieve the geo code from the `ui-geo-code` cookie (via `UI_GEO_COOKIE_KEY`) during initialization if DOM storage is unavailable.
9
+
10
+ ### Changed / Improved
11
+ - **GeoInstance**: Refactored `findLocation()` to extract DOM-specific checks into `findLocationDom()`, improving architecture and separation of concerns.
12
+ - **GeoInstance**: Updated `set()` to store the updated geo code in the cookie when `save = true`.
13
+ - **ApiHeaders**: Fixed and updated unit tests in `ApiHeaders.test.ts` to align with the normalized lowercase HTTP header key merging behavior.
14
+
5
15
  ## [1.3.5] - 2026-06-05
6
16
 
7
17
  ### Changed / Improved
@@ -1,9 +1,23 @@
1
- Core Purpose: This library is a comprehensive, SSR-compatible utility suite for frontend applications, providing centralized management for HTTP requests (Fetch API), localized data formatting (Intl), state/storage management (cookies, local/session storage), and meta-tag manipulation. It acts as a foundational framework for handling API communication, multi-language support, and persistent application state across client and server environments.
1
+ This library is a comprehensive, SSR-compatible utility collection for TypeScript/JavaScript web applications, providing a standardized interface for common web development tasks. It functions as a modular framework rather than a single-purpose library, offering unified management for data persistence, HTTP requests, UI state, and localization.
2
2
 
3
- Usage Scenarios: You should study this library when:
4
- - Implementing or refactoring an API communication layer: The library provides robust handling of requests, response caching, error storage, and hydration across SSR/Client boundaries via classes like ApiInstance, ApiCache, and ApiResponse.
5
- - Managing internationalization (i18n): Use its localization utilities (Geo, GeoIntl, Translate, Datetime) for date/time formatting, currency handling, and phone number masking.
6
- - Handling complex state and storage: Its specialized storage wrappers (DataStorage, CookieStorage, ServerStorage) are indispensable for maintaining consistency between server-rendered HTML and client-side hydrations.
7
- - Implementing UI-dependent logic: It provides optimized event listeners (EventItem), loading state management (Loading, LoadingInstance), and reactive URL hash management (Hash, HashInstance).
3
+ Core components include:
4
+ 1. HTTP API Management: A centralized `ApiInstance` supporting request/response interception, auto-hydration for SSR, caching, and structured error handling via `ApiErrorStorage`.
5
+ 2. Storage & State: Wrappers for `localStorage`, `sessionStorage` (`DataStorage`), `cookies` (`CookieStorage`), and a global data registry.
6
+ 3. Localization: Extensive support for internationalization, including date/number/currency formatting (`GeoIntl`) and a translation system (`TranslateInstance`).
7
+ 4. DOM/Utility Tools: Event listeners (`EventItem`) with SSR safety, scrollbar width detection, responsive image/file processing, and type-safe utilities for arrays, objects, and strings.
8
+ 5. Meta Management: Structured handling of standard HTML, Open Graph, and Twitter meta tags.
8
9
 
9
- Integration Context: The library is designed to be environment-agnostic but is particularly effective in SSR-heavy stacks (like Vue or React SSR). It manages the transition from server-rendered state to client-side interactivity using hydration helpers. It operates as a set of singleton or instance-based controllers that can be initialized at the application entry point to provide global, consistent interfaces for network requests, localization, and data persistence.
10
+ The library is indispensable for enterprise-scale applications requiring:
11
+ - Seamless SSR hydration for API data and global states.
12
+ - Standardized error reporting and centralized API/translation configuration.
13
+ - Consistent formatting (dates, currency, units) across varied geographic locales.
14
+ - Managed event lifecycle and DOM interaction in complex, dynamic interfaces.
15
+
16
+ An AI coding assistant should study this library when tasked with:
17
+ - Implementing or refactoring data fetching and API communication layers.
18
+ - Standardizing internationalization (i18n) and data formatting logic.
19
+ - Managing persistent client-side storage with built-in SSR support.
20
+ - Orchestrating complex DOM events or managing high-frequency UI synchronization (e.g., scroll/resize).
21
+ - Implementing SEO metadata management across SSR pages.
22
+
23
+ The library integrates primarily with native Web APIs (Fetch, localStorage, etc.) and provides a consistent high-level abstraction layer, making it suitable for any framework-agnostic or framework-specific project (e.g., Vue or React) that requires robust state and IO management.