14 KiB
Changelog
All notable changes to this project will be documented in this file.
[2.0.1] - 2026-02-04
- ReadMe (
README.md): Updated ReadMe for better understanding
[2.0.2] - 2026-02-08
๐ Added (SSR & Architecture)
-
Server-Side Rendering (SSR): Full support for Node.js environments via
jsdom. -
Added
src/server.tswithparseHTMLutility. -
Added
bind(window)factory insrc/index.tsto create isolated jBase instances per request. -
Context Awareness: The core
jBaseclass now accepts an optionalcontext(Window/Document) in the constructor to support isolated environments. -
Environment Detection: Added
isBrowser()utility insrc/utils.tsto safely distinguish between browser and server environments.
โก Performance
- Data Module (
data/objects.ts): Optimized search algorithms infind.first,find.last,find.key, andfind.value. moved query normalization (toLowerCase()) outside of loops to significantly reduce CPU overhead. - Effects Module: Added server-guards (
if (!isBrowser())) tofade.ts,slide.ts, andvertical.ts. Animation logic is now skipped on the server to save resources.
๐ก๏ธ Fixed (Stability & Logic)
-
Core (
core.ts): Added crash protection for invalid CSS selectors.$(...)now catchesDOMExceptionerrors internally and logs a warning instead of crashing. -
DOM Manipulation (
dom/manipulation.ts): -
Rewrote
unwrap()using aSetto safely handle parent removal without conflicts on sibling elements. -
Replaced global
window.documentusage with agetDoc(this)helper to preventReferenceErrorcrashes in Node.js. -
HTTP Module (
http/*.ts): Fixed potential crash when parsing JSON from200 OKresponses that contain an empty body. -
CSS Module (
css/styles.ts): Updatedcss()getter to accessgetComputedStyleviael.ownerDocumentinstead of globalwindow.
๐ง Changed & Cleaned
- Documentation: Removed localized German JSDoc comments to reduce source code size and maintain a consistent English-only documentation standard.
- Config: Fixed invalid JSON syntax in
tsconfig.json. - Type Safety: Upgraded
isObjectutility to a TypeScript Type Guard for better type inference.
[2.0.3] - 2026-02-13
๐ก๏ธ Fixed (http)
- HTTP Module (
http/get.ts): Enforce GET method in get() and getText() utility. Overrides method to 'GET' if 'POST' is passed in options. - HTTP Module (
http/post.ts): Enforce POST method in post() utility. Overrides method to 'POST' if 'GET' is passed in options.
[2.1.1] - 2026-02-22
๐ Added (DOM Attributes)
- Attributes Module (
dom/attributes.ts): AddedremoveAttr()method to safely remove HTML attributes from all elements in a selection. - Attributes Module (
dom/attributes.ts): Addedprop()method for getting and setting underlying DOM properties (e.g.,checked,disabled,selectedIndex) that don't directly map to standard HTML attributes.
๐ก๏ธ Fixed (CSS & HTTP)
- CSS Module (
css/styles.ts): Enhanced thecss()method to support passing an object (Record<string, string | number>) for setting multiple CSS properties simultaneously (e.g.,css({'background-color': 'blue', 'font-size': '14px'})). - CSS Module (
css/styles.ts): Improved handling of kebab-case property names inside thecss()method by utilizingstyle.setProperty()for greater robustness. - HTTP Module (
http/get.ts): Fixed a critical bug ingetText()where it incorrectly attempted to parse the response withJSON.parse()instead of returning the raw text. It now safely returns the raw string/HTML as intended.
[2.1.2] - 2026-02-22
๐ก๏ธ Fixed (Core & Browser Scope)
- Core (
src/index.ts): Fixed an architectural bug where thehttpanddatamodules were not accessible via the main$wrapper (e.g.,$.httpor$.data) as documented in the wiki. They are now properly attached to theinitfactory function usingObject.assign(). - Browser Module (
src/browser.ts): Removed the unintended globalwindow.httpexport to prevent global namespace pollution. The HTTP module must now be accessed exclusively through the framework instance (e.g.,$.httporjBase.http).
[2.2.0] - 2026-04-12
๐ Added (New Features)
- Event System (
events/binding.ts): * Massive upgrade to the.on()and.off()methods. They now fully support Event Delegation (e.g.,$('table').on('click', 'tr', handler)) and passing custom data to the event object (event.data).- Added
.once()method to execute a handler at most once per element and event type. Supports delegation and data. - Added
.trigger()method to programmatically execute native or custom events and pass optional data viaevent.detail.
- Added
- Touch Events (
events/touch.ts): Added.swipeLeft(),.swipeUp().swipeDown()and.swipeRight()helpers for robust mobile gesture detection. - Mouse Events (
events/mouse.ts): Added.hover()as a convenient shorthand for binding bothmouseenterandmouseleavehandlers. - Core Utilities (
utils.ts&index.ts): * Introduced$.each(), a highly performant, breakable iteration utility for arrays, NodeLists, and plain objects.$.throttleand$.debounceare now globally exposed on the main$object for easy access.
โก Performance
- Core (
core.ts): Implemented a high-performance, nativefor-loop iteration method (.each()) inside the core class. Replaced standardforEachcalls across the entire framework (DOM, CSS, Attributes, etc.) to significantly reduce CPU overhead and allow early loop termination.
๐ก๏ธ Fixed (Stability & Architecture)
- SSR Safety (
core.ts): Fixed a critical bug in the constructor where string selectors would fall back to the globaldocumentinstead of the passed isolatedcontext(this.doc). Node.js environments are now completely safe. - Event Delegation (
events/binding.ts): Fixed a potentialTypeErrorcrash during event delegation when a user clicks on a pureTextNode(which lacks the.closest()method). - Typings (
index.ts): Fixed signature mismatch for.prop()to correctly handle getter (any) and setter (jBase) overloads. - Dependencies (
package.json): Movedjsdomandtslibfrom standarddependenciestopeerDependencies/devDependencies. This drastically reduces the installation size for browser-only users via npm.
[2.3.0] - 2026-04-20
๐ Added (Upload Method)
- HTTP Module: Added
$.http.upload()method. This introduces a modern, Promise-based wrapper aroundXMLHttpRequestspecifically designed for file uploads. It solves the native limitation of thefetchAPI by allowing real-time upload progress tracking via anonProgresscallback, while maintaining the same elegantasync/awaitsyntax as the rest of the HTTP module.
[2.4.0] - 2026-05-03
๐ Added (Dynamic Routing & API Symmetry)
- Data Module (
data/index.ts): Introduced a smart, dynamic API router (Facade). You no longer need to explicitly specify.arror.objwhen calling data utilities.- Methods can now be called directly on the main data namespace (e.g.,
$.data.chunk(),$.data.remove.at()). - The framework automatically detects the input type under the hood (
Array.isArray()) and routes the request to the correct underlying module. - Full TypeScript overloads guarantee perfect IntelliSense and type safety depending on whether you pass an array or an object.
- Note: Explicit calls via
.arrand.objremain fully supported for 100% backward compatibility.
- Methods can now be called directly on the main data namespace (e.g.,
- Data Module (
data/objects.ts): Massive expansion of object utilities to mirror the array API.- Added
chunk()for objects to split a large object into an array of smaller objects (batched processing). - Added
add()for safely injecting a key-value pair at a specific index position. - Added
remove.at(),remove.first(),remove.last(),remove.byKey(),remove.byValue(), andremove.byMatch()to immutably remove properties from an object based on complex queries or exact matches. - Added
find.all()to return a partial object containing only the properties that match a specific query. - Aliased
mergetomergeObjectsto ensure naming consistency across the data module.
- Added
- Data Module (
data/arrays.ts): Expanded array utilities to mirror the object API.- Added
get()andset()for safe, deep navigation and assignment within nested arrays. - Added
find.key()andfind.value()to provide identical method signatures between arrays and objects. - Added
pick()andomit()to immutably extract or remove array elements based on a list of specific indices. - Added
remove.byKey()andremove.byValue()for strict API parity with object removals.
- Added
๐ Added (DOM Content)
- DOM Module (
dom/content.ts): Added.load(url)method. This provides a highly requested, classic shortcut to asynchronously fetch HTML from a server and inject it directly into the matched DOM elements. Under the hood, it seamlessly utilizes the robust$.http.getText()utility.
โก Performance & Logic
- Data Module (
data/arrays.ts&data/objects.ts):- All search queries within
findandremovemethods are now executed in a case-insensitive manner by default. - Both modules are now completely symmetrical, utilizing the same internal
MatchModelogic ('exact','contains','startsWith','endsWith') for predictable data extraction.
- All search queries within
๐งน Cleaned & Utility
- Data Module (
data/arrays.ts&data/objects.ts):- Added
clear()(along with aliasesempty()andremove.all()) to both modules. These methods provide a fast, standardized way to return a new, empty element of the respective type ([]or{}) without mutating the original data structure, adhering to the framework's functional design principles.
- Added
- Effects Module (
effects/fade.ts): Addedshow(),hide()andtoggle(), as semantic aliases forfadeIn(),fadeOut()andfadeToggle(). This provides a more intuitive, classic API for developers used to standard DOM visibility toggling, while maintaining the smooth CSS transition logic under the hood. - DOM Module (
dom/states.ts): Added semantic action aliases for state manipulation. You can now use.check(),.uncheck(),.select(),.disable(), and.enable()as highly readable, chainable alternatives to passing boolean values into.checked(),.selected(), and.disabled().
๐ก๏ธ Secured (XSS Protection & Architecture)
- Core Utilities (
utils.ts): Introduced a centralized, high-performance XSS sanitizer (sanitizeDangerousAttributes). This internal utility aggressively strips dangerous inline event handlers (likeonerror) and malicious protocols (likehref="javascript:...") from raw HTML strings. - Core (
core.ts): Hardened the mainjBaseconstructor. Creating new DOM elements via$('<div...>')now passes the string through the central sanitizer, ensuring "secure-by-default" behavior even when handling untrusted user input. - DOM Manipulation (
dom/manipulation.ts): Secured all structural insertion methods (append,prepend,before,after,wrap, andreplaceWith). Any raw HTML strings passed into these methods are now automatically sanitized before being injected into the DOM, closing the backdoor for XSS injections. - DOM Content (
dom/content.ts): Completely overhauled the injection logic for.html()and.load(). They now inherit the strict XSS sanitization by default. To maintain full framework flexibility for trusted sources, we introduced the{ executeScripts: true }bypass, which safely extracts, injects, and evaluates embedded<script>tags on demand.
๐ Documentation & Developer Experience
- HTTP Module (
http/get.ts,http/post.ts): Harmonized JSDoc comments and added practical, framework-native examples (using$instead of vanillaquerySelector), perfectly matching the updateduploadmethod documentation. - DOM States (
dom/states.ts): Cleaned up internal typings and refined JSDoc descriptions for attribute and class manipulation methods to guarantee a consistent developer experience across the entire DOM API.
[2.4.1] - 2026-05-09
๐ Features & Enhancements
- Effects (Global Easing): Added support for custom
easingproperties (e.g.,'linear','cubic-bezier') across all animation modules (Fade, Slide, Vertical), giving developers full control over transition timing. - Effects (Global Bounce): Introduced a new
bounce: trueoption across all effects.- Fade: Applies a snappy scale-spring effect.
- Slide: Applies a
back-in/back-outcubic-bezier curve, making menus physically hit the edge. - Vertical: Intelligently utilizes specific curves for a smooth accordion-spring effect.
- Developer Experience (Shorthand Syntax): All effect methods (
fadeIn,fadeOut,fadeToggle,show,hide,toggle,slideIn,slideOut,slideToggle,slideDown,slideUp,slideToggleBox) now accept a primitivenumber(duration in ms) as a direct argument (e.g.,$('main').hide(500)). This restores classic, rapid-prototyping shorthand syntax while maintaining full configuration object support. - Types: Expanded
FadeOptions,SlideOptions, andSlideVerticalOptionsinterfaces to support the neweasingandbounceproperties safely.
๐ Bug Fixes
- Effects (Core Architecture): Fixed a critical
TypeError: Failed to construct 'HTMLElement': Illegal constructorexception across all toggle methods (fadeToggle,slideToggle,slideToggleBox). This was resolved by adopting modern ES6 arrow functions to ensure properthiscontext binding within iteration loops. - Effects (Race Conditions): Resolved the notorious "ghost timer" bug. Rapidly overlapping animation calls (e.g., fast toggling of menus or dropdowns) caused elements to unexpectedly revert to
display: noneor stutter. Animation timers are now strictly tracked and cleared on a per-element basis across all modules. - Effects (Slide): Fixed a logical bug in
slideInwhere thedirectionparameter was completely ignored. Elements are now correctly pre-positioned off-canvas (-100%or100%) before the slide transition begins. - Effects (Vertical): Resolved an issue where interrupting an active vertical slide caused the framework to incorrectly bail out due to static
displaystate checks. Animations can now be smoothly reversed mid-flight.