spyne 0.16.2 → 0.18.2

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 (82) hide show
  1. package/.travis.yml +1 -1
  2. package/README.md +0 -60
  3. package/karma.conf.js +18 -69
  4. package/lib/spyne.js +29755 -28678
  5. package/lib/spyne.min.js +1 -1
  6. package/lib/spyne.min.js.LICENSE.txt +9 -9
  7. package/package.json +21 -42
  8. package/src/spyne/channels/channel-fetch-class.js +25 -5
  9. package/src/spyne/channels/channel-payload-class.js +36 -23
  10. package/src/spyne/channels/channel-proxy.js +7 -5
  11. package/src/spyne/channels/channel.js +54 -28
  12. package/src/spyne/channels/channels-config.js +2 -4
  13. package/src/spyne/channels/{channels-delegator.js → channels-map.js} +24 -40
  14. package/src/spyne/channels/spyne-channel-lifecycle.js +1 -2
  15. package/src/spyne/channels/spyne-channel-route.js +21 -62
  16. package/src/spyne/channels/spyne-channel-ui.js +1 -2
  17. package/src/spyne/channels/spyne-channel-window.js +24 -35
  18. package/src/spyne/spyne-app.js +165 -0
  19. package/src/spyne/spyne-plugins.js +39 -41
  20. package/src/spyne/spyne.js +6 -158
  21. package/src/spyne/utils/channel-config-validator.js +0 -1
  22. package/src/spyne/utils/channel-fetch-util.js +1 -2
  23. package/src/spyne/utils/channel-payload-filter.js +9 -76
  24. package/src/spyne/utils/frp-tools.js +21 -1
  25. package/src/spyne/utils/gc.js +1 -1
  26. package/src/spyne/utils/route-channel-updater.js +0 -4
  27. package/src/spyne/utils/spyne-app-properties.js +183 -0
  28. package/src/spyne/utils/spyne-logger.js +18 -0
  29. package/src/spyne/utils/spyne-plugins-methods.js +97 -0
  30. package/src/spyne/utils/spyne-trait.js +2 -5
  31. package/src/spyne/utils/spyne-utils-channel-route-url.js +3 -8
  32. package/src/spyne/utils/spyne-utils-channel-route.js +6 -14
  33. package/src/spyne/utils/spyne-utils-channel-window.js +1 -3
  34. package/src/spyne/utils/viewstream-observables.js +2 -3
  35. package/src/spyne/views/dom-element-template.js +2 -7
  36. package/src/spyne/views/dom-element.js +0 -19
  37. package/src/spyne/views/view-stream-broadcaster.js +5 -10
  38. package/src/spyne/views/view-stream-element.js +1 -18
  39. package/src/spyne/views/view-stream-payload.js +31 -37
  40. package/src/spyne/views/view-stream-selector.js +3 -8
  41. package/src/spyne/views/view-stream.js +281 -297
  42. package/src/tests/channels/channel-fetch.test.js +102 -0
  43. package/src/tests/channels/channel-payload-class.test.js +14 -5
  44. package/src/tests/channels/channel-payload-filter.test.js +3 -28
  45. package/src/tests/channels/channel.test.js +38 -0
  46. package/src/tests/index.js +0 -1
  47. package/src/tests/index.test.js +6 -0
  48. package/src/tests/spyne-app.test.js +27 -0
  49. package/src/tests/spyne-plugin.test.js +13 -9
  50. package/src/tests/utils/plugins-methods.test.js +103 -0
  51. package/src/tests/utils/spyne-app-properties.test.js +11 -0
  52. package/webpack.config.js +19 -34
  53. package/lib/channel-action-filter.test.3516417154.js +0 -20
  54. package/lib/channel-dom.test.104366832.js +0 -20
  55. package/lib/channel-fetch-util.test.3506167575.js +0 -20
  56. package/lib/channel-payload-class.test.1081032524.js +0 -20
  57. package/lib/channel-payload-filter.test.977308429.js +0 -20
  58. package/lib/channel-route.test.3513636042.js +0 -20
  59. package/lib/channel-stream-item.test.119388071.js +0 -20
  60. package/lib/channel-ui.test.3778619579.js +0 -20
  61. package/lib/channel-util-dom.test.908537750.js +0 -20
  62. package/lib/commons.js +0 -49274
  63. package/lib/dom-el-selectors.test.1268485916.js +0 -20
  64. package/lib/dom-el-template.test.842696987.js +0 -20
  65. package/lib/dom-el.test.2045076905.js +0 -20
  66. package/lib/frp-tools.test.2503042868.js +0 -20
  67. package/lib/import.test.2658619365.js +0 -20
  68. package/lib/index.test.2372977745.js +0 -20
  69. package/lib/route-utils.test.273346057.js +0 -20
  70. package/lib/runtime.js +0 -172
  71. package/lib/spyne-plugin.test.301647328.js +0 -20
  72. package/lib/spyne.js.map +0 -1
  73. package/lib/url-utils.test.1931189114.js +0 -20
  74. package/lib/view-stream-broadcaster.test.1306675435.js +0 -20
  75. package/lib/view-stream-enhancer-loader.test.3617829096.js +0 -20
  76. package/lib/view-stream-enhancer.test.1053738169.js +0 -20
  77. package/lib/view-stream.test.573231784.js +0 -20
  78. package/src/spyne/channels/lifestream-payload.js +0 -56
  79. package/src/spyne/utils/channel-data-packet-generator.js +0 -200
  80. package/src/spyne/utils/channel-data-packet.js +0 -59
  81. package/src/spyne/utils/viewstream-dom-utils.js +0 -51
  82. package/src/spyne/views/view-stream-enhancer-loader.js +0 -70
package/.travis.yml CHANGED
@@ -3,7 +3,7 @@ cache:
3
3
  directories:
4
4
  - ~/.npm
5
5
  services:
6
- - xvfb
6
+ - xvfb
7
7
  notifications:
8
8
  email: false
9
9
  node_js:
package/README.md CHANGED
@@ -15,8 +15,6 @@ Spyne is a full-featured, Javascript framework that reactively renders to the Re
15
15
  * Two dependencies, [RxJs](https://rxjs-dev.firebaseapp.com) and [ramda](https://ramdajs.com)
16
16
 
17
17
 
18
-
19
-
20
18
  ## Getting Started ##
21
19
  **View Documentation**<br/>
22
20
  https://spynejs.org
@@ -25,64 +23,6 @@ https://spynejs.org
25
23
  ```
26
24
  npm install spyne
27
25
  ```
28
- **Hello World**<br>
29
- [Edit in codepen](https://codepen.io/nybatista/pen/Pvvweb)
30
- ```
31
- // INIT SPYNE APP
32
- const spyneApp = new spyne.SpyneApp({debug:true});
33
-
34
- // PROPERTIES
35
- const channelName = 'CHANNEL_HELLO_WORLD';
36
- const channelAction = 'CHANNEL_HELLO_WORLD_DEFAULT_EVENT';
37
- const channelConfig = {sendCachedPayload:true};
38
- const channelPayload = {text: "Hello World!"}
39
-
40
- // CHANNEL INIT
41
- let helloWorld$ = new spyne.Channel(channelName, channelConfig);
42
- // REGISTER ACTION
43
- helloWorld$.addRegisteredActions = ()=>[channelAction];
44
- // REGISTER CHANNEL
45
- spyneApp.registerChannel(helloWorld$)
46
- // SEND CHANNEL PAYLOAD
47
- helloWorld$.sendChannelPayload(channelAction, channelPayload);
48
-
49
- // VIEWSTREAM
50
- class App extends spyne.ViewStream {
51
- constructor() {
52
- super();
53
- }
54
- addActionListeners() {
55
- return [
56
- [channelAction, 'onHelloWorld'],
57
- ];
58
- }
59
- onHelloWorld(e){
60
- this.props.el.innerText = e.props().text;
61
- }
62
- onRendered() {
63
- this.addChannel(channelName);
64
- }
65
-
66
- }
67
-
68
- new App().appendToDom(document.body);
69
-
70
-
71
-
72
- ```
73
- **Download or Fork Example App** (Tutorial to be added soon)<br/>
74
- https://github.com/spynejs/spyne-example-app <br>
75
-
76
- **Todos Example**<br/>
77
- https://todos.spynejs.org</br>
78
-
79
- ### Feedback
80
- Spyne was just released as an open source project in May, 2019, and any feedback would be greatly appreciated!<br>
81
- To suggest a feature or report a bug: https://github.com/spynejs/spyne/issues
82
-
83
- [<img src="https://bstacksupport.zendesk.com/attachments/token/PhEt6nTTBau6HVpyq3IJsmUIG/?name=browserstack-logo-600x315.png" title="BrowsersStack.com Logo" height="100">](https://browserstack.com)<br>
84
- BrowserStack.com supports open source projects like Spyne.js<br>
85
- Unit and Integration tests will run on real browsers and devices using BrowserStack's Automate system.<br><br>
86
26
 
87
27
 
88
28
  Copyright (c) 2017-Present Frank Batista, Relevant Context LLC
package/karma.conf.js CHANGED
@@ -1,14 +1,11 @@
1
- // Karma configuration
2
- // Generated on Fri Mar 31 2017 02:40:49 GMT-0400 (EDT)
3
- const webpackEnv = {test:true};
4
- //const webpackConfig = require("./webpack.config")(webpackEnv);
1
+
5
2
  const webpackConfig = require("./webpack.config");
6
- webpackConfig.mode = 'development';
3
+ webpackConfig.mode = 'none';
7
4
  webpackConfig.watch = true;
8
- webpackConfig.output.filename='[name].[hash:8].js';
5
+ webpackConfig.entry = undefined;
6
+ webpackConfig.output = undefined;
7
+
9
8
  const fileGlob = './src/tests/index.test.js';
10
- process.env.BABEL_ENV = 'test';
11
- //const rxjs = require("rxjs");
12
9
 
13
10
 
14
11
  module.exports = function(config) {
@@ -18,32 +15,12 @@ module.exports = function(config) {
18
15
  }
19
16
 
20
17
 
21
-
22
-
23
18
  webpackConfig.module.rules.push(
24
19
  {
25
20
  test: /(\.js)$/,
26
- loader: 'babel-loader',
27
-
28
- options: {
29
- "babelrc" : false,
30
- "presets": [
31
- ["@babel/preset-env", {
32
- "targets": {
33
- "ie" : 10,
34
- "browsers": ["last 2 versions"]
35
-
36
- },
37
- "modules": false,
38
- "loose": true
39
- }]
40
- ]
41
- },
42
21
  exclude: /(node_modules)/
43
22
  }
44
-
45
23
  );
46
- console.log("CONFIG KARMA ",webpackConfig);
47
24
 
48
25
 
49
26
  config.set({
@@ -56,22 +33,25 @@ module.exports = function(config) {
56
33
 
57
34
  },
58
35
 
59
- // frameworks to use
60
36
  // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
61
37
  frameworks: ['webpack', 'mocha', 'chai'],
62
38
 
39
+ plugins: [
40
+ 'karma-webpack',
41
+ 'karma-mocha',
42
+ 'karma-chai',
43
+ 'karma-coverage',
44
+ 'karma-chrome-launcher'
45
+ ],
46
+
63
47
 
64
- // list of files / patterns to load in the browser
65
48
  files: [
66
- {pattern: './node_modules/spynejs-polyfill/ie.js', watched:false},
67
49
  {pattern: './node_modules/ramda/dist/ramda.min.js', watched:false},
68
-
69
- { pattern: './node_modules/rxjs/*.js', included:false, watched: false },
70
50
  { pattern: './node_modules/rxjs/**/*.js', included:false, watched: false },
71
51
 
72
-
73
- {pattern: './src/tests/*.test.js', watched: true},
74
-
52
+ {pattern: './src/tests/index.test.js', watched: true},
53
+ {pattern: './src/tests/spyne-app.test.js', watched: true},
54
+ {pattern: './src/tests/spyne-plugin.test.js', watched: true},
75
55
  {pattern: './src/tests/channels/*.test.js', watched: true},
76
56
 
77
57
  {pattern: './src/tests/utils/*.test.js', watched: true},
@@ -79,9 +59,6 @@ module.exports = function(config) {
79
59
  ],
80
60
 
81
61
 
82
-
83
-
84
- // list of files to exclude
85
62
  exclude: [
86
63
 
87
64
  ],
@@ -106,18 +83,6 @@ module.exports = function(config) {
106
83
  // available reporters: https://npmjs.org/browse/keyword/karma-reporter
107
84
  reporters: ['coverage'],
108
85
 
109
- /*
110
- coverageReporter: {
111
- reporters: [
112
- {type: 'lcov', dir: 'coverage/', subdir: '.'},
113
- {type: 'text-summary'}
114
-
115
-
116
- ]
117
- },
118
- */
119
-
120
-
121
86
  coverageReporter: {
122
87
  reporters: [
123
88
  // generates ./coverage/lcov.info
@@ -142,36 +107,20 @@ module.exports = function(config) {
142
107
 
143
108
  // enable / disable watching file and executing tests whenever any file changes
144
109
  autoWatch: true,
145
-
146
-
110
+ usePolling: true,
147
111
 
148
112
  customLaunchers: {
149
-
150
113
  ChromeHeadlessNoSandbox: {
151
114
  base: 'ChromeHeadless',
152
115
  flags: ['--no-sandbox']
153
- },
154
-
155
- VirtualBoxIE11onWin7: {
156
- base: 'VirtualBoxIE11',
157
- keepAlive: true,
158
- snapshot: 'pristine',
159
- uuid: '0552dac4-c8f0-4d29-b81a-ae70026505c5'
160
- }
161
-
162
-
116
+ }
163
117
 
164
118
  },
165
119
 
166
120
 
167
-
168
121
  // start these browsers
169
122
  // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
170
123
  browsers: ['Chrome'],
171
- /*
172
- browsers: ['Chrome','VirtualBoxIE11onWin7'],
173
- */
174
-
175
124
 
176
125
  // Continuous Integration mode
177
126
  // if true, Karma captures browsers, runs the tests and exits