Releases: rviscomi/capo.js
v2.1.0
v2.0.0
⚠️ Breaking Changes
Programmatic API Restructuring
The library has been refactored to provide a more direct and modern API. The previous version exported modules as namespaces, whereas v2.0.0 exports functions and constants directly.
Before (v1):
import { rules, validation } from '@rviscomi/capo.js';
const weight = rules.getWeight(element);
const isValid = validation.isValidElement(element);After (v2):
import { getWeight, isValidElement, BrowserAdapter } from '@rviscomi/capo.js';
const adapter = new BrowserAdapter();
const weight = getWeight(element, adapter);
const isValid = isValidElement(element, adapter);Removal of WebPageTest and BigQuery Support
Support for WebPageTest and BigQuery has been removed from the core library to reduce maintenance burden and focus on the core analysis engine.
Removal of Capo.js Snippet
The standalone Capo.js snippet has been removed. Users are encouraged to use the Chrome extension or the programmatic API.
🚀 New Features & Improvements
New Adapter System
Capo.js now supports a flexible adapter system, allowing it to run on different DOM implementations.
- Built-in adapter: The
BrowserAdapteris provided for standard browser DOM environments. - Custom adapters: Consumers can implement their own adapters by extending the base
AdapterInterfaceclass. This enables Capo.js to work with different parsers (like JSDOM or ASTs), unlocking its use in static analysis tools.
New Validation Rules
- Font preload missing crossorigin: Capo.js now validates that font preloads include the
crossoriginattribute.
Virtual Console
The demo page now includes a virtual console, making it easier to see Capo output right in the docs, without needing to open the browser console.
🛠️ Internal Improvements
- Refactored Core Logic: Core analysis logic has been moved to a dedicated analyzer and adapter-based architecture.
- Improved Test Coverage: Significant increase in test coverage with new integration and unit tests.
- Modernized Build Tooling: Updated dependencies and build configuration.
For detailed migration instructions, refer to the Migration Guide.
Full Changelog: v.1.5.3...v2.0.0
v1.5.3
v1.5.2
What's Changed
- Update README.md with the correct path for capo.js by @radum in #76
- docs! by @rviscomi in #67
- Allowlist of
http-equivkeywords by @rviscomi in #79 - npm publish by @rviscomi in #82
- Web client by @rviscomi in #83
- Validate CSP Report-Only by @rviscomi in #80
- Demo by URL in docs by @rviscomi in #84
- Better error handling for the URL demo by @rviscomi in #85
- Logging fix for demo URL by @rviscomi in #86
- Expanded extension docs by @rviscomi in #97
- Serialize origin trial expiration dates by @rviscomi in #98
- Fix attribute selector parsing by @rviscomi in #99
- Validate origin trial subdomains by @rviscomi in #100
- Link extension options page to extension docs by @rviscomi in #101
http-equivvalidators by @rviscomi in #102- Meta viewport validation by @rviscomi in #104
- Validate meta CSP directives by @rviscomi in #107
- Warn about viewport
shrink-to-fitdirective by @rviscomi in #108
New Contributors
Full Changelog: v1.4.4...v1.5.2
v1.4.4
v1.4.3
What's Changed
- Only check same origin for 1P OT by @rviscomi in #43
- Capo options by @rviscomi in #42
- [Docs] text-wrap:balance by @rviscomi in #47
- Capo modules by @rviscomi in #45
- Documentation by @rviscomi in #53
- package manager by @rviscomi in #54
- image paths by @rviscomi in #55
- more img fixes by @rviscomi in #56
- Escape attribute names by @rviscomi in #49
- Validation styles and docs by @rviscomi in #60
Full Changelog: v1.3.2...v1.4.3
v1.3.2
v1.3.0
v1.2.0
v1.1.1
What's Changed
- WebPageTest custom metric by @rviscomi in #1
- WPT docs by @rviscomi in #2
- @import support in WPT by @rviscomi in #4
- ct.css not ct.js by @stoyan in #3
- Update the READMEs by @rviscomi in #5
- Remove the image from source by @rviscomi in #6
- Mention bookmarklet generator by @kurtextrem in #7
- 🥣 BigQuery support by @rviscomi in #8
- Update README.md by @rviscomi in #10
- Output the sorted
<head>outerHTML by @rviscomi in #11 - Only consider external async/defer scripts by @rviscomi in #12
- Only ignore
async/deferfor sync scripts when thesrcattr is present by @rviscomi in #13 - Handle
modulepreloadby @rviscomi in #16 - <👤> Chrome extension 1.0.0 by @rviscomi in #21
- crx docs update by @rviscomi in #22
- Adjust the deferred scripts by @dgrammatiko in #14
- Treat base as META priority by @rviscomi in #20
- Warnings by @rviscomi in #27
- crx v1.1.1 by @rviscomi in #28
New Contributors
- @rviscomi made their first contribution in #1
- @stoyan made their first contribution in #3
- @kurtextrem made their first contribution in #7
- @dgrammatiko made their first contribution in #14
Full Changelog: https://github.com/rviscomi/capo.js/commits/v1.1.1