Releases: hckhanh/fast-url
fast-url@6.0.3
Patch Changes
- 1d1d133: Add PURE annotations to Array and Int8Array constructors for better tree-shaking
fast-url@6.0.2
Patch Changes
-
5b7ec21: Performance optimizations for path and parameter handling utilities in
src/index.ts. This release focuses on reducing regex recompilation overhead, optimizing string manipulation for path joining, and improving parameter filtering performance.Performance Optimizations:
- Pre-compiled regex: Extracted the path parameter regex (
PATH_PARAM_REGEX) to module scope to avoid recompiling it on everypath()call, improving efficiency for path template processing. - Optimized
join()function: Rewrote to use direct string indexing (part1[len1 - 1],part2[0]) instead ofendsWith/startsWithmethods, added fast paths for empty strings, and optimized for the most common URL joining scenario where both parts have separators. This reduces unnecessary string slicing and improves speed. - Optimized
removeNullOrUndef()function: Improved performance by checking for null/undefined values before allocating a new object, and using direct property iteration instead ofObject.entries/Object.fromEntries. This results in faster execution and less memory usage, especially when no filtering is needed.
Parameter Validation Improvements:
- Enhanced
validatePathParam()to check for empty strings in path parameters, ensuring that string path parameters cannot be empty or whitespace-only values. - Improved code readability by adding blank lines between logical blocks in validation logic.
- Pre-compiled regex: Extracted the path parameter regex (
v6.0.1
v6.0.0
Major Changes
-
d14ac79: BREAKING CHANGE: Renamed default export from
urlcattocreateUrland changed from default export to named export for better clarity and JSR.io complianceJSR.io Compliance
Made the package fully compliant with JSR.io (JavaScript Registry) requirements:
- Added comprehensive module documentation to all entrypoints with
@moduletags - Added JSDoc documentation for all exported symbols (100% coverage)
- Added usage examples in module documentation
- Enhanced TypeScript type safety with proper documentation for
ParamMaptype - Verified no slow types are used (strict mode enabled)
Breaking Changes
-
Renamed: Function changed from
urlcattocreateUrl -
Export Type: Changed from default export to named export
// Before import urlcat from "fast-url"; urlcat("https://api.example.com", "/users/:id", { id: 42 }); // After import { createUrl } from "fast-url"; createUrl("https://api.example.com", "/users/:id", { id: 42 });
Migration Guide
Update your imports and function calls:
- Replace
import urlcat from 'fast-url'withimport { createUrl } from 'fast-url' - Replace all
urlcat(...)calls withcreateUrl(...) - For CommonJS: Replace
const urlcat = require('fast-url').defaultwithconst { createUrl } = require('fast-url')
The API and all utility functions (
query,subst,join) remain unchanged and fully compatible.Documentation Improvements
- Enhanced JSDoc comments with better examples
- Added module-level documentation for better IDE support
- Improved type definitions for JSR.io compatibility
- All exported symbols now have comprehensive documentation
- Added comprehensive module documentation to all entrypoints with
v5.0.1
v5.0.0
Major Changes
-
cf2abf5: This pull request introduces a major modernization and optimization of the querystring module, aligning it closely with the latest Node.js implementation while improving performance, expanding test coverage, and enhancing developer tooling and documentation. The update brings a faster, more consistent, and fully cross-environment compatible querystring implementation, with comprehensive benchmarks and no breaking changes.
Querystring Module Modernization & Optimization
- Replaced the
src/querystring/node.tsimplementation with an optimized version based on the latest Node.js source, featuring direct constant access and inlined logic forencodeString, resulting in a 5-20% performance improvement and matching or exceeding the legacy implementation. [1] [2] - Updated the
stringifyfunction to use the newencodeStringand improved primitive handling for efficient query string serialization. - Refactored imports in
src/index.tsto use the new querystring path, ensuring all code uses the updated implementation.
Testing & Benchmarking Enhancements
- Expanded the test suite to 95 tests (including new tests for
isHexTable) and introduced comprehensive benchmarks comparing old, new, and optimized implementations, with all tests passing and benchmarks confirming negligible real-world performance differences. [1] [2] - Added detailed documentation and summary files (
QUERYSTRING_UPDATE_SUMMARY.md,OPTIMIZATION_GUIDE.md) explaining the update, performance comparisons, and optimization techniques. [1] [2] [3]
Developer Experience & Tooling Improvements
- Added new linting rules and enabled the Biome "nursery" ruleset in
biome.jsonfor improved code consistency and style enforcement. [1] [2] [3] - Added
@types/nodetodevDependenciesfor improved type support. [1] [2] - Updated
vitest.config.mtsto support path aliasing for cleaner imports using@.
Documentation & Security
- Added a
SECURITY.mdpolicy outlining supported versions, vulnerability reporting, and best practices. [1] [2] - Updated the README to clarify Unicode handling capabilities, highlighting the use of
codePointAtfor proper Unicode encoding. [1] [2]
Overall, this update modernizes and optimizes the querystring module, improves performance, expands test coverage, and enhances developer tooling, with no breaking changes and full cross-environment compatibility.
- Replaced the
v4.0.2
Patch Changes
-
75521d2: Modernize development infrastructure and CI/CD workflows:
- Migrate from npm to Bun for faster package management
- Replace Jest with Vitest for improved test performance
- Switch from ESLint to Biome for unified linting and formatting
- Adopt mise for consistent toolchain management across environments
- Add Changesets for automated version management and releases
- Implement step-security/harden-runner for enhanced workflow security
- Set up automated code fixes with autofix.ci
- Add CodSpeed benchmarking integration
- Configure OIDC authentication for Codecov uploads
- Add OpenSSF Scorecard for supply-chain security monitoring
v4.0.1
v4.0.0
Major Changes
-
c7a163d: ## Major Performance and API Overhaul
🚀 Performance Improvements
- Replace
qsdependency withfast-querystring: Significant performance boost for query string serialization with smaller bundle size - Optimized internal implementations: Improved regex patterns and streamlined parameter handling for better runtime performance
- Reduced bundle size: Elimination of heavy
qsdependency and related configuration overhead
💥 Breaking Changes
Removed
configureAPI- REMOVED:
configure()function andUrlCatConfigurationtype - REMOVED: Support for
arrayFormatoptions (repeat, comma, brackets, indices) - REMOVED: Support for
objectFormat.formatoptions (RFC1738, RFC3986) - IMPACT: All query parameters now use
fast-querystring's default encoding behavior
API Simplification
- REMOVED: 4-parameter overload
urlcat(baseUrl, path, params, config) - SIMPLIFIED: Only 3 core overloads remain:
urlcat(baseTemplate, params)urlcat(baseUrl, path)urlcat(baseUrl, pathTemplate, params)
Query String Behavior Changes
- Spaces: Now encoded as
%20instead of+(RFC3986 vs RFC1738) - Arrays: Default serialization only (no custom arrayFormat support)
- Objects: Simplified serialization without format configuration
🔧 Internal Improvements
- Regex optimization: Simplified path parameter matching from
/:[_A-Za-z]+[_A-Za-z0-9]*/gto/:[_A-Za-z]+\w*/g - Better type safety: More precise parameter validation and type constraints
- Cleaner implementation: Reduced complexity in
urlcatImpland related functions - Enhanced null/undefined filtering: More efficient parameter cleanup
📚 Documentation Updates
- Updated all examples to reflect new API
- Removed configuration-related documentation
- Updated installation instructions to prefer
bun - Refreshed build and development workflow documentation
🛠 Development Experience
- Build tool migration: Full migration from npm to bun for faster development
- Updated tooling: Biome integration for linting and formatting
- Simplified scripts: Streamlined package.json scripts for better DX
- Replace