Skip to content

Commit 5917b81

Browse files
Updates & new features
1 parent 4dc1e67 commit 5917b81

File tree

1 file changed

+61
-24
lines changed

1 file changed

+61
-24
lines changed

CHANGELOG.md

+61-24
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
11
---
22
typora-root-url: docs/images
33
created: 2017-04-18 16:53:00
4-
updated: 2024-04-03 17:16:00
4+
updated: 2024-06-04 20:42:08
55
---
66

77
# Changelog
88

99
Please see the documentation for archived changelogs - a new archive is produced for each major version. Check the [roadmap](./docs/roadmap.md) for future developments.
1010

11-
## To Do
11+
## **NEW FEATURE** page metadata
12+
13+
Allows FE to get data about the current page. Mostly the file created and updated timestamps. But consider extending to allow other metadata to be defined - maybe via the instance package.json?
14+
15+
### `nodes/libs/fs.js`
16+
17+
* [x] Fn, `getFileMeta`. Returns at least created & updated timestamps and file size.
18+
19+
### `nodes/libs/socket.js`
20+
21+
* [x] Amend `listenFromClientCtrl`, listen for a control msg `get page meta`, calls `fs.getFileMeta`, sends the output to the FE using the same control msg. Does not output to uibuilder node port #2.
22+
23+
### FE library
24+
25+
* [x] Fn `getPageMeta` to call - sending a uibuilder control msg `get page meta`
26+
* [x] Fn to listen for a `get page meta` control msg and updating the uibuilder `pageMeta` managed variable
27+
* [ ] Consider adding a new web component, `<uib-meta type="created">` to display. `created`, `updated`, `crup` (both dates sensibly formatted)
28+
29+
## **NEW FEATURE** Create package.json template for Node-RED projects
30+
31+
[Reference](https://discourse.nodered.org/t/uibuilder-install-default-packages-when-creating-a-node-red-projects/88496/6?u=totallyinformation)
32+
33+
An optional template package.json in `<uibRoot>/.config/projectPackage.json` where the `dependencies` are pre-requisite modules for new Node-RED projects.
34+
35+
Initial thinking is that there will be a new but optional file in the <uibRoot>/.config/ folder, called something like projectPackage.json. It would be, I think a sub-set of a standard package.json A full package.json on 2nd thoughts so that it would be easy to copy/paste your current <uibRoot>/package.json. That will let you include a default version, description, etc if you wish along-side the dependencies.
36+
37+
I will attempt to also trap a new project create to run the install if I can. Otherwise, it will display a notification for the user to run that manually. Not certain whether Node-RED will have to be restarted, I will try to avoid that but it might not be possible. Will have to test.
38+
39+
## In progress
1240

1341
* [ ] [started] Change all calls to `$.get` into `$.ajax` and add beforeStart to add optional bearer token header
42+
43+
## To Do
44+
45+
1446
* [ ] Add Docsify external libraries to `/docs/.config` to allow true offline use of docs. Add new gulp process to update them, possibly pack them all.
1547
* [ ] Add instance descriptions to the index pages
1648
* Update examples:
@@ -26,8 +58,8 @@ Please see the documentation for archived changelogs - a new archive is produced
2658
* [ ] Document `.config/uibMiddleware.js`, also update `docs\how-to\server-side-views.md`.
2759
* [ ] Document a dashboard-like grid layout.
2860
* [ ] Document how to use `<instanceRoot>/routes/` properly. [Ref](https://totallyinformation.github.io/node-red-contrib-uibuilder/#/changelog?id=new-features)
61+
* [ ] Document new `round` and `getPageMeta` functions in FE library
2962
* [ ] Remove `writeJson` from package.mgt.js then remove `fs-extra` dependency
30-
* [ ] Remove execa from gulpfile.js & remove from dev deps
3163
* [ ] Add automatic `search` handler for all uibuilder endpoints - [Ref](https://developer.mozilla.org/en-US/docs/Web/API/Window/location#example_5_send_a_string_of_data_to_the_server_by_modifying_the_search_property)
3264
* [ ] New Node Idea: `uib-meta` - links to a uibuilder node and returns the instance metadata including URL's and folder locations and other settings. (e.g. use with [node-red-cleanup-filesystem](https://discourse.nodered.org/t/announce-node-red-cleanup-filesystem-request-for-testing/88135))
3365
* [ ] Move the loading of the Editor common CSS/JS to a plugin so they are only loaded once. Remove explicit links from node html files.
@@ -85,7 +117,7 @@ Please see the documentation for archived changelogs - a new archive is produced
85117

86118
### `<uib-var>` custom HTML component
87119

88-
* [ ] Amend to use same processors as the uib-attr process above
120+
* [ ] Amend to use same processors as the uib-attr
89121

90122
### `uib-cache` node
91123

@@ -123,18 +155,12 @@ Please see the documentation for archived changelogs - a new archive is produced
123155
### `uibuilder` node
124156

125157
* [ ] ?? Filter `clientId` and `pageName` using socket.io rooms?
126-
* [ ] On uibuilder Libraries tab:
127-
* [ ] Process for updating libraries updates EVERYTHING (runs `npm install`) - need to update docs?
128-
* [ ] Major version updates are not listed - because of package.json version spec - need to update docs?
158+
* [ ] On uibuilder Libraries tab: Major version updates are not listed - because of package.json version spec - need to update docs?
129159
* [ ] uibuilder.packages after an update does not contain the `outdated` prop for each package because the server only does a quick update and so does not call `npmOutdated` (from packge-mgt.js) on each package because it is async and quite slow. This may mean that update flags are not updated until the Editor is next reloaded which isn't ideal. Probably need to fix at some point.
130160

131161

132162
## Issues
133163

134-
* [ ] uibuilder library update
135-
* [x] Runs `npm install`. Run `npm update` with package name
136-
* [x] Running 1 update resets displays for all updatable packages
137-
138164
* [ ] uib-element editor panel
139165
* [ ] Heading 2nd drop-down needs to be narrower to account for 1st drop-down
140166
* [ ] uibuilder editor panel
@@ -183,11 +209,11 @@ Note that potentially breaking changes are only introduced in major version rele
183209

184210
Most of these changes will *not* impact most people but you should check through them just in case.
185211

186-
* If using uibuilder's custom ExpressJS server feature, **URL's are now case sensitive**
212+
* If using UIBUILDER's custom ExpressJS server feature (instead of the Node-RED built-in one), **URL's are now case sensitive**
187213

188214
This brings them into line not only with W3C guidance but also with the Socket.IO library. It can be turned off in `settings.js` using property `uibuilder.serverOptions['case sensitive routing']` set to false.
189215

190-
Note that when using Node-RED's internal ExpressJS web engine, URLs are still case-insensitive because that's how Node-RED has been configured.
216+
Note that when using Node-RED's internal ExpressJS web engine (the default), URLs are still case-insensitive because that's how core Node-RED has been configured.
191217

192218
* **Minimum node.js now v18** - in line with the release of Node-RED v4, the minimum node.js version has moved from v14 to v18.
193219

@@ -233,17 +259,25 @@ Most of these changes will *not* impact most people but you should check through
233259

234260
### 📌 Highlights
235261

262+
* Some tweaks to the documentation should make it a little easier to get started with.
263+
236264
* You can now add a `uib-topic="mytopic"` attribute to _ANY_ HTML element. Doing so makes that element responsive to messages from Node-RED.
237265

238266
For a message with the correct `msg.topic`. The `msg.payload` will replace the inner HTML of the element. `msg.attributes` will update corresponding element attributes. Making this now one of the easiest ways to define dynamic updates in your UI.
239267

268+
* The new node `uib-file-list` will produce a list of files from a uibuilder instance. It automatically adjusts to the currently served sub-folder and allows filtering. Use this for producing indexes and menus.
269+
270+
* The new built in `<uib-meta>` web component can be used in your HTML to display facts about the current page such as its file size, when it was created and when it was last updated.
271+
240272
* Lots of extensions and improvements to the `uibrouter` front-end routing library in this release:
241273

242274
* You can now define a set of external html files (that can include scripts and css just like routes) that are immediately loaded to the page. These can be defined in the initial router config when they will be loaded immediately (before routes) or can be manually loaded later. Use these for things like menu's or other fixed parts of the UI.
243275

244276
* You can now define route content as Markdown instead of HTML. This makes Notion/Obsidian-like applications feasible using UIBUILDER.
245277

246278
* You can now use Markdown-IT plugins to enhance your Markdown content.
279+
280+
* You can start with an empty routing list to allow dynamic creation of routes later on.
247281

248282
* Markdown improvements.
249283

@@ -255,16 +289,20 @@ Most of these changes will *not* impact most people but you should check through
255289

256290
* Wherever you can use no-/low-code features that accept HTML, you can now include `<script>` tags that will be executed on load.
257291

258-
* A new node is available. `uib-file-list` will produce a list of files from a uibuilder instance. It automatically adjusts to the currently served sub-folder and allows filtering. Use this for producing indexes and menus.
259-
260292
* Handling of forms and inputs continue to improve.
261293

262294
* Programmatic changes to input values or checked properties now trigger both the `input` and `changed` events - something that HTML normally doesn't do but can be important for data-driven web apps. For example, if using an `<output>` tag to show a combined or calculated input, changes via Node-RED will still update the values.
263295
* When using the `eventSend(event)` function on inputs whether inside or outside of a form, the returned values have been improved, especially for checkboxes and radio buttons.
264296

265297
* Security of the UIBUILDER repository on GitHub has been improved.
266298

267-
* On the `uibuilder` node's "Core" tab, the info buttons bar has changed slightly. The "Docs" button has gone (it is still on the top of panel bar anyway) and been replaced by a new "Apps" button which shows a page *listing ALL uibuilder node instances along with their descriptions where provided*.
299+
* On the `uibuilder` node's "Core" tab, the info buttons bar has changed slightly.
300+
301+
The "Docs" button has gone (it is still on the top of panel bar anyway) and been replaced by a new "Apps" button which shows a page *listing ALL uibuilder node instances along with their descriptions where provided*.
302+
303+
Most of the UIBUILDER nodes have be given a bit of a refresh of their Editor configuration panels. This work is ongoing but should give a more consistent look and feel and make the panels rather more responsive. The layouts are starting to use more modern CSS features. The work isn't complete yet so there are still a few inconsistencies - for example, when you make the panel wider - but we are getting there.
304+
305+
* For front-end developers, there are many new functions added to the `uibuilder` front-end library. Some are standard utility functions such as fast but accurate number rounding or conversion of primitives into objects. Others simplify the use of the DOM.
268306

269307
### General Changes
270308

@@ -335,17 +373,16 @@ The `URL Output?` setting will change the output from a folder/file list to a re
335373
>
336374
> Since they are attached to the HTML `Element` class, they cannot be used in `uib-html`.
337375
338-
* `hasUibRouter()` Returns true if a uibrouter instance is loaded, otherwise returns false. Note that, because the router will be loaded in a page script, it is not available until AFTER the uibuilder library has loaded and socket.io initialised.
339-
340-
* `returnElementId(el)` Returns the element's existing ID. Or, if not present, attempts to create a page unique id from the name attribute or the attribute type. The last 2 will use a page-unique number to enforce uniqueness.
341-
* `getElementClasses(el)` Checks for CSS Classes and return as array if found or undefined if not.
376+
* `arrayIntersect(a1, a2)` Returns a new array (which could be empty) of the intersection of the 2 input arrays.
342377
* `getElementAttributes(el)` Returns an object containing attribute-name/value keypairs (or an empty object).
378+
* `getElementClasses(el)` Checks for CSS Classes and return as array if found or undefined if not.
343379
* `getElementCustomProps(el)` Returns an object containing custom element properties/values (or an empty object). Custom element properties are those set using code that are not standard properties.
344380
* `getFormElementDetails(el)` Returns an object containing the key properties of a form element such as `value` and `checked`.
345-
346-
* `arrayIntersect(a1, a2)` Returns a new array (which could be empty) of the intersection of the 2 input arrays.
347-
* `makeMeAnObject(thing, property)` in your own code. It returns a valid JavaScript object if given a null or string as an input. `property` defaults to "payload" so that `uibuilder.makeMeAnObject("mystring")` will output `{payload: "mystring"}`.
348-
381+
* `getPageMeta()` Asks the server for the created/update timestamps and size (in bytes) of the current page. The result from the server is set into the managed `pageMeta` variable. Also used by the new `<uib-meta>` web component.
382+
* `hasUibRouter()` Returns true if a uibrouter instance is loaded, otherwise returns false. Note that, because the router will be loaded in a page script, it is not available until AFTER the uibuilder library has loaded and socket.io initialised.
383+
* `makeMeAnObject(thing, property)` returns a valid JavaScript object if given a null or string as an input. `property` defaults to "payload" so that `uibuilder.makeMeAnObject("mystring")` will output `{payload: "mystring"}`.
384+
* `returnElementId(el)` Returns the element's existing ID. Or, if not present, attempts to create a page unique id from the name attribute or the attribute type. The last 2 will use a page-unique number to enforce uniqueness.
385+
* `round(num, dp)` rounds a number to a set number of decimal places using a fast but accurate "commercial" format.
349386
* `urlJoin()` returns a string that joins all of the arguments with single `/` characters. The result will start with a leading `/` and end without one. If the arguments contain leading/trailing slashes, these are removed.
350387

351388
* Improved handling of stand-alone input changes in the `eventSend` function. Previously, these may not have sent their new values on change events.

0 commit comments

Comments
 (0)