UNPKG

1.56 kBMarkdownView Raw
1# 2.0.0
2
3## jQuery removed from web component
4
5Web component initialize method will not longer get a jQuery Element
6instead it will get a basic javascript HTMLElement. This allows
7to use web-js without jQuery and detect which components really need
8jQuery as there dependency.
9
10**Before**
11
12```js
13initialize($el) {
14
15}
16
17// or
18
19initialize($el, options) {
20
21}
22```
23
24**After**
25
26```js
27initialize(el) {
28 var $el = el;
29}
30
31// or
32
33initialize($el, options) {
34 var $el = el;
35}
36```
37
38## Api service dataType changed
39
40The api service will now use json dataType instead of html.
41So if HTML should be returned, you should use `$.ajax` instead.
42
43## Multiple call service arguments
44
45Its now possible to provide multiple arguments to a service call for this
46exist service calls need to be changed.
47
48**Before**
49
50```js
51 web.callServices([{name: 'service', func: 'method', args: 'argument'}])
52```
53
54or when using web component twig extension:
55
56```twig
57{{ call_service('service', 'method', 'argument') }}
58```
59
60**After**
61
62```js
63 web.callServices([{name: 'service', func: 'method', args: ['argument']}])
64```
65
66or when using twig:
67
68```twig
69{{ call_service('service', 'method', ['argument']) }}
70```
71
72## Folder renamed
73
74The `src` folder has been renamed to `js` so you need to ugprade your imports.
75
76**Before**
77
78```js
79var Expand = require('massive-web/src/components/expand');
80import ContainerLink from 'massive-web/src/components/expand';
81```
82
83**After**
84
85```js
86var Expand = require('massive-web/js/components/expand');
87import ContainerLink from 'massive-web/js/components/expand';
88```