andamiojs 0.0.0-stage → 1.0.0
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 +29 -0
- package/LICENSE.txt +23 -0
- package/README.md +67 -3
- package/andamiojs-logo.png +0 -0
- package/docs/api.md +151 -0
- package/docs/audit-summary.json +34 -0
- package/docs/review.md +129 -0
- package/lib/andamio.js +839 -0
- package/lib/andamio.map +1 -0
- package/lib/andamio.min.js +3 -0
- package/package.json +58 -4
- package/src/andamio.application.js +113 -0
- package/src/andamio.bindevents.js +38 -0
- package/src/andamio.collection.js +8 -0
- package/src/andamio.collectionview.js +206 -0
- package/src/andamio.core.js +39 -0
- package/src/andamio.itemview.js +58 -0
- package/src/andamio.model.js +58 -0
- package/src/andamio.region.js +94 -0
- package/src/andamio.router.js +60 -0
- package/src/andamio.utils.js +9 -0
- package/src/andamio.view.js +165 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0, 2026-10-08
|
|
4
|
+
|
|
5
|
+
The npm package name changes from `backbone.andamio` to `andamiojs`.
|
|
6
|
+
The project name remains Andamio.js. The browser namespace remains `Andamio`.
|
|
7
|
+
The browser bundles are `lib/andamio.js` and `lib/andamio.min.js`.
|
|
8
|
+
|
|
9
|
+
### Compatibility changes
|
|
10
|
+
|
|
11
|
+
- Require Backbone 1.6.1 or later in the 1.x series and Underscore 1.13.8 or later in the 1.x series.
|
|
12
|
+
- Support jQuery 3.7.1 and 4.0.0.
|
|
13
|
+
- Require Node `^22.22.2 || ^24.15.0 || >=26.0.0` for the development tools.
|
|
14
|
+
- Replace the Grunt tasks and incomplete app build template with npm scripts.
|
|
15
|
+
- Give child model defaults precedence over parent defaults.
|
|
16
|
+
- Evaluate computed properties in `get()` and `toJSON()`.
|
|
17
|
+
- Give the first matching route in the configured array priority.
|
|
18
|
+
- Make `remove()` close tracked child views.
|
|
19
|
+
- Report missing, ambiguous, and duplicate region targets as errors.
|
|
20
|
+
|
|
21
|
+
### Fixes and additions
|
|
22
|
+
|
|
23
|
+
- Fix CommonJS and AMD loading, data event rebinding, and shared view configuration cleanup.
|
|
24
|
+
- Fix collection insertion and sort order, failed-render cleanup, region reuse, and route aliases.
|
|
25
|
+
- Add application shutdown, history options, and empty redirect targets.
|
|
26
|
+
- Update dependencies and commit a dependency lockfile.
|
|
27
|
+
- Add 30 tests, CI, dependency update checks, API documentation, and a task sample app.
|
|
28
|
+
|
|
29
|
+
See the [project review](docs/review.md) for validation results and the full compatibility notes.
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Copyright (c) 2013 Denis Ciccale (@tdecs)
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any
|
|
4
|
+
person obtaining a copy of this software and associated
|
|
5
|
+
documentation files (the "Software"), to deal in the
|
|
6
|
+
Software without restriction, including without limitation
|
|
7
|
+
the rights to use, copy, modify, merge, publish,
|
|
8
|
+
distribute, sublicense, and/or sell copies of the
|
|
9
|
+
Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice
|
|
13
|
+
shall be included in all copies or substantial portions of
|
|
14
|
+
the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
17
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
18
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
19
|
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
20
|
+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
21
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
22
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
23
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Andamio.js
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
<img src="andamiojs-logo.png" width="400" height="67" alt="Andamio.js logo">
|
|
4
|
+
|
|
5
|
+
Andamio adds view lifecycle management, regions, collection views, and application routing to [Backbone.js](https://backbonejs.org/).
|
|
6
|
+
|
|
7
|
+
## Run the sample app
|
|
8
|
+
|
|
9
|
+
Use Node 22.22.2 or later in the 22.x series, Node 24.15.0 or later in the 24.x series, or Node 26 or later.
|
|
10
|
+
|
|
11
|
+
From a checkout of this repository, run:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm ci
|
|
15
|
+
npm run example
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Open [the local sample](http://127.0.0.1:3000). Add a task, mark it complete, and move between the Tasks and About pages.
|
|
19
|
+
Tasks stay in memory until you reload the page. The sample uses local dependencies and requires no external service.
|
|
20
|
+
To use another port, run `PORT=3001 npm run example`.
|
|
21
|
+
|
|
22
|
+
## Use the library
|
|
23
|
+
|
|
24
|
+
The package name is `andamiojs`. The browser namespace is `Andamio`.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
npm install andamiojs
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The supported peers are Backbone 1.6.1, Underscore 1.13.8, and jQuery 3.7.1 or 4.0.0.
|
|
31
|
+
|
|
32
|
+
For a browser app, load jQuery, Underscore, Backbone, and `lib/andamio.js` in that order.
|
|
33
|
+
The browser build exposes `Andamio` and `Backbone.Andamio`.
|
|
34
|
+
The minified build is `lib/andamio.min.js`.
|
|
35
|
+
|
|
36
|
+
For CommonJS, import the package and configure Backbone's DOM library before you create a view.
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
const Backbone = require('backbone');
|
|
40
|
+
const Andamio = require('andamiojs');
|
|
41
|
+
Backbone.$ = require('jquery');
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Models and collections work without a DOM. Views require a browser or a DOM environment.
|
|
45
|
+
AMD loaders resolve `underscore` and `backbone` before they run the Andamio factory.
|
|
46
|
+
See the [API reference](docs/api.md) for configuration and the [sample source](examples/todos/app.js) for a complete app.
|
|
47
|
+
|
|
48
|
+
## Check and build changes
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npm run check
|
|
52
|
+
npm audit
|
|
53
|
+
npm run build
|
|
54
|
+
npm pack --dry-run
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`npm run check` runs ESLint and the Node tests with coverage.
|
|
58
|
+
The tests use real Backbone, jQuery, and jsdom. They also load the sample over HTTP and exercise its task and route behavior.
|
|
59
|
+
`npm run build` generates the browser and CommonJS bundle, the minified bundle, and its source map in `lib/`.
|
|
60
|
+
Edit `src/` and rebuild the bundles. The old Grunt tasks and incomplete `build/` app template have been removed.
|
|
61
|
+
|
|
62
|
+
See the [project review](docs/review.md) for confirmed defects, security audit results, compatibility changes, and remaining work.
|
|
63
|
+
|
|
64
|
+
## Author and license
|
|
65
|
+
|
|
66
|
+
Denis Ciccale. Logo by Javier López.
|
|
67
|
+
|
|
68
|
+
[MIT license](LICENSE.txt).
|
|
Binary file
|
package/docs/api.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Andamio API reference
|
|
2
|
+
|
|
3
|
+
All view, model, collection, router, and application classes support Backbone's `extend` method.
|
|
4
|
+
`Andamio.$` reads and writes `Backbone.$`.
|
|
5
|
+
|
|
6
|
+
## Model and Collection
|
|
7
|
+
|
|
8
|
+
`Andamio.Model` extends `Backbone.Model`.
|
|
9
|
+
Its `defaults` include `ready: false`. Defaults merge across the prototype chain, with child values taking precedence.
|
|
10
|
+
The merge is shallow. A function-valued `defaults` runs with the model as `this`.
|
|
11
|
+
Model options are available as `model.options`.
|
|
12
|
+
|
|
13
|
+
`setReady()` sets the `ready` attribute to `true`.
|
|
14
|
+
`isReady()` returns `true` by default. A subclass can override it to use `this.get('ready')` or another readiness condition.
|
|
15
|
+
`load()` does nothing by default. A router calls it with the matched route parameters.
|
|
16
|
+
|
|
17
|
+
`computedProperties` maps names to functions or constant values.
|
|
18
|
+
A computed function runs with the attributes object as `this`.
|
|
19
|
+
`get(name)` evaluates the computed value. `toJSON()` includes the evaluated value.
|
|
20
|
+
Computed functions do not become attributes. They do not emit separate change events.
|
|
21
|
+
A computed name takes precedence over a stored attribute with the same name.
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
var Person = Andamio.Model.extend({
|
|
25
|
+
computedProperties: {
|
|
26
|
+
fullName: function () { return this.first + ' ' + this.last; }
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`Andamio.Collection` extends `Backbone.Collection`. Its model is `Andamio.Model`.
|
|
32
|
+
Its `load()` does nothing by default.
|
|
33
|
+
|
|
34
|
+
## View and ItemView
|
|
35
|
+
|
|
36
|
+
`Andamio.View` extends `Backbone.View`.
|
|
37
|
+
`close()` closes tracked subviews and region views, removes the element, and stops event listeners.
|
|
38
|
+
`remove()` performs the same cleanup. Repeated calls have no further effect.
|
|
39
|
+
`render()` restores declarative event handlers when a closed view reopens.
|
|
40
|
+
Custom render methods can call `Andamio.View.prototype.render.call(this)` to restore these handlers.
|
|
41
|
+
Custom listeners created in `initialize()` require their own setup when a view reopens.
|
|
42
|
+
|
|
43
|
+
`modelEvents` and `collectionEvents` map event names to handler method names or callback functions.
|
|
44
|
+
A string can contain several method names separated by spaces.
|
|
45
|
+
Either map can be a function that returns the map.
|
|
46
|
+
`delegateEvents()` replaces previous declarative bindings.
|
|
47
|
+
`undelegateEvents()` removes declarative DOM and data bindings.
|
|
48
|
+
|
|
49
|
+
`addSubview(key, view)` tracks a view instance or creates a view from a constructor.
|
|
50
|
+
Replacing a subview closes the previous view.
|
|
51
|
+
The `subviews` configuration can contain constructors or instances.
|
|
52
|
+
Each parent has its own configuration map. Instances supplied on a prototype still refer to the same view, so use constructors for independent subviews.
|
|
53
|
+
Subview factories create new instances when a closed parent renders again.
|
|
54
|
+
Existing instances can render again if their lifecycle supports reuse.
|
|
55
|
+
|
|
56
|
+
`Andamio.ItemView` adds template rendering.
|
|
57
|
+
`template` is a function that receives serialized data and returns HTML.
|
|
58
|
+
The model supplies data when present. Otherwise, a collection supplies `{items: collection.toJSON()}`.
|
|
59
|
+
A view with neither supplies `{}`.
|
|
60
|
+
`serializeData()` can override this behavior.
|
|
61
|
+
|
|
62
|
+
`render()` renders the template, creates configured subviews, binds regions, resolves UI selectors, and calls `afterRender()`.
|
|
63
|
+
Rendering again closes views in the previous regions before it replaces the HTML.
|
|
64
|
+
`ui` maps names to selectors. After render, each value is a jQuery object scoped to the view.
|
|
65
|
+
Closing the view restores the selectors.
|
|
66
|
+
Each descendant with a `data-region` attribute creates an entry in `view.regions` with that attribute's name.
|
|
67
|
+
Region names must be unique within a view.
|
|
68
|
+
|
|
69
|
+
A prototype `model` or `collection` constructor creates an instance during view construction.
|
|
70
|
+
A `collectionView` constructor creates a tracked subview named `collectionView` when the item view has a collection.
|
|
71
|
+
The item view passes that collection to the subview. The parent places the subview through a region or its own rendering code.
|
|
72
|
+
|
|
73
|
+
## CollectionView
|
|
74
|
+
|
|
75
|
+
`Andamio.CollectionView` extends `Andamio.View`.
|
|
76
|
+
`itemView` is the constructor for each model's child view.
|
|
77
|
+
`itemViewOptions` is an options object or a function of the model and its index.
|
|
78
|
+
The child receives the model plus these options.
|
|
79
|
+
`children` contains child views in collection order.
|
|
80
|
+
|
|
81
|
+
The view responds to collection `add`, `remove`, `reset`, and `sort` events.
|
|
82
|
+
A full render closes existing children and builds new children in a document fragment.
|
|
83
|
+
Rendering calls `afterRender()` when defined.
|
|
84
|
+
`isEmpty()` returns `true` when the collection is absent or empty.
|
|
85
|
+
`closeChildren()` closes and removes all child views.
|
|
86
|
+
|
|
87
|
+
`buildItemView`, `renderItemView`, `appendHtml`, and `appendBuffer` provide rendering extension points.
|
|
88
|
+
Custom `appendHtml` methods receive the collection view, child view, and index.
|
|
89
|
+
Custom methods must support the buffering state during full renders.
|
|
90
|
+
|
|
91
|
+
## Region
|
|
92
|
+
|
|
93
|
+
A region accepts an `el` name, a DOM element, or a `$el` jQuery object.
|
|
94
|
+
An `el` string matches a `data-region` value. It is not a CSS selector.
|
|
95
|
+
A region must resolve to exactly one element.
|
|
96
|
+
|
|
97
|
+
`show(view)` renders and inserts the view. It closes the previous view when the view changes.
|
|
98
|
+
It emits `show` with the view, then calls `onShow(view)` when defined.
|
|
99
|
+
`currentView` contains the shown view before these notifications.
|
|
100
|
+
`close()` closes or removes the current view and clears `currentView`.
|
|
101
|
+
It calls `onClose()` when defined.
|
|
102
|
+
`reset()` closes the view and clears the cached DOM lookup.
|
|
103
|
+
Regions mix in `Backbone.Events`. `stopListening()` releases listeners that the region created.
|
|
104
|
+
|
|
105
|
+
## Router
|
|
106
|
+
|
|
107
|
+
`Andamio.Router` extends `Backbone.Router` with an array of route objects.
|
|
108
|
+
Each route has `url` and either `view` or `redirectTo`.
|
|
109
|
+
`url` is a Backbone route pattern or an array of patterns.
|
|
110
|
+
`name` is optional. The first declared matching route has priority.
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
var Router = Andamio.Router.extend({
|
|
114
|
+
routes: [
|
|
115
|
+
{url: 'tasks/:id', name: 'task', view: TaskView},
|
|
116
|
+
{url: '', name: 'home', view: HomeView},
|
|
117
|
+
{url: '*path', redirectTo: ''}
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
A match creates a new view, then calls its model's `load()` or its collection's `load()`.
|
|
123
|
+
The model takes precedence when both are present.
|
|
124
|
+
The data object also receives `urlParams`.
|
|
125
|
+
Backbone supplies decoded path parameters and a final query-string argument.
|
|
126
|
+
Loading is synchronous from the router's perspective. A returned promise does not delay navigation.
|
|
127
|
+
Apps handle loading indicators, errors, and cancellation in their own models and views.
|
|
128
|
+
|
|
129
|
+
The router emits `navigate(view, url, urlParams)` with the matched pattern.
|
|
130
|
+
A redirect uses `trigger: true` and `replace: true`. An empty redirect target is valid.
|
|
131
|
+
`close()` removes this router's history handlers and stops its listeners.
|
|
132
|
+
Closing a router does not stop Backbone's shared history.
|
|
133
|
+
|
|
134
|
+
## Application
|
|
135
|
+
|
|
136
|
+
`new Andamio.Application(options)` copies configuration and creates `vent`, a Backbone event emitter.
|
|
137
|
+
The default `container` is the `main` selector. The default page region `el` is `page`.
|
|
138
|
+
|
|
139
|
+
`start({appView, router})` accepts constructors or instances.
|
|
140
|
+
It renders the app view in the container, connects router navigation to the page region, and starts Backbone history.
|
|
141
|
+
`historyOptions` supplies Backbone history options.
|
|
142
|
+
If the fragment is empty, a route with `default: true` supplies the initial URL.
|
|
143
|
+
For URL aliases, the first alias is the default URL.
|
|
144
|
+
`initialize()` runs after this startup sequence.
|
|
145
|
+
`start()` without options calls only `initialize()`.
|
|
146
|
+
|
|
147
|
+
`vent` emits `navigate` with the shown page view.
|
|
148
|
+
`stop()` closes the page region and app view, closes an Andamio router, stops history, and releases application listeners.
|
|
149
|
+
A plain Backbone router supplies no `close()` method, so its history handlers remain its owner's responsibility.
|
|
150
|
+
Only one Backbone history can run at a time.
|
|
151
|
+
Starting an app router while history is active throws before it replaces the app view.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"date": "2026-10-08",
|
|
3
|
+
"baselineCommit": "97546c0",
|
|
4
|
+
"before": {
|
|
5
|
+
"root": {
|
|
6
|
+
"info": 0,
|
|
7
|
+
"low": 1,
|
|
8
|
+
"moderate": 2,
|
|
9
|
+
"high": 13,
|
|
10
|
+
"critical": 6,
|
|
11
|
+
"total": 22
|
|
12
|
+
},
|
|
13
|
+
"build": {
|
|
14
|
+
"info": 0,
|
|
15
|
+
"low": 2,
|
|
16
|
+
"moderate": 3,
|
|
17
|
+
"high": 23,
|
|
18
|
+
"critical": 7,
|
|
19
|
+
"total": 35
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"after": {
|
|
23
|
+
"info": 0,
|
|
24
|
+
"low": 0,
|
|
25
|
+
"moderate": 0,
|
|
26
|
+
"high": 0,
|
|
27
|
+
"critical": 0,
|
|
28
|
+
"total": 0
|
|
29
|
+
},
|
|
30
|
+
"commands": [
|
|
31
|
+
"npm install --package-lock-only --ignore-scripts",
|
|
32
|
+
"npm audit --json"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/docs/review.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Project review, 8 October 2026
|
|
2
|
+
|
|
3
|
+
This review covers every source module, the generated library, both original package manifests, the Grunt tasks, and the README.
|
|
4
|
+
The starting commit was `97546c0`. The working tree was clean.
|
|
5
|
+
The project had no tests, no dependency lockfile, no package entry point, and no completed API documentation.
|
|
6
|
+
|
|
7
|
+
## Confirmed defects and fixes
|
|
8
|
+
|
|
9
|
+
| Area | Original behavior | Change |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| Module loading | The outer factory used `_` and `Backbone` before CommonJS or AMD resolved them. Requiring the package also had no `main` entry. | Resolve dependencies before initialization. Add the package entry. Test browser, CommonJS, AMD, and minified loading. |
|
|
12
|
+
| DOM library | Source modules referenced a global `$` even when Backbone had its own DOM library. `Andamio.$` was a stale copy. | Use `Andamio.$`, which reads and writes `Backbone.$`. |
|
|
13
|
+
| Model defaults | Construction mutated prototype defaults. Parent defaults overwrote child values. Function-valued defaults were not merged correctly. | Merge defaults into a fresh instance object. Child values take precedence. |
|
|
14
|
+
| Computed properties | Functions became raw attributes and remained functions in serialized data. | Evaluate computed values in `get()` and `toJSON()`. Use current attributes as the callback context. |
|
|
15
|
+
| Data event bindings | Repeated `delegateEvents()` calls added duplicate listeners. Function-valued event maps were unsupported. | Store the actual callbacks and replace previous bindings. Validate handlers before binding. |
|
|
16
|
+
| Event removal | A missing handler could call `stopListening` with an undefined callback and remove unrelated listeners. | Skip unresolved handlers during unbinding. |
|
|
17
|
+
| Shared view configuration | Cleanup deleted keys from shared UI and subview maps. Later instances lost their configuration. | Keep instance maps and restore selectors without mutating shared configuration. |
|
|
18
|
+
| Subviews and regions | Late subviews could disappear on rerender. Replacing a subview did not close it. Region views survived replacement of their HTML. | Track additions, close replaced subviews, and close previous region views before rerender. |
|
|
19
|
+
| View removal | Backbone's `remove()` bypassed Andamio child cleanup. Closed views lost declarative handlers on reuse. | Make `remove()` perform lifecycle cleanup. Restore declarative handlers when render reopens a view. |
|
|
20
|
+
| Collection order | Insertion at index zero appended the view at the end. Sort events did not update the DOM. | Keep children and DOM in collection order. Render after sort. |
|
|
21
|
+
| Collection render failure | A child template exception left buffering active and retained child views. | Close partial children and reset the buffer before propagating the error. |
|
|
22
|
+
| Region lifecycle | `onShow` omitted the view argument. Showing an already closed current view could leave its element detached. `close()` retained an externally closed view. | Pass the view, reattach it when required, and clear stale references. |
|
|
23
|
+
| Region lookup | Missing or multiple targets failed silently. Region names became CSS selector text. Duplicate names overwrote regions. | Require one target, compare names literally, and reject duplicate names in a view. |
|
|
24
|
+
| Route matching | Later generic routes could override earlier specific routes. Aliases reported the first alias instead of the matched pattern. Empty redirect targets were ignored. | Preserve declaration priority, use a callback per alias, and accept empty redirects. |
|
|
25
|
+
| Application lifecycle | `start()` without arguments failed. Default alias arrays passed directly to navigation. There was no shutdown method. | Accept omitted options, choose the first default alias, support history options, and add `stop()`. |
|
|
26
|
+
| Build template | The separate CoffeeScript build referenced missing app files and an undefined `tplmin` task. | Replace it with a runnable task sample and a small HTTP server. |
|
|
27
|
+
|
|
28
|
+
Three defects were reproduced directly against the original generated build with current Backbone and jQuery.
|
|
29
|
+
A child default of `child` became `parent`.
|
|
30
|
+
One change event called its handler three times after two explicit delegations.
|
|
31
|
+
Inserting `A` before `B` produced DOM text `BA`.
|
|
32
|
+
|
|
33
|
+
## Dependency and security results
|
|
34
|
+
|
|
35
|
+
The initial audits used `npm install --package-lock-only --ignore-scripts`, followed by `npm audit --json`, in each original package directory.
|
|
36
|
+
The audit counts include vulnerable packages reached through other dependencies. The two original graphs overlap, so their counts must not be added.
|
|
37
|
+
|
|
38
|
+
| Dependency graph | Low | Moderate | High | Critical | Total |
|
|
39
|
+
| --- | ---: | ---: | ---: | ---: | ---: |
|
|
40
|
+
| Original library build | 1 | 2 | 13 | 6 | 22 |
|
|
41
|
+
| Original app build template | 2 | 3 | 23 | 7 | 35 |
|
|
42
|
+
| Updated locked project | 0 | 0 | 0 | 0 | 0 |
|
|
43
|
+
|
|
44
|
+
The original vulnerable paths included Grunt, JSHint, UglifyJS, Lodash, Underscore, and old filesystem and HTTP utilities.
|
|
45
|
+
The update removes the obsolete Grunt dependency graphs instead of overriding their transitive packages.
|
|
46
|
+
The new build uses Node filesystem APIs and Terser.
|
|
47
|
+
The project has a committed lockfile, ESLint, CI, and Dependabot configuration for npm and GitHub Actions.
|
|
48
|
+
The CI actions use verified release commit hashes.
|
|
49
|
+
|
|
50
|
+
The development dependencies were checked against the npm registry's stable `latest` tags on the review date.
|
|
51
|
+
|
|
52
|
+
| Dependency | Version |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| Backbone | 1.6.1 |
|
|
55
|
+
| Underscore | 1.13.8 |
|
|
56
|
+
| jQuery | 4.0.0 |
|
|
57
|
+
| jsdom | 30.1.2 |
|
|
58
|
+
| Terser | 5.51.2 |
|
|
59
|
+
| ESLint | 10.12.0 |
|
|
60
|
+
| @eslint/js | 10.0.1 |
|
|
61
|
+
| globals | 17.13.0 |
|
|
62
|
+
|
|
63
|
+
Peer dependency ranges require current Backbone and Underscore. jQuery 3.7.1 remains supported alongside jQuery 4.
|
|
64
|
+
The [jQuery 4 release notes](https://blog.jquery.com/2026/01/17/jquery-4-0-0/) describe its compatibility changes.
|
|
65
|
+
The [Backbone reference](https://backbonejs.org/) defines the upstream model, router, history, and view contracts.
|
|
66
|
+
A zero audit result means that npm reported no known advisories for this locked graph at the review time.
|
|
67
|
+
It does not establish that application templates, remote data, or host app code are safe.
|
|
68
|
+
|
|
69
|
+
## Validation
|
|
70
|
+
|
|
71
|
+
`npm run check` runs ESLint and 30 tests with Node coverage.
|
|
72
|
+
The library bundle has approximately 96% line coverage and 91% branch coverage.
|
|
73
|
+
The combined report includes the development server and has approximately 95% line coverage.
|
|
74
|
+
VM-based browser and AMD checks execute both readable and minified bundles.
|
|
75
|
+
The coverage tool does not attribute those VM executions to the readable bundle, so some loader lines appear uncovered.
|
|
76
|
+
|
|
77
|
+
All 30 tests passed in each local compatibility combination.
|
|
78
|
+
|
|
79
|
+
| Node version | jQuery 3.7.1 | jQuery 4.0.0 |
|
|
80
|
+
| --- | --- | --- |
|
|
81
|
+
| 22.23.3 | Passed | Passed |
|
|
82
|
+
| 24.21.0 | Passed | Passed |
|
|
83
|
+
| 26.11.1 | Passed | Passed |
|
|
84
|
+
|
|
85
|
+
These runtimes were installed in temporary directories. The user's global Node installation was not changed.
|
|
86
|
+
The initial review used local validation. The release also requires the GitHub CI matrix to pass.
|
|
87
|
+
|
|
88
|
+
The tests cover module loading, default inheritance, computed data, template escaping, data and DOM events, view reuse, subview cleanup, regions, collection order, render failures, route parameters, redirects, and application shutdown.
|
|
89
|
+
The sample integration test serves actual dependencies over HTTP.
|
|
90
|
+
It adds a task containing HTML, checks that the HTML remains text, completes a task, navigates away and back, removes a task, and follows an unknown route.
|
|
91
|
+
|
|
92
|
+
The sample also passed a manual check in the Codex browser.
|
|
93
|
+
Task creation and completion updated the visible count.
|
|
94
|
+
Navigation preserved task state. The browser reported no warning or error messages.
|
|
95
|
+
`npm pack --dry-run` checks the package file list.
|
|
96
|
+
The build has no date-dependent banner and produces deterministic outputs.
|
|
97
|
+
CI checks that a rebuild leaves the committed bundles unchanged.
|
|
98
|
+
|
|
99
|
+
## Compatibility changes before a release
|
|
100
|
+
|
|
101
|
+
This release uses the package name `andamiojs` and version `1.0.0`.
|
|
102
|
+
Version `1.0.0` starts the release history for the new npm package name.
|
|
103
|
+
The repository retains its historical `1.2.8` Git tag.
|
|
104
|
+
The compatibility notes below describe changes from that historical code.
|
|
105
|
+
The package name replaces `backbone.andamio`. Browser bundles now use `lib/andamio.js`, `lib/andamio.min.js`, and `lib/andamio.map`.
|
|
106
|
+
|
|
107
|
+
- The development tools require Node `^22.22.2 || ^24.15.0 || >=26.0.0`. `.nvmrc` selects the current Node 24 release.
|
|
108
|
+
- Older Backbone and Underscore versions are outside the declared peer ranges.
|
|
109
|
+
- The Grunt entry points and the incomplete `build/` template are removed. The npm scripts replace them.
|
|
110
|
+
- Child defaults now override parent defaults.
|
|
111
|
+
- Computed properties return values and do not appear as raw functions in `attributes`.
|
|
112
|
+
- The first matching route in the array wins. Place specific routes before catch-all routes.
|
|
113
|
+
- Missing, ambiguous, or duplicate regions now throw descriptive errors.
|
|
114
|
+
- `remove()` closes child views. Code that intentionally detached a live view with `remove()` needs a different operation.
|
|
115
|
+
- Custom listeners created in `initialize()` are not recreated automatically when a closed view reopens.
|
|
116
|
+
|
|
117
|
+
## Remaining opportunities
|
|
118
|
+
|
|
119
|
+
These items need an API or product decision. They are not hidden test failures.
|
|
120
|
+
|
|
121
|
+
1. Add a network sample for asynchronous `load()`. The router currently navigates immediately and does not await a promise. Cover failed fetches, late responses after navigation, and cancellation before defining a framework policy.
|
|
122
|
+
2. Add browser CI for navigation focus, keyboard interaction, and narrow viewports. The current DOM integration test does not verify layout or every browser's event behavior.
|
|
123
|
+
3. Add a persistent sample if the project needs to teach storage or server integration. The task sample deliberately stores data in memory.
|
|
124
|
+
4. Consider an ESM entry and TypeScript declarations when there is a consuming app. The current package uses a CommonJS entry plus browser and AMD builds.
|
|
125
|
+
5. Define whether computed values need their own change events and whether `isReady()` should use the `ready` attribute. Existing readiness behavior remains available for subclasses to override.
|
|
126
|
+
6. Expand collection rendering tests before adding empty views, filtered lists, or nested collection containers. The current implementation rebuilds children on sort and reset.
|
|
127
|
+
7. Decide whether routers should support instance reuse after `close()` and cleanup of manually registered routes. Current cleanup tracks routes from the configured array.
|
|
128
|
+
|
|
129
|
+
Before publication, review these compatibility changes and run the consuming app against the new build.
|