sdc_client 0.158.9 → 0.159.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +21 -0
  3. package/dist/index.js +23 -13
  4. package/dist/ugly.index.js +2 -1
  5. package/dist/ugly.index.js.LICENSE.txt +1 -8
  6. package/gulp/gulp.jsx +11 -36
  7. package/package.json +22 -11
  8. package/src/index.js +27 -7
  9. package/src/simpleDomControl/AbstractSDC.js +15 -11
  10. package/src/simpleDomControl/sdc_controller.js +3 -3
  11. package/src/simpleDomControl/sdc_dom_events.js +5 -10
  12. package/src/simpleDomControl/sdc_events.js +3 -3
  13. package/src/simpleDomControl/sdc_main.js +34 -13
  14. package/src/simpleDomControl/sdc_model.js +209 -84
  15. package/src/simpleDomControl/sdc_params.js +0 -3
  16. package/src/simpleDomControl/sdc_server_call.js +21 -4
  17. package/src/simpleDomControl/sdc_test_utils.js +0 -1
  18. package/src/simpleDomControl/sdc_utils.js +59 -7
  19. package/src/simpleDomControl/sdc_view.js +16 -1
  20. package/.github/workflows/node.js.yml +0 -38
  21. package/.idea/inspectionProfiles/Project_Default.xml +0 -17
  22. package/.idea/jsLibraryMappings.xml +0 -6
  23. package/.idea/misc.xml +0 -6
  24. package/.idea/modules.xml +0 -8
  25. package/.idea/vcs.xml +0 -6
  26. package/.idea/workspace.xml +0 -403
  27. package/.readthedocs.yaml +0 -13
  28. package/.tool-versions +0 -1
  29. package/SimpleDomControlClient.iml +0 -12
  30. package/docs/api-reference.rst +0 -225
  31. package/docs/conf.py +0 -11
  32. package/docs/controllers.rst +0 -228
  33. package/docs/events-and-dom.rst +0 -120
  34. package/docs/getting-started.rst +0 -143
  35. package/docs/index.rst +0 -22
  36. package/docs/models.rst +0 -351
  37. package/docs/overview.rst +0 -66
  38. package/docs/requirements.txt +0 -1
  39. package/eslint.config.js +0 -43
  40. package/gulpfile.cjs +0 -30
  41. package/jest.config.mjs +0 -197
  42. package/test/controller.test.js +0 -93
  43. package/test/dist.test.js +0 -127
  44. package/test/model.test.js +0 -330
  45. package/test/models/Author.js +0 -145
  46. package/test/models/Book.js +0 -112
  47. package/test/models/BookContent.js +0 -114
  48. package/test/models/SdcUser.js +0 -75
  49. package/test/models/src.js +0 -8
  50. package/test/sdc_model_dates.ai.test.js +0 -57
  51. package/test/sdc_server_call.ai.test.js +0 -267
  52. package/test/utils.js +0 -88
  53. package/test/view.test.js +0 -159
  54. package/test-setup.js +0 -4
  55. package/webpack.config/webpack.default.config.cjs +0 -14
  56. package/webpack.config/webpack.development.config.cjs +0 -14
  57. package/webpack.config/webpack.production.config.cjs +0 -11
package/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ ## 0.159.0
4
+
5
+ ### Added
6
+ - `datetime-local` and `date` form inputs are synced with model `DateTimeField` / `DateField` values.
7
+ - `SdcQuerySet.create(data)` and `SdcModel.create(data)` accept the data object directly, in addition to `create({ elem, data })` / `create({ data })`.
8
+ - `test_utils.login(user)` / `test_utils.logout()` switch the `sessionid` cookie using the session ids in the global `SDC_TEST_USER`.
9
+
10
+ ### Changed (breaking)
11
+ - `DateField` and `DateTimeField` values are now `Date` objects instead of numeric timestamps. Empty or invalid values become `null`. Date-only strings (`YYYY-MM-DD`) are read as local dates.
12
+ - When a model is serialized, `DateField` values are sent as `YYYY-MM-DD` and `DateTimeField` values as ISO 8601 strings.
13
+ - `jquery` and `lodash` are now peer dependencies. They have always been used as the globals `$` and `_`. `bootstrap`, `@popperjs/core` and `esm` are no longer dependencies. Projects created with `sdc_init` already install all of them.
14
+ - `gulp` is now a peer dependency. The build helpers used by `sdc_client/gulp/gulp.jsx` (`gulp-sass`, `sass`, `gulp-exec`, `dotenv`, `through2`) are now regular dependencies.
15
+
16
+ ### Fixed
17
+ - `childController` / `iterateAllChildren()` are rebuilt correctly after `reload()`, `reconcile()` and
18
+ `<this.*>` renders (they were emptied), so `submit_model_form_success/error` reach child controllers.
19
+ - `app.get()` / `app.post()` follow `send_redirect()` responses (HTTP 301) instead of rejecting.
20
+ - `msg` / `header` in a server-call return value show a message over WebSocket as well as over HTTP.
21
+ - Reconcile moves `sdcDom` (JSX) `on*` listeners to the DOM node it keeps, so handlers are not stale.
22
+ - Calling `app.init_sdc()` again no longer re-creates the global controllers.
23
+ - `app.registerGlobal()` returns `{addMixin}` like `app.register()`.
24
+ - `getEvents()` no longer changes event maps shared between controller instances.
25
+ - `serverCall()` arguments that are not an object are passed as `arg0` (the check never worked);
26
+ the error for a `contentUrl` without `sdc_view/<app>` names the controller tag.
27
+ - Model form submit passes the create response to `submit_model_form_success` (was `undefined`).
28
+ - `SdcModel.querySet()` (static) uses the model name (typo `modeName`).
29
+ - `TextField`, `SlugField` and all integer field types (incl. `BigAutoField`) are converted and validated.
30
+ - `JSONField` accepts JSON strings; `FileField` size/type limits are enforced by `validate()` instead of
31
+ storing an error string as value.
32
+ - Deletes: querysets handle the new `on_delete` event (rows are removed; `onDelete`, falling back to
33
+ `onUpdate`, is called), and `delete()` removes the item locally.
34
+ - The automatic reconnect of a model socket repeats the `connect` handshake, so live updates continue.
35
+ - `setIds()` with a model or queryset works (was `DataCloneError`) and keeps models that are already in the
36
+ queryset, so references to related models stay valid.
37
+ - `listView()` responses fill the queryset like `load()`.
38
+ - `syncModelToForm()` fills create forms; `syncForm()` and live form edits no longer throw on invalid
39
+ values; edits in one form are shown in the other forms of the model.
40
+ - The develop watchers of `gulp/gulp.jsx` rebuild when files are added or deleted, not only changed.
41
+
42
+ ### Removed
43
+ - The build no longer injects `_on_init_params` into controllers, and `this.params` no longer requires an
44
+ `onInit()` method. `onInit()` is deprecated (it has not been called since 0.158.7).
45
+
46
+ ### Internal
47
+ - Added the MIT `LICENSE` file (the package was already declared MIT).
48
+ - `yarn lint:js` passes (the ESLint config declares the `$` / `_` globals and allows relative imports); CI
49
+ runs the linter and tests on Node 22 and 24.
50
+ - File uploads of models pass errors from reading the file on to the request (the async Promise executor
51
+ swallowed them).
52
+ - Switched to Yarn 4 with the `node-modules` linker.
53
+ - The published package contains only `dist/`, `src/`, `gulp/`, `README.md` and `CHANGELOG.md`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-2026 Martin Starman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the 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 shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.