@cocreate/render 1.46.0 → 1.48.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/.github/workflows/automated.yml +23 -10
- package/.github/workflows/manual.yml +1 -2
- package/CHANGELOG.md +28 -0
- package/package.json +27 -16
- package/release.config.js +11 -3
- package/src/index.js +37 -37
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
name: Automated Workflow
|
|
2
|
+
|
|
2
3
|
on:
|
|
3
4
|
push:
|
|
4
5
|
branches:
|
|
5
6
|
- master
|
|
7
|
+
|
|
6
8
|
jobs:
|
|
7
9
|
about:
|
|
8
10
|
runs-on: ubuntu-latest
|
|
@@ -18,26 +20,37 @@ jobs:
|
|
|
18
20
|
with:
|
|
19
21
|
direction: overwrite-github
|
|
20
22
|
githubToken: "${{ secrets.GITHUB }}"
|
|
23
|
+
|
|
21
24
|
release:
|
|
22
25
|
runs-on: ubuntu-latest
|
|
23
26
|
steps:
|
|
24
27
|
- name: Checkout
|
|
25
28
|
uses: actions/checkout@v4
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0 # Required so semantic-release can trace git tags/history
|
|
31
|
+
|
|
26
32
|
- name: Setup Node.js
|
|
27
33
|
uses: actions/setup-node@v4
|
|
28
34
|
with:
|
|
29
|
-
node-version: 22
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@semantic-release/changelog
|
|
35
|
+
node-version: 22
|
|
36
|
+
|
|
37
|
+
- name: Install Semantic Release & Plugins
|
|
38
|
+
# Installs semantic-release and its plugins on the runner
|
|
39
|
+
run: |
|
|
40
|
+
npm install -g semantic-release \
|
|
41
|
+
@semantic-release/changelog \
|
|
42
|
+
@semantic-release/npm \
|
|
43
|
+
@semantic-release/github \
|
|
36
44
|
@semantic-release/git
|
|
37
|
-
|
|
45
|
+
|
|
46
|
+
- name: Run Semantic Release (Native)
|
|
47
|
+
id: semantic
|
|
48
|
+
# This will automatically pick up your export default config file in the repository root
|
|
49
|
+
run: npx semantic-release
|
|
38
50
|
env:
|
|
39
|
-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
51
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
40
52
|
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
|
|
53
|
+
|
|
41
54
|
outputs:
|
|
42
55
|
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
|
|
43
|
-
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
|
|
56
|
+
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# [1.48.0](https://github.com/CoCreate-app/CoCreate-render/compare/v1.47.0...v1.48.0) (2026-07-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* update automated workflow and release configuration for improved semantic release handling ([5187353](https://github.com/CoCreate-app/CoCreate-render/commit/5187353c5616f741130ff6e8ebe7922e46441f94))
|
|
7
|
+
|
|
8
|
+
# [1.47.0](https://github.com/CoCreate-app/CoCreate-render/compare/v1.46.1...v1.47.0) (2026-07-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump package versions ([242485d](https://github.com/CoCreate-app/CoCreate-render/commit/242485d149ff8501ebf4c0c4e66c795a48e86bde))
|
|
14
|
+
* removed post install and add add packages to apprved list ([9dbffc8](https://github.com/CoCreate-app/CoCreate-render/commit/9dbffc821831c8bf252c5b87fb36eb9bb47fa57f))
|
|
15
|
+
* semantic version handling ([60f46ed](https://github.com/CoCreate-app/CoCreate-render/commit/60f46ed5999aa25cf0e124e9198a061768a56662))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* proce ([862900a](https://github.com/CoCreate-app/CoCreate-render/commit/862900aa23af25961399428b5e1e369147b4354d))
|
|
21
|
+
|
|
22
|
+
## [1.46.1](https://github.com/CoCreate-app/CoCreate-render/compare/v1.46.0...v1.46.1) (2026-03-01)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* optimize data handling in render function to prevent unnecessary updates ([a6f7202](https://github.com/CoCreate-app/CoCreate-render/commit/a6f720282744f2e393e1921fea5bccceb466f617))
|
|
28
|
+
|
|
1
29
|
# [1.46.0](https://github.com/CoCreate-app/CoCreate-render/compare/v1.45.6...v1.46.0) (2026-03-01)
|
|
2
30
|
|
|
3
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/render",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.0",
|
|
4
4
|
"description": "A simple render component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"render",
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"start": "npx webpack --config webpack.config.js",
|
|
20
20
|
"build": "npx webpack --mode=production --config webpack.config.js",
|
|
21
|
-
"dev": "npx webpack --config webpack.config.js --watch"
|
|
22
|
-
"postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\""
|
|
21
|
+
"dev": "npx webpack --config webpack.config.js --watch"
|
|
23
22
|
},
|
|
24
23
|
"repository": {
|
|
25
24
|
"type": "git",
|
|
@@ -36,20 +35,32 @@
|
|
|
36
35
|
"url": "https://github.com/sponsors/CoCreate-app"
|
|
37
36
|
},
|
|
38
37
|
"main": "./src/index.js",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@cocreate/actions": "^1.21.4",
|
|
40
|
+
"@cocreate/api": "^1.22.5",
|
|
41
|
+
"@cocreate/element-prototype": "^1.31.4",
|
|
42
|
+
"@cocreate/observer": "^1.19.0",
|
|
43
|
+
"@cocreate/utils": "^1.42.2"
|
|
44
|
+
},
|
|
39
45
|
"devDependencies": {
|
|
40
|
-
"
|
|
41
|
-
"esbuild": "^0.25.2",
|
|
42
|
-
"esbuild-loader": "^4.3.0",
|
|
43
|
-
"mini-css-extract-plugin": "^1.5.0",
|
|
44
|
-
"webpack": "^5.24.4",
|
|
45
|
-
"webpack-cli": "^4.5.0",
|
|
46
|
-
"webpack-log": "^3.0.1"
|
|
46
|
+
"@cocreate/webpack": "^1.4.3"
|
|
47
47
|
},
|
|
48
|
-
"
|
|
49
|
-
"@cocreate/actions
|
|
50
|
-
"@cocreate/api
|
|
51
|
-
"@cocreate/
|
|
52
|
-
"@cocreate/
|
|
53
|
-
"@cocreate/
|
|
48
|
+
"allowScripts": {
|
|
49
|
+
"@cocreate/actions@1.21.4": true,
|
|
50
|
+
"@cocreate/api@1.22.5": true,
|
|
51
|
+
"@cocreate/config@1.13.4": true,
|
|
52
|
+
"@cocreate/crud-client@1.34.6": true,
|
|
53
|
+
"@cocreate/element-prototype@1.31.4": true,
|
|
54
|
+
"@cocreate/elements@1.42.9": true,
|
|
55
|
+
"@cocreate/filter@1.33.6": true,
|
|
56
|
+
"@cocreate/indexeddb@1.23.4": true,
|
|
57
|
+
"@cocreate/local-storage@1.16.5": true,
|
|
58
|
+
"@cocreate/observer@1.19.0": true,
|
|
59
|
+
"@cocreate/organizations@1.30.1": true,
|
|
60
|
+
"@cocreate/render@1.46.1": true,
|
|
61
|
+
"@cocreate/socket-client@1.40.5": true,
|
|
62
|
+
"@cocreate/utils@1.42.2": true,
|
|
63
|
+
"@cocreate/uuid@1.12.4": true,
|
|
64
|
+
"@cocreate/webpack@1.4.3": true
|
|
54
65
|
}
|
|
55
66
|
}
|
package/release.config.js
CHANGED
|
@@ -10,12 +10,20 @@ module.exports = {
|
|
|
10
10
|
changelogFile: "CHANGELOG.md",
|
|
11
11
|
},
|
|
12
12
|
],
|
|
13
|
-
"@semantic-release/npm",
|
|
14
|
-
"@semantic-release/github",
|
|
13
|
+
"@semantic-release/npm",
|
|
15
14
|
[
|
|
16
|
-
"@semantic-release/
|
|
15
|
+
"@semantic-release/github",
|
|
17
16
|
{
|
|
17
|
+
successComment: false,
|
|
18
|
+
failTitle: false,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"@semantic-release/git",
|
|
23
|
+
{
|
|
24
|
+
// Only stage and commit the changelog and package.json
|
|
18
25
|
assets: ["CHANGELOG.md", "package.json"],
|
|
26
|
+
message: "chore(release): ${nextRelease.version} [skip ci]",
|
|
19
27
|
},
|
|
20
28
|
],
|
|
21
29
|
],
|
package/src/index.js
CHANGED
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
getValueFromObject,
|
|
30
30
|
dotNotationToObject,
|
|
31
31
|
ObjectId,
|
|
32
|
-
safeParse,
|
|
33
32
|
processOperatorsAsync
|
|
34
33
|
} from "@cocreate/utils";
|
|
35
34
|
import "@cocreate/element-prototype";
|
|
@@ -164,24 +163,25 @@ async function render({
|
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
|
|
167
|
-
let sourceData = sources.get(source);
|
|
168
|
-
if (!sourceData) {
|
|
169
|
-
sourceData = { element: source, data: { ...data } };
|
|
170
|
-
sources.set(source, sourceData);
|
|
171
|
-
} else if (sourceData.data) {
|
|
172
|
-
sourceData.data = { ...data };
|
|
173
|
-
} else {
|
|
174
|
-
// TODO: Most effiecientway to comapre too objects or array of objects
|
|
175
|
-
if (data === sourceData.data) return;
|
|
176
|
-
sourceData.data = { ...data };
|
|
177
|
-
}
|
|
178
|
-
|
|
179
166
|
if (data.$filter) {
|
|
180
167
|
index = index || data.$filter.startingIndex || data.$filter.index;
|
|
181
168
|
update = update || data.$filter.update;
|
|
182
169
|
remove = remove || data.$filter.remove;
|
|
183
170
|
}
|
|
184
171
|
|
|
172
|
+
let isMutation = remove || update || (data.$filter && data.$filter.create);
|
|
173
|
+
|
|
174
|
+
let sourceData = sources.get(source);
|
|
175
|
+
if (!sourceData) {
|
|
176
|
+
sourceData = { element: source, data: { ...data } };
|
|
177
|
+
sources.set(source, sourceData);
|
|
178
|
+
} else if (!isMutation) {
|
|
179
|
+
// Only overwrite the master list if this is a full read, not a patch/mutation!
|
|
180
|
+
if (data !== sourceData.data) {
|
|
181
|
+
sourceData.data = { ...data };
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
185
|
if (
|
|
186
186
|
!Array.isArray(element) &&
|
|
187
187
|
!(element instanceof HTMLCollection) &&
|
|
@@ -241,7 +241,7 @@ async function render({
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
clone = clones.get(cloneKey);
|
|
244
|
-
if (!clone)
|
|
244
|
+
if (!clone) continue;
|
|
245
245
|
|
|
246
246
|
clones.delete(cloneKey);
|
|
247
247
|
renderedNodes.delete(clone);
|
|
@@ -261,7 +261,7 @@ async function render({
|
|
|
261
261
|
|
|
262
262
|
if (!currentIndex) currentIndex = data.$filter.currentIndex;
|
|
263
263
|
|
|
264
|
-
if (!clone)
|
|
264
|
+
if (!clone) continue;
|
|
265
265
|
|
|
266
266
|
await renderValues(clone, { object: data[key][j] });
|
|
267
267
|
if (currentIndex >= 0)
|
|
@@ -891,28 +891,28 @@ async function renderValue(
|
|
|
891
891
|
renderAs
|
|
892
892
|
);
|
|
893
893
|
|
|
894
|
-
// 4. EXPRESSION EVALUATOR: Handle Math and Ternary logic
|
|
895
|
-
if (value === undefined || value === null) {
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}
|
|
894
|
+
// // 4. EXPRESSION EVALUATOR: Handle Math and Ternary logic
|
|
895
|
+
// if (value === undefined || value === null) {
|
|
896
|
+
// const dataProxy = new Proxy(data || {}, {
|
|
897
|
+
// get(target, prop) {
|
|
898
|
+
// if (typeof prop !== "string") return target[prop];
|
|
899
|
+
// if (prop in target) return target[prop];
|
|
900
|
+
// return getRenderValue(node, data, prop, renderAs);
|
|
901
|
+
// },
|
|
902
|
+
// has(target, prop) {
|
|
903
|
+
// if (typeof prop !== "string") return prop in target;
|
|
904
|
+
// return true;
|
|
905
|
+
// }
|
|
906
|
+
// });
|
|
907
|
+
|
|
908
|
+
// const parsedValue = safeParse(preProcessed, dataProxy);
|
|
909
|
+
|
|
910
|
+
// if (parsedValue !== null) {
|
|
911
|
+
// value = parsedValue;
|
|
912
|
+
// } else if (preProcessed !== placeholderContent) {
|
|
913
|
+
// value = preProcessed;
|
|
914
|
+
// }
|
|
915
|
+
// }
|
|
916
916
|
}
|
|
917
917
|
} catch (error) {
|
|
918
918
|
console.error(error);
|