unpoly-rails 3.14.2 → 3.15.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +317 -0
- data/README.md +61 -40
- data/assets/unpoly/unpoly-bootstrap3.css.map +1 -0
- data/assets/unpoly/unpoly-bootstrap3.js.map +1 -0
- data/assets/unpoly/unpoly-bootstrap3.min.css.map +1 -0
- data/assets/unpoly/unpoly-bootstrap3.min.js.map +1 -0
- data/assets/unpoly/unpoly-bootstrap4.css.map +1 -0
- data/assets/unpoly/unpoly-bootstrap4.js.map +1 -0
- data/assets/unpoly/unpoly-bootstrap4.min.css.map +1 -0
- data/assets/unpoly/unpoly-bootstrap4.min.js.map +1 -0
- data/assets/unpoly/unpoly-bootstrap5.css.map +1 -0
- data/assets/unpoly/unpoly-bootstrap5.js.map +1 -0
- data/assets/unpoly/unpoly-bootstrap5.min.css.map +1 -0
- data/assets/unpoly/unpoly-bootstrap5.min.js.map +1 -0
- data/assets/unpoly/unpoly-migrate.js +228 -149
- data/assets/unpoly/unpoly-migrate.js.map +1 -0
- data/assets/unpoly/unpoly-migrate.min.js +1 -1
- data/assets/unpoly/unpoly-migrate.min.js.map +1 -0
- data/assets/unpoly/unpoly.css.map +1 -0
- data/assets/unpoly/unpoly.es6.js +666 -430
- data/assets/unpoly/unpoly.es6.js.map +1 -0
- data/assets/unpoly/unpoly.es6.min.js +1 -1
- data/assets/unpoly/unpoly.es6.min.js.map +1 -0
- data/assets/unpoly/unpoly.js +2167 -1990
- data/assets/unpoly/unpoly.js.map +1 -0
- data/assets/unpoly/unpoly.min.css.map +1 -0
- data/assets/unpoly/unpoly.min.js +1 -1
- data/assets/unpoly/unpoly.min.js.map +1 -0
- data/lib/unpoly/rails/change/cache.rb +4 -4
- data/lib/unpoly/rails/change/layer.rb +3 -0
- data/lib/unpoly/rails/change.rb +35 -8
- data/lib/unpoly/rails/controller.rb +3 -2
- data/lib/unpoly/rails/engine.rb +7 -0
- data/lib/unpoly/rails/request_echo_headers.rb +10 -3
- data/lib/unpoly/rails/util.rb +38 -0
- data/lib/unpoly/rails/version.rb +1 -1
- metadata +31 -8
|
@@ -6,11 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
const u = up.util;
|
|
8
8
|
up.migrate = (function () {
|
|
9
|
-
const config = new up.Config(() => ({
|
|
10
|
-
logLevel: '
|
|
9
|
+
const config = new up.Config('up.migrate.config', () => ({
|
|
10
|
+
logLevel: 'error'
|
|
11
11
|
}));
|
|
12
|
-
function renamedProperty(object, oldKey, newKey,
|
|
13
|
-
const doWarn = u.memoize(
|
|
12
|
+
function renamedProperty(object, oldKey, newKey, { label, warning } = {}) {
|
|
13
|
+
const doWarn = u.memoize(function () {
|
|
14
|
+
if (warning) {
|
|
15
|
+
warn(warning);
|
|
16
|
+
}
|
|
17
|
+
else if (label) {
|
|
18
|
+
warn('Property %s.%s has been renamed to %s.%s', label, oldKey, label, newKey);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
warn('Property { %s } has been renamed to { %s } (found in %o)', oldKey, newKey, object);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
14
24
|
Object.defineProperty(object, oldKey, {
|
|
15
25
|
configurable: true,
|
|
16
26
|
get() {
|
|
@@ -23,11 +33,23 @@ up.migrate = (function () {
|
|
|
23
33
|
}
|
|
24
34
|
});
|
|
25
35
|
}
|
|
26
|
-
function removedProperty(object, key,
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
function removedProperty(object, key, { label, warning, value } = {}) {
|
|
37
|
+
var _a;
|
|
38
|
+
const doWarn = u.memoize(function () {
|
|
39
|
+
if (warning) {
|
|
40
|
+
warn(warning);
|
|
41
|
+
}
|
|
42
|
+
else if (label) {
|
|
43
|
+
warn('Property %s.%s has been removed without replacement', label, key);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
warn('Property { %s } has been removed without replacement (found in %o)', key, object);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
let valueRef = [value !== null && value !== void 0 ? value : (_a = Object.getOwnPropertyDescriptor(object, key)) === null || _a === void 0 ? void 0 : _a.value];
|
|
29
50
|
Object.defineProperty(object, key, {
|
|
30
51
|
configurable: true,
|
|
52
|
+
enumerable: false,
|
|
31
53
|
get() {
|
|
32
54
|
doWarn();
|
|
33
55
|
return valueRef[0];
|
|
@@ -39,21 +61,6 @@ up.migrate = (function () {
|
|
|
39
61
|
});
|
|
40
62
|
return valueRef;
|
|
41
63
|
}
|
|
42
|
-
function forbiddenPropertyValue(object, key, forbiddenValue, errorMessage) {
|
|
43
|
-
let value = object[key];
|
|
44
|
-
Object.defineProperty(object, key, {
|
|
45
|
-
configurable: true,
|
|
46
|
-
get() {
|
|
47
|
-
return value;
|
|
48
|
-
},
|
|
49
|
-
set(newValue) {
|
|
50
|
-
if (newValue === forbiddenValue) {
|
|
51
|
-
throw new Error(errorMessage);
|
|
52
|
-
}
|
|
53
|
-
value = newValue;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
64
|
function transformAttribute(oldAttr, ...args) {
|
|
58
65
|
let transformer = u.extractCallback(args);
|
|
59
66
|
let { scope } = u.extractOptions(args);
|
|
@@ -84,9 +91,17 @@ up.migrate = (function () {
|
|
|
84
91
|
}
|
|
85
92
|
});
|
|
86
93
|
}
|
|
87
|
-
function fixKey(object, oldKey, newKey) {
|
|
94
|
+
function fixKey(object, oldKey, newKey, { label, detail } = {}) {
|
|
88
95
|
if (u.isDefined(object[oldKey])) {
|
|
89
|
-
|
|
96
|
+
if (label && detail) {
|
|
97
|
+
warn('Property { %s } has been renamed to { %s } (found in %s for %o)', oldKey, newKey, label, detail);
|
|
98
|
+
}
|
|
99
|
+
else if (label) {
|
|
100
|
+
warn('Property { %s } has been renamed to { %s } (found in %s)', oldKey, newKey, label);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
warn('Property { %s } has been renamed to { %s } (found in %o)', oldKey, newKey, object);
|
|
104
|
+
}
|
|
90
105
|
u.renameKey(object, oldKey, newKey);
|
|
91
106
|
}
|
|
92
107
|
}
|
|
@@ -229,7 +244,6 @@ up.migrate = (function () {
|
|
|
229
244
|
renamedProperty,
|
|
230
245
|
removedProperty,
|
|
231
246
|
defineThrowingProps,
|
|
232
|
-
forbiddenPropertyValue,
|
|
233
247
|
transformAttribute,
|
|
234
248
|
renamedAttribute,
|
|
235
249
|
removedAttribute,
|
|
@@ -262,14 +276,14 @@ up.Config.prototype.patch = function (patch) {
|
|
|
262
276
|
/* 3 */
|
|
263
277
|
/***/ (() => {
|
|
264
278
|
|
|
265
|
-
up.migrate.renamedProperty(up.RenderJob.prototype, 'options', 'renderOptions', 'up.RenderJob: Property { options } has been renamed to { renderOptions }');
|
|
279
|
+
up.migrate.renamedProperty(up.RenderJob.prototype, 'options', 'renderOptions', { warning: 'up.RenderJob: Property { options } has been renamed to { renderOptions }' });
|
|
266
280
|
|
|
267
281
|
|
|
268
282
|
/***/ }),
|
|
269
283
|
/* 4 */
|
|
270
284
|
/***/ (() => {
|
|
271
285
|
|
|
272
|
-
up.migrate.renamedProperty(up.RenderResult.prototype, 'options', 'renderOptions', 'up.RenderResult: Property { options } has been renamed to { renderOptions }');
|
|
286
|
+
up.migrate.renamedProperty(up.RenderResult.prototype, 'options', 'renderOptions', { warning: 'up.RenderResult: Property { options } has been renamed to { renderOptions }' });
|
|
273
287
|
|
|
274
288
|
|
|
275
289
|
/***/ }),
|
|
@@ -348,7 +362,10 @@ up.util.values = function (...args) {
|
|
|
348
362
|
up.migrate.deprecated('up.util.values()', 'Object.values()');
|
|
349
363
|
return Object.values(...args);
|
|
350
364
|
};
|
|
351
|
-
up.util.microtask =
|
|
365
|
+
up.util.microtask = function (task) {
|
|
366
|
+
up.migrate.deprecated('up.util.microtask()', 'queueMicrotask()');
|
|
367
|
+
return Promise.resolve().then(task);
|
|
368
|
+
};
|
|
352
369
|
up.migrate.splitAtOr = function (value) {
|
|
353
370
|
let parts = value.split(/\s+or\s+/);
|
|
354
371
|
if (parts.length >= 2) {
|
|
@@ -363,6 +380,7 @@ up.migrate.splitAtOr = function (value) {
|
|
|
363
380
|
/***/ (() => {
|
|
364
381
|
|
|
365
382
|
class DeprecatedCannotCompile extends up.Error {
|
|
383
|
+
get [Symbol.toStringTag]() { return 'up.CannotCompile'; }
|
|
366
384
|
}
|
|
367
385
|
Object.defineProperty(up, 'CannotCompile', { get: function () {
|
|
368
386
|
up.migrate.warn('The error up.CannotCompile is no longer thrown. Compiler errors now emit an "error" event on window, but no longer crash the render pass.');
|
|
@@ -436,11 +454,11 @@ up.element.toSelector = function (...args) {
|
|
|
436
454
|
return up.fragment.toTarget(...args);
|
|
437
455
|
};
|
|
438
456
|
up.element.isAttached = function (element) {
|
|
439
|
-
up.migrate.deprecated('up.element.isAttached()', '
|
|
457
|
+
up.migrate.deprecated('up.element.isAttached()', 'element.isConnected');
|
|
440
458
|
return document.contains(element);
|
|
441
459
|
};
|
|
442
460
|
up.element.isDetached = function (element) {
|
|
443
|
-
up.migrate.deprecated('up.element.isDetached()', '!
|
|
461
|
+
up.migrate.deprecated('up.element.isDetached()', '!element.isConnected');
|
|
444
462
|
return !up.element.isAttached(element);
|
|
445
463
|
};
|
|
446
464
|
|
|
@@ -482,18 +500,22 @@ up.$off = function (...definitionArgs) {
|
|
|
482
500
|
const u = up.util;
|
|
483
501
|
const e = up.element;
|
|
484
502
|
up.migrate.renamedPackage('syntax', 'script');
|
|
503
|
+
up.script.config.patch(function (config) {
|
|
504
|
+
up.migrate.renamedProperty(config, 'callbackPolicy', 'evalCallbackPolicy', { warning: 'There is no setting up.script.config.callbackPolicy. Use up.script.config.evalCallbackPolicy instead.' });
|
|
505
|
+
});
|
|
485
506
|
up.migrate.postCompile = function (elements, compiler) {
|
|
486
507
|
let keepValue;
|
|
487
508
|
if (keepValue = compiler.keep) {
|
|
488
|
-
up.migrate.warn('The { keep
|
|
509
|
+
up.migrate.warn('The { keep } option for up.compiler() has been removed. Have the compiler set an [up-keep] attribute instead (found in compiler for "%s").', compiler.selector);
|
|
489
510
|
const value = u.isString(keepValue) ? keepValue : '';
|
|
490
511
|
for (let element of elements) {
|
|
491
512
|
element.setAttribute('up-keep', value);
|
|
492
513
|
}
|
|
493
514
|
}
|
|
494
515
|
};
|
|
495
|
-
up.migrate.targetMacro = function (queryAttr, fixedResultAttrs,
|
|
516
|
+
up.migrate.targetMacro = function (queryAttr, fixedResultAttrs, replacement) {
|
|
496
517
|
up.macro(`[${queryAttr}]`, function (link) {
|
|
518
|
+
up.migrate.warn('Attribute [%s] has been deprecated. Use %s instead (found in %o).', queryAttr, replacement, link);
|
|
497
519
|
let optionalTarget;
|
|
498
520
|
const resultAttrs = u.copy(fixedResultAttrs);
|
|
499
521
|
if ((optionalTarget = link.getAttribute(queryAttr))) {
|
|
@@ -504,7 +526,6 @@ up.migrate.targetMacro = function (queryAttr, fixedResultAttrs, callback) {
|
|
|
504
526
|
}
|
|
505
527
|
e.setMissingAttrs(link, resultAttrs);
|
|
506
528
|
link.removeAttribute(queryAttr);
|
|
507
|
-
callback === null || callback === void 0 ? void 0 : callback();
|
|
508
529
|
});
|
|
509
530
|
};
|
|
510
531
|
up.$compiler = function (...definitionArgs) {
|
|
@@ -547,10 +568,11 @@ up.hello = function (element, ...args) {
|
|
|
547
568
|
/***/ (() => {
|
|
548
569
|
|
|
549
570
|
up.form.config.patch(function (config) {
|
|
550
|
-
up.migrate.renamedProperty(config, 'fields', 'fieldSelectors');
|
|
551
|
-
up.migrate.renamedProperty(config, 'submitButtons', 'submitButtonSelectors');
|
|
552
|
-
up.migrate.renamedProperty(config, 'validateTargets', 'groupSelectors');
|
|
553
|
-
up.migrate.renamedProperty(config, 'observeDelay', 'watchInputDelay');
|
|
571
|
+
up.migrate.renamedProperty(config, 'fields', 'fieldSelectors', { label: 'up.form.config' });
|
|
572
|
+
up.migrate.renamedProperty(config, 'submitButtons', 'submitButtonSelectors', { label: 'up.form.config' });
|
|
573
|
+
up.migrate.renamedProperty(config, 'validateTargets', 'groupSelectors', { label: 'up.form.config' });
|
|
574
|
+
up.migrate.renamedProperty(config, 'observeDelay', 'watchInputDelay', { label: 'up.form.config' });
|
|
575
|
+
up.migrate.renamedProperty(config, 'genericButtonSelectors', 'anyButtonSelectors', { label: 'up.form.config' });
|
|
554
576
|
});
|
|
555
577
|
up.migrate.migratedFormGroupSelectors = function () {
|
|
556
578
|
return up.form.config.groupSelectors.map((originalSelector) => {
|
|
@@ -591,16 +613,17 @@ const u = up.util;
|
|
|
591
613
|
up.migrate.renamedPackage('flow', 'fragment');
|
|
592
614
|
up.migrate.renamedPackage('dom', 'fragment');
|
|
593
615
|
up.fragment.config.patch(function (config) {
|
|
594
|
-
up.migrate.renamedProperty(config, 'fallbacks', 'mainTargets');
|
|
616
|
+
up.migrate.renamedProperty(config, 'fallbacks', 'mainTargets', { label: 'up.fragment.config' });
|
|
595
617
|
});
|
|
596
|
-
|
|
618
|
+
const renderOptionsSource = (options) => ({ label: 'render options', detail: options.origin || options.url || options.target });
|
|
619
|
+
up.migrate.handleResponseDocOptions = (docOptions) => up.migrate.fixKey(docOptions, 'html', 'document', renderOptionsSource(docOptions));
|
|
597
620
|
up.fragment.config.patch(function (config) {
|
|
598
621
|
let matchAroundOriginDeprecated = () => up.migrate.deprecated('up.fragment.config.matchAroundOrigin', 'up.fragment.config.match');
|
|
599
622
|
Object.defineProperty(config, 'matchAroundOrigin', {
|
|
600
623
|
configurable: true,
|
|
601
624
|
get: function () {
|
|
602
625
|
matchAroundOriginDeprecated();
|
|
603
|
-
return this.match === '
|
|
626
|
+
return this.match === 'region';
|
|
604
627
|
},
|
|
605
628
|
set: function (value) {
|
|
606
629
|
matchAroundOriginDeprecated();
|
|
@@ -655,8 +678,8 @@ up.migrate.preprocessRenderOptions = function (options) {
|
|
|
655
678
|
up.migrate.warn('Unpoly 3+ only aborts requests targeting the same fragment. Setting { solo: false } may no longer be necessary.');
|
|
656
679
|
options.abort = false;
|
|
657
680
|
}
|
|
658
|
-
up.migrate.fixKey(options, 'failOnFinished', 'onFailFinished');
|
|
659
|
-
up.migrate.fixKey(options, 'badResponseTime', 'lateDelay');
|
|
681
|
+
up.migrate.fixKey(options, 'failOnFinished', 'onFailFinished', renderOptionsSource(options));
|
|
682
|
+
up.migrate.fixKey(options, 'badResponseTime', 'lateDelay', renderOptionsSource(options));
|
|
660
683
|
if (u.isString(options.reveal)) {
|
|
661
684
|
up.migrate.deprecated(`Option { reveal: '${options.reveal}' }`, `{ scroll: '${options.reveal}' }`);
|
|
662
685
|
options.scroll = options.reveal;
|
|
@@ -671,7 +694,7 @@ up.migrate.preprocessRenderOptions = function (options) {
|
|
|
671
694
|
}
|
|
672
695
|
if (options.resetScroll === true) {
|
|
673
696
|
up.migrate.deprecated('Option { resetScroll: true }', "{ scroll: 'top' }");
|
|
674
|
-
options.scroll = '
|
|
697
|
+
options.scroll = 'top';
|
|
675
698
|
}
|
|
676
699
|
if (options.resetScroll === false) {
|
|
677
700
|
up.migrate.deprecated('Option { resetScroll: false }', "{ scroll: false }");
|
|
@@ -686,7 +709,7 @@ up.migrate.preprocessRenderOptions = function (options) {
|
|
|
686
709
|
options.scroll = false;
|
|
687
710
|
}
|
|
688
711
|
if (options.scroll === 'reset') {
|
|
689
|
-
up.migrate.deprecated("Option { scroll: 'reset'
|
|
712
|
+
up.migrate.deprecated("Option { scroll: 'reset' }", "{ scroll: 'top' }");
|
|
690
713
|
options.scroll = 'top';
|
|
691
714
|
}
|
|
692
715
|
};
|
|
@@ -707,7 +730,8 @@ up.migrate.resolveOrigin = function (target, { origin } = {}) {
|
|
|
707
730
|
return target.replace(pattern, function (variant) {
|
|
708
731
|
if (variant === ':origin' || variant === '&') {
|
|
709
732
|
if (variant === '&') {
|
|
710
|
-
|
|
733
|
+
let formHint = (origin === null || origin === void 0 ? void 0 : origin.form) ? "A form submission's :origin is now the button or changed field, not the form. To target the form, use form:has(:origin). " : '';
|
|
734
|
+
up.migrate.warn("Origin shorthand '&' has been deprecated. Use :origin instead. " + formHint + "Found in %s (origin %o).", target, origin);
|
|
711
735
|
}
|
|
712
736
|
if (origin) {
|
|
713
737
|
return up.fragment.toTarget(origin);
|
|
@@ -752,7 +776,7 @@ up.fragment.config.patch(function () {
|
|
|
752
776
|
up.compiler('[up-keep]', function (element) {
|
|
753
777
|
let selector = up.element.booleanOrStringAttr(element, 'up-keep');
|
|
754
778
|
if (u.isString(selector) && /[.[#]/.test(selector)) {
|
|
755
|
-
up.migrate.warn('The [up-keep] attribute no longer supports a selector value. Elements will be matched by their derived target. You may prevent keeping with [up-on-keep="if(condition) event.preventDefault()"].
|
|
779
|
+
up.migrate.warn('The [up-keep] attribute no longer supports a selector value (found in %o). Elements will be matched by their derived target. You may prevent keeping with [up-on-keep="if(condition) event.preventDefault()"].', element);
|
|
756
780
|
element.addEventListener('up:fragment:keep', function (event) {
|
|
757
781
|
if (event.target === element && !event.newFragment.matches(selector)) {
|
|
758
782
|
event.preventDefault();
|
|
@@ -778,7 +802,7 @@ if (document.querySelector('script[up-boot=manual]')) {
|
|
|
778
802
|
/***/ (() => {
|
|
779
803
|
|
|
780
804
|
up.history.config.patch(function (config) {
|
|
781
|
-
up.migrate.renamedProperty(config, 'popTargets', 'restoreTargets');
|
|
805
|
+
up.migrate.renamedProperty(config, 'popTargets', 'restoreTargets', { label: 'up.history.config' });
|
|
782
806
|
});
|
|
783
807
|
up.history.url = function () {
|
|
784
808
|
up.migrate.deprecated('up.history.url()', 'up.history.location');
|
|
@@ -790,28 +814,31 @@ up.migrate.renamedEvent('up:history:restore', 'up:location:changed');
|
|
|
790
814
|
up.migrate.renamedEvent('up:history:restored', 'up:location:changed');
|
|
791
815
|
up.migrate.renamedEvent('up:history:replaced', 'up:location:changed');
|
|
792
816
|
up.migrate.prepareLocationChangedEvent = function (event) {
|
|
793
|
-
up.migrate.renamedProperty(event, 'url', 'location');
|
|
817
|
+
up.migrate.renamedProperty(event, 'url', 'location', { warning: 'Property event.url of up:location:changed has been renamed to event.location' });
|
|
794
818
|
};
|
|
795
819
|
up.history.config.patch(function () {
|
|
796
|
-
this.updateMetaTagsValue = this.updateMetaTags;
|
|
797
|
-
this.updateMetaTagsSet = false;
|
|
798
820
|
Object.defineProperty(this, 'updateMetaTags', {
|
|
799
821
|
configurable: true,
|
|
800
822
|
get() {
|
|
801
|
-
return
|
|
823
|
+
return up.history.isEnabled('metaTags');
|
|
802
824
|
},
|
|
803
825
|
set(value) {
|
|
804
|
-
|
|
805
|
-
|
|
826
|
+
if (value) {
|
|
827
|
+
up.migrate.warn('up.history.config.updateMetaTags has been removed. Meta tags are updated by default.');
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
up.migrate.deprecated('up.history.config.updateMetaTags = false', "an array of aspects without 'metaTags' in up.history.config.enabled");
|
|
831
|
+
let { enabled } = this;
|
|
832
|
+
if (enabled === true)
|
|
833
|
+
enabled = ['location', 'title', 'lang'];
|
|
834
|
+
if (up.util.isArray(enabled))
|
|
835
|
+
this.enabled = enabled.filter((aspect) => aspect !== 'metaTags');
|
|
806
836
|
}
|
|
807
837
|
});
|
|
808
838
|
});
|
|
809
|
-
up.on('up:framework:boot', function () {
|
|
810
|
-
if (!up.history.config.updateMetaTagsSet) {
|
|
811
|
-
up.migrate.warn('Meta tags in the <head> are now updated automatically. Configure up.history.config.updateMetaTags to remove this warning.');
|
|
812
|
-
}
|
|
813
|
-
});
|
|
814
839
|
up.migrate.warnOfHungryMetaTags = function (metaTags) {
|
|
840
|
+
if (!up.history.isEnabled('metaTags'))
|
|
841
|
+
return;
|
|
815
842
|
let fullHungrySelector = up.radio.config.selector('hungrySelectors');
|
|
816
843
|
let hungryMetaTags = up.util.filter(metaTags, (meta) => meta.matches(fullHungrySelector));
|
|
817
844
|
if (hungryMetaTags.length) {
|
|
@@ -827,7 +854,7 @@ up.migrate.warnOfHungryMetaTags = function (metaTags) {
|
|
|
827
854
|
up.migrate.renamedPackage('navigation', 'status');
|
|
828
855
|
up.migrate.renamedPackage('feedback', 'status');
|
|
829
856
|
up.status.config.patch(function (config) {
|
|
830
|
-
up.migrate.renamedProperty(config, 'navs', 'navSelectors');
|
|
857
|
+
up.migrate.renamedProperty(config, 'navs', 'navSelectors', { label: 'up.status.config' });
|
|
831
858
|
});
|
|
832
859
|
|
|
833
860
|
|
|
@@ -836,65 +863,68 @@ up.status.config.patch(function (config) {
|
|
|
836
863
|
/***/ (() => {
|
|
837
864
|
|
|
838
865
|
const followSelectorFn = up.link.config.selectorFn('followSelectors');
|
|
866
|
+
const submitSelectorFn = up.form.config.selectorFn('submitSelectors');
|
|
839
867
|
const preloadSelectorFn = up.link.config.selectorFn('preloadSelectors');
|
|
840
|
-
|
|
841
|
-
up.migrate.renamedAttribute('up-
|
|
842
|
-
up.migrate.renamedAttribute('up-
|
|
843
|
-
up.migrate.
|
|
844
|
-
up.migrate.removedAttribute('up-
|
|
845
|
-
up.migrate.
|
|
846
|
-
up.migrate.renamedAttribute('up-
|
|
868
|
+
const layerOpenerSelectorFn = () => [followSelectorFn(), submitSelectorFn()].join();
|
|
869
|
+
up.migrate.renamedAttribute('up-flavor', 'up-mode', { scope: layerOpenerSelectorFn });
|
|
870
|
+
up.migrate.renamedAttribute('up-closable', 'up-dismissible', { scope: layerOpenerSelectorFn });
|
|
871
|
+
up.migrate.renamedAttribute('up-dismissable', 'up-dismissible', { scope: layerOpenerSelectorFn });
|
|
872
|
+
up.migrate.removedAttribute('up-width', { scope: layerOpenerSelectorFn, replacement: '[up-size] or [up-class]' });
|
|
873
|
+
up.migrate.removedAttribute('up-height', { scope: layerOpenerSelectorFn, replacement: '[up-size] or [up-class]' });
|
|
874
|
+
up.migrate.renamedAttribute('up-history-visible', 'up-history', { scope: layerOpenerSelectorFn });
|
|
875
|
+
up.migrate.renamedAttribute('up-clear-cache', 'up-expire-cache', { scope: layerOpenerSelectorFn });
|
|
847
876
|
up.migrate.renamedAttribute('up-bad-response-time', 'up-late-delay');
|
|
848
877
|
up.migrate.transformAttribute('up-solo', function (link, solo) {
|
|
849
878
|
switch (solo) {
|
|
850
879
|
case '':
|
|
851
|
-
up.migrate.warn('Attribute [up-solo] has been replaced with [up-abort="all"]');
|
|
880
|
+
up.migrate.warn('Attribute [up-solo] has been replaced with [up-abort="all"] (found in %o)', link);
|
|
852
881
|
link.setAttribute('up-abort', 'all');
|
|
853
882
|
break;
|
|
854
883
|
case 'true':
|
|
855
|
-
up.migrate.warn('Attribute [up-solo="true"] has been replaced with [up-abort="all"]');
|
|
884
|
+
up.migrate.warn('Attribute [up-solo="true"] has been replaced with [up-abort="all"] (found in %o)', link);
|
|
856
885
|
link.setAttribute('up-abort', 'all');
|
|
857
886
|
break;
|
|
858
887
|
case 'false':
|
|
859
|
-
up.migrate.warn('Attribute [up-solo="false"] has been replaced with [up-abort="false"]');
|
|
888
|
+
up.migrate.warn('Attribute [up-solo="false"] has been replaced with [up-abort="false"] (found in %o)', link);
|
|
860
889
|
up.migrate.warn('Unpoly 3+ only aborts requests targeting the same fragment. Setting [up-solo="false"] may no longer be necessary.');
|
|
861
890
|
link.setAttribute('up-abort', 'false');
|
|
862
891
|
break;
|
|
863
892
|
default:
|
|
864
|
-
up.migrate.warn('Attribute [up-solo] has been renamed to [up-abort] and [up-abort] no longer accepts a URL pattern. Check if you can use [up-abort="target"] instead.');
|
|
893
|
+
up.migrate.warn('Attribute [up-solo] has been renamed to [up-abort] and [up-abort] no longer accepts a URL pattern (found in %o). Check if you can use [up-abort="target"] instead.', link);
|
|
865
894
|
link.setAttribute('up-abort', 'target');
|
|
866
895
|
}
|
|
867
896
|
});
|
|
868
897
|
up.migrate.transformAttribute('up-reveal', function (link, reveal) {
|
|
869
898
|
switch (reveal) {
|
|
870
899
|
case '':
|
|
871
|
-
up.migrate.warn('Attribute [up-reveal] has been replaced with [up-scroll="target"]');
|
|
900
|
+
up.migrate.warn('Attribute [up-reveal] has been replaced with [up-scroll="target"] (found in %o)', link);
|
|
872
901
|
link.setAttribute('up-scroll', 'target');
|
|
873
902
|
break;
|
|
874
903
|
case 'true':
|
|
875
|
-
up.migrate.warn('Attribute [up-reveal="true"] has been replaced with [up-scroll="target"]');
|
|
904
|
+
up.migrate.warn('Attribute [up-reveal="true"] has been replaced with [up-scroll="target"] (found in %o)', link);
|
|
876
905
|
link.setAttribute('up-scroll', 'target');
|
|
877
906
|
break;
|
|
878
907
|
case 'false':
|
|
879
|
-
up.migrate.warn('Attribute [up-reveal="false"] has been replaced with [up-scroll="false"]');
|
|
908
|
+
up.migrate.warn('Attribute [up-reveal="false"] has been replaced with [up-scroll="false"] (found in %o)', link);
|
|
880
909
|
link.setAttribute('up-scroll', 'false');
|
|
881
910
|
break;
|
|
882
911
|
default:
|
|
883
|
-
up.migrate.warn('Attribute [up-reveal="%s"] has been replaced with [up-scroll="%s"]', reveal);
|
|
912
|
+
up.migrate.warn('Attribute [up-reveal="%s"] has been replaced with [up-scroll="%s"] (found in %o)', reveal, reveal, link);
|
|
913
|
+
link.setAttribute('up-scroll', reveal);
|
|
884
914
|
}
|
|
885
915
|
});
|
|
886
916
|
up.migrate.transformAttribute('up-reset-scroll', function (link, resetScroll) {
|
|
887
917
|
switch (resetScroll) {
|
|
888
918
|
case '':
|
|
889
|
-
up.migrate.warn('Attribute [up-reset-scroll] has been replaced with [up-scroll="top"]');
|
|
919
|
+
up.migrate.warn('Attribute [up-reset-scroll] has been replaced with [up-scroll="top"] (found in %o)', link);
|
|
890
920
|
link.setAttribute('up-scroll', 'top');
|
|
891
921
|
break;
|
|
892
922
|
case 'true':
|
|
893
|
-
up.migrate.warn('Attribute [up-reset-scroll="true"] has been replaced with [up-scroll="top"]');
|
|
923
|
+
up.migrate.warn('Attribute [up-reset-scroll="true"] has been replaced with [up-scroll="top"] (found in %o)', link);
|
|
894
924
|
link.setAttribute('up-scroll', 'top');
|
|
895
925
|
break;
|
|
896
926
|
case 'false':
|
|
897
|
-
up.migrate.warn('Attribute [up-reset-scroll="false"] has been replaced with [up-scroll="false"]');
|
|
927
|
+
up.migrate.warn('Attribute [up-reset-scroll="false"] has been replaced with [up-scroll="false"] (found in %o)', link);
|
|
898
928
|
link.setAttribute('up-scroll', 'false');
|
|
899
929
|
break;
|
|
900
930
|
}
|
|
@@ -902,25 +932,24 @@ up.migrate.transformAttribute('up-reset-scroll', function (link, resetScroll) {
|
|
|
902
932
|
up.migrate.transformAttribute('up-restore-scroll', function (link, restoreScroll) {
|
|
903
933
|
switch (restoreScroll) {
|
|
904
934
|
case '':
|
|
905
|
-
up.migrate.warn('Attribute [up-restore-scroll] has been replaced with [up-scroll="restore"]');
|
|
935
|
+
up.migrate.warn('Attribute [up-restore-scroll] has been replaced with [up-scroll="restore"] (found in %o)', link);
|
|
906
936
|
link.setAttribute('up-scroll', 'restore');
|
|
907
937
|
break;
|
|
908
938
|
case 'true':
|
|
909
|
-
up.migrate.warn('Attribute [up-restore-scroll="true"] has been replaced with [up-scroll="restore"]');
|
|
939
|
+
up.migrate.warn('Attribute [up-restore-scroll="true"] has been replaced with [up-scroll="restore"] (found in %o)', link);
|
|
910
940
|
link.setAttribute('up-scroll', 'restore');
|
|
911
941
|
break;
|
|
912
942
|
case 'false':
|
|
913
|
-
up.migrate.warn('Attribute [up-restore-scroll="false"] has been replaced with [up-scroll="false"]');
|
|
943
|
+
up.migrate.warn('Attribute [up-restore-scroll="false"] has been replaced with [up-scroll="false"] (found in %o)', link);
|
|
914
944
|
link.setAttribute('up-scroll', 'false');
|
|
915
945
|
break;
|
|
916
946
|
}
|
|
917
947
|
});
|
|
918
|
-
up.migrate.targetMacro('up-dash', { 'up-preload': '', 'up-instant': '' },
|
|
948
|
+
up.migrate.targetMacro('up-dash', { 'up-preload': '', 'up-instant': '' }, 'up.link.config.instantSelectors and up.link.config.preloadSelectors');
|
|
919
949
|
up.migrate.renamedAttribute('up-delay', 'up-preload-delay', { scope: preloadSelectorFn });
|
|
920
950
|
let preloadEnabledRef;
|
|
921
951
|
up.link.config.patch(function (config) {
|
|
922
|
-
config.preloadEnabled
|
|
923
|
-
preloadEnabledRef = up.migrate.removedProperty(config, 'preloadEnabled', 'The configuration up.link.config.preloadEnabled has been removed. To disable preloading, prevent up:link:preload instead.');
|
|
952
|
+
preloadEnabledRef = up.migrate.removedProperty(config, 'preloadEnabled', { value: true, warning: 'The configuration up.link.config.preloadEnabled has been removed. To disable preloading, prevent up:link:preload instead.' });
|
|
924
953
|
});
|
|
925
954
|
up.on('up:link:preload', function (event) {
|
|
926
955
|
if (!preloadEnabledRef[0]) {
|
|
@@ -928,19 +957,25 @@ up.on('up:link:preload', function (event) {
|
|
|
928
957
|
}
|
|
929
958
|
});
|
|
930
959
|
const LEGACY_UP_HREF_FOLLOW_SELECTOR = '[up-href]:not([up-follow], [up-poll], [up-defer], [up-expand])';
|
|
931
|
-
up.
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
});
|
|
935
|
-
up.compiler(LEGACY_UP_HREF_FOLLOW_SELECTOR, function (element) {
|
|
960
|
+
up.macro(LEGACY_UP_HREF_FOLLOW_SELECTOR, { priority: -50 }, function (element) {
|
|
961
|
+
if (up.link.isFollowable(element))
|
|
962
|
+
return;
|
|
936
963
|
up.migrate.warn('Following links with only [up-href] has been deprecated. You must now also set an [up-follow] on the same link (found in %o).', element);
|
|
964
|
+
element.setAttribute('up-follow', '');
|
|
937
965
|
});
|
|
938
|
-
const LEGACY_UP_INSTANT_FOLLOW_INTENT_SELECTOR =
|
|
966
|
+
const LEGACY_UP_INSTANT_FOLLOW_INTENT_SELECTOR = 'a[href][up-instant]';
|
|
939
967
|
up.link.config.patch(function (config) {
|
|
940
968
|
config.followSelectors.push(LEGACY_UP_INSTANT_FOLLOW_INTENT_SELECTOR);
|
|
941
969
|
});
|
|
942
|
-
|
|
943
|
-
|
|
970
|
+
function isFollowableWithoutLegacyInstant(element) {
|
|
971
|
+
let { followSelectors, noFollowSelectors } = up.link.config;
|
|
972
|
+
let modernFollowSelectors = followSelectors.filter((selector) => selector !== LEGACY_UP_INSTANT_FOLLOW_INTENT_SELECTOR);
|
|
973
|
+
return element.matches(up.element.unionSelector(modernFollowSelectors, noFollowSelectors));
|
|
974
|
+
}
|
|
975
|
+
up.compiler(LEGACY_UP_INSTANT_FOLLOW_INTENT_SELECTOR, function (element) {
|
|
976
|
+
if (up.link.isFollowable(element) && !isFollowableWithoutLegacyInstant(element)) {
|
|
977
|
+
up.migrate.warn('Following links with only [up-instant] has been deprecated. You must now also set an [up-follow] on the same link (found in %o).', element);
|
|
978
|
+
}
|
|
944
979
|
});
|
|
945
980
|
|
|
946
981
|
|
|
@@ -948,12 +983,28 @@ up.compiler(LEGACY_UP_HREF_FOLLOW_SELECTOR, function (element) {
|
|
|
948
983
|
/* 18 */
|
|
949
984
|
/***/ (() => {
|
|
950
985
|
|
|
986
|
+
function fixRenamedLayerKeys(object, source) {
|
|
987
|
+
up.migrate.fixKey(object, 'closable', 'dismissible', source);
|
|
988
|
+
up.migrate.fixKey(object, 'dismissable', 'dismissible', source);
|
|
989
|
+
up.migrate.fixKey(object, 'closeLabel', 'dismissLabel', source);
|
|
990
|
+
up.migrate.fixKey(object, 'dismissAriaLabel', 'dismissARIALabel', source);
|
|
991
|
+
up.migrate.fixKey(object, 'historyVisible', 'history', source);
|
|
992
|
+
splitPosition(object);
|
|
993
|
+
}
|
|
994
|
+
function splitPosition(object) {
|
|
995
|
+
if (!up.util.isString(object.position))
|
|
996
|
+
return;
|
|
997
|
+
const [position, align] = object.position.split('-');
|
|
998
|
+
if (align) {
|
|
999
|
+
up.migrate.warn('The position value %o is deprecated. Use %o instead.', object.position, { position, align });
|
|
1000
|
+
object.position = position;
|
|
1001
|
+
object.align = align;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
951
1004
|
up.migrate.handleLayerOptions = function (options) {
|
|
952
|
-
|
|
953
|
-
up.migrate.fixKey(options, '
|
|
954
|
-
|
|
955
|
-
up.migrate.fixKey(options, 'closeLabel', 'dismissLabel');
|
|
956
|
-
up.migrate.fixKey(options, 'dismissAriaLabel', 'dismissARIALabel');
|
|
1005
|
+
const source = { label: 'layer options', detail: options.origin || options.url };
|
|
1006
|
+
up.migrate.fixKey(options, 'flavor', 'mode', source);
|
|
1007
|
+
fixRenamedLayerKeys(options, source);
|
|
957
1008
|
for (let dimensionKey of ['width', 'maxWidth', 'height']) {
|
|
958
1009
|
if (options[dimensionKey]) {
|
|
959
1010
|
up.migrate.warn(`Layer option { ${dimensionKey} } has been removed. Use { size } or { class } instead.`);
|
|
@@ -978,19 +1029,22 @@ up.migrate.handleLayerOptions = function (options) {
|
|
|
978
1029
|
options.layer = 'new';
|
|
979
1030
|
}
|
|
980
1031
|
};
|
|
981
|
-
up.migrate.handleTetherOptions = function (options) {
|
|
982
|
-
const [position, align] = options.position.split('-');
|
|
983
|
-
if (align) {
|
|
984
|
-
up.migrate.warn('The position value %o is deprecated. Use %o instead.', options.position, { position, align });
|
|
985
|
-
options.position = position;
|
|
986
|
-
options.align = align;
|
|
987
|
-
}
|
|
988
|
-
};
|
|
989
1032
|
up.migrate.registerLayerCloser = (layer) => layer.registerAttrCloser('up-close', (value, closeOptions) => {
|
|
990
1033
|
up.migrate.deprecated('[up-close]', '[up-dismiss]');
|
|
991
1034
|
layer.dismiss(value, closeOptions);
|
|
992
1035
|
});
|
|
993
|
-
up.migrate.
|
|
1036
|
+
up.migrate.fixLayerConfigs = function () {
|
|
1037
|
+
for (let [mode, modeConfig] of Object.entries(up.layer.config)) {
|
|
1038
|
+
if (up.util.isOptions(modeConfig)) {
|
|
1039
|
+
fixRenamedLayerKeys(modeConfig, { label: `up.layer.config.${mode}` });
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1043
|
+
up.on('up:framework:boot', up.migrate.fixLayerConfigs);
|
|
1044
|
+
up.migrate.handleLayerConfig = function (modeConfig) {
|
|
1045
|
+
let [mode] = Object.entries(up.layer.config).find(([_mode, value]) => value === modeConfig);
|
|
1046
|
+
fixRenamedLayerKeys(modeConfig, { label: `up.layer.config.${mode}` });
|
|
1047
|
+
};
|
|
994
1048
|
Object.defineProperty(up.Layer.prototype, 'historyVisible', { get: function () {
|
|
995
1049
|
up.migrate.deprecated('up.Layer#historyVisible', 'up.Layer#history');
|
|
996
1050
|
return this.history;
|
|
@@ -1001,6 +1055,16 @@ Object.defineProperty(up.Layer.prototype, 'historyVisible', { get: function () {
|
|
|
1001
1055
|
/* 19 */
|
|
1002
1056
|
/***/ (() => {
|
|
1003
1057
|
|
|
1058
|
+
up.motion.isEnabled = function () {
|
|
1059
|
+
up.migrate.deprecated('up.motion.isEnabled()', 'up.motion.config.enabled');
|
|
1060
|
+
return up.motion.config.enabled;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
/***/ }),
|
|
1065
|
+
/* 20 */
|
|
1066
|
+
/***/ (() => {
|
|
1067
|
+
|
|
1004
1068
|
const FLAVORS_ERROR = new Error('up.modal.flavors has been removed without direct replacement. You may give new layers a { class } or modify layer elements on up:layer:open.');
|
|
1005
1069
|
up.modal = {
|
|
1006
1070
|
visit(url, options = {}) {
|
|
@@ -1008,12 +1072,12 @@ up.modal = {
|
|
|
1008
1072
|
return up.layer.open(Object.assign(Object.assign({}, options), { url, mode: 'modal' }));
|
|
1009
1073
|
},
|
|
1010
1074
|
follow(link, options = {}) {
|
|
1011
|
-
up.migrate.deprecated('up.modal.follow(link)', 'up.follow(link, { layer: "modal" })');
|
|
1012
|
-
return up.follow(link, Object.assign(Object.assign({}, options), { layer: 'modal' }));
|
|
1075
|
+
up.migrate.deprecated('up.modal.follow(link)', 'up.follow(link, { layer: "new modal" })');
|
|
1076
|
+
return up.follow(link, Object.assign(Object.assign({}, options), { layer: 'new', mode: 'modal' }));
|
|
1013
1077
|
},
|
|
1014
1078
|
extract(target, html, options = {}) {
|
|
1015
1079
|
up.migrate.deprecated('up.modal.extract(target, document)', 'up.layer.open({ document, mode: "modal" })');
|
|
1016
|
-
return up.layer.open(Object.assign(Object.assign({}, options), { target, html, layer: 'modal' }));
|
|
1080
|
+
return up.layer.open(Object.assign(Object.assign({}, options), { target, document: html, layer: 'new', mode: 'modal' }));
|
|
1017
1081
|
},
|
|
1018
1082
|
close(options = {}) {
|
|
1019
1083
|
up.migrate.deprecated('up.modal.close()', 'up.layer.dismiss()');
|
|
@@ -1048,23 +1112,24 @@ up.modal = {
|
|
|
1048
1112
|
throw FLAVORS_ERROR;
|
|
1049
1113
|
}
|
|
1050
1114
|
};
|
|
1115
|
+
Object.defineProperty(up.modal, 'config', { enumerable: false });
|
|
1051
1116
|
up.migrate.renamedEvent('up:modal:open', 'up:layer:open');
|
|
1052
1117
|
up.migrate.renamedEvent('up:modal:opened', 'up:layer:opened');
|
|
1053
1118
|
up.migrate.renamedEvent('up:modal:close', 'up:layer:dismiss');
|
|
1054
1119
|
up.migrate.renamedEvent('up:modal:closed', 'up:layer:dismissed');
|
|
1055
|
-
up.migrate.targetMacro('up-modal', { 'up-layer': 'new modal' },
|
|
1056
|
-
up.migrate.targetMacro('up-drawer', { 'up-layer': 'new drawer' },
|
|
1120
|
+
up.migrate.targetMacro('up-modal', { 'up-layer': 'new modal' }, '[up-layer="new modal"]');
|
|
1121
|
+
up.migrate.targetMacro('up-drawer', { 'up-layer': 'new drawer' }, '[up-layer="new drawer"]');
|
|
1057
1122
|
|
|
1058
1123
|
|
|
1059
1124
|
/***/ }),
|
|
1060
|
-
/*
|
|
1125
|
+
/* 21 */
|
|
1061
1126
|
/***/ (() => {
|
|
1062
1127
|
|
|
1063
1128
|
up.popup = {
|
|
1064
1129
|
attach(origin, options = {}) {
|
|
1065
1130
|
origin = up.fragment.get(origin);
|
|
1066
|
-
up.migrate.deprecated('up.popup.attach(origin)', "up.layer.open({ origin,
|
|
1067
|
-
return up.layer.open(Object.assign(Object.assign({}, options), { origin, layer: 'popup' }));
|
|
1131
|
+
up.migrate.deprecated('up.popup.attach(origin)', "up.layer.open({ origin, mode: 'popup' })");
|
|
1132
|
+
return up.layer.open(Object.assign(Object.assign({}, options), { origin, layer: 'new', mode: 'popup' }));
|
|
1068
1133
|
},
|
|
1069
1134
|
close(options = {}) {
|
|
1070
1135
|
up.migrate.deprecated('up.popup.close()', 'up.layer.dismiss()');
|
|
@@ -1097,25 +1162,26 @@ up.popup = {
|
|
|
1097
1162
|
return up.layer.sync();
|
|
1098
1163
|
}
|
|
1099
1164
|
};
|
|
1165
|
+
Object.defineProperty(up.popup, 'config', { enumerable: false });
|
|
1100
1166
|
up.migrate.renamedEvent('up:popup:open', 'up:layer:open');
|
|
1101
1167
|
up.migrate.renamedEvent('up:popup:opened', 'up:layer:opened');
|
|
1102
1168
|
up.migrate.renamedEvent('up:popup:close', 'up:layer:dismiss');
|
|
1103
1169
|
up.migrate.renamedEvent('up:popup:closed', 'up:layer:dismissed');
|
|
1104
|
-
up.migrate.targetMacro('up-popup', { 'up-layer': 'new popup' },
|
|
1170
|
+
up.migrate.targetMacro('up-popup', { 'up-layer': 'new popup' }, '[up-layer="new popup"]');
|
|
1105
1171
|
|
|
1106
1172
|
|
|
1107
1173
|
/***/ }),
|
|
1108
|
-
/*
|
|
1174
|
+
/* 22 */
|
|
1109
1175
|
/***/ (() => {
|
|
1110
1176
|
|
|
1111
1177
|
up.macro('[up-tooltip]', function (opener) {
|
|
1112
|
-
up.migrate.warn('[up-tooltip] has been deprecated.
|
|
1178
|
+
up.migrate.warn('Attribute [up-tooltip] has been deprecated. Use a [title] attribute instead (found in %o).', opener);
|
|
1113
1179
|
up.element.setMissingAttr(opener, 'title', opener.getAttribute('up-tooltip'));
|
|
1114
1180
|
});
|
|
1115
1181
|
|
|
1116
1182
|
|
|
1117
1183
|
/***/ }),
|
|
1118
|
-
/*
|
|
1184
|
+
/* 23 */
|
|
1119
1185
|
/***/ (() => {
|
|
1120
1186
|
|
|
1121
1187
|
up.migrate.clearCacheFromXHR = function (xhr) {
|
|
@@ -1137,7 +1203,7 @@ up.migrate.titleFromXHR = function (xhr) {
|
|
|
1137
1203
|
return false;
|
|
1138
1204
|
}
|
|
1139
1205
|
else if (value[0] !== '"' && value[0] !== "'") {
|
|
1140
|
-
up.migrate.warn('X-Up-Title must now be a JSON-encoded string');
|
|
1206
|
+
up.migrate.warn('X-Up-Title must now be a JSON-encoded string (got %o)', value);
|
|
1141
1207
|
return value;
|
|
1142
1208
|
}
|
|
1143
1209
|
}
|
|
@@ -1159,7 +1225,7 @@ up.protocol.config.patch(function () {
|
|
|
1159
1225
|
|
|
1160
1226
|
|
|
1161
1227
|
/***/ }),
|
|
1162
|
-
/*
|
|
1228
|
+
/* 24 */
|
|
1163
1229
|
/***/ (() => {
|
|
1164
1230
|
|
|
1165
1231
|
const u = up.util;
|
|
@@ -1189,26 +1255,38 @@ up.network.config.patch(function (config) {
|
|
|
1189
1255
|
});
|
|
1190
1256
|
});
|
|
1191
1257
|
up.network.config.patch(function (config) {
|
|
1192
|
-
up.migrate.renamedProperty(config, 'maxRequests', 'concurrency');
|
|
1193
|
-
up.migrate.renamedProperty(config, 'slowDelay', 'lateDelay');
|
|
1194
|
-
up.migrate.renamedProperty(config, 'cacheExpiry', 'cacheExpireAge', 'The configuration up.network.config.cacheExpiry has been renamed to up.network.config.cacheExpireAge. Note that Unpoly 3+ automatically reloads cached content after rendering to ensure users always see fresh data ("cache revalidation"). Setting a custom expiry may no longer be necessary.');
|
|
1195
|
-
up.migrate.renamedProperty(config, 'clearCache', 'expireCache');
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1258
|
+
up.migrate.renamedProperty(config, 'maxRequests', 'concurrency', { label: 'up.network.config' });
|
|
1259
|
+
up.migrate.renamedProperty(config, 'slowDelay', 'lateDelay', { label: 'up.network.config' });
|
|
1260
|
+
up.migrate.renamedProperty(config, 'cacheExpiry', 'cacheExpireAge', { warning: 'The configuration up.network.config.cacheExpiry has been renamed to up.network.config.cacheExpireAge. Note that Unpoly 3+ automatically reloads cached content after rendering to ensure users always see fresh data ("cache revalidation"). Setting a custom expiry may no longer be necessary.' });
|
|
1261
|
+
up.migrate.renamedProperty(config, 'clearCache', 'expireCache', { label: 'up.network.config' });
|
|
1262
|
+
let cacheSize = config.cacheSize;
|
|
1263
|
+
Object.defineProperty(config, 'cacheSize', {
|
|
1264
|
+
configurable: true,
|
|
1265
|
+
get() {
|
|
1266
|
+
return cacheSize;
|
|
1267
|
+
},
|
|
1268
|
+
set(newValue) {
|
|
1269
|
+
if (newValue === 0) {
|
|
1270
|
+
up.migrate.deprecated('up.network.config.cacheSize = 0', 'up.network.config.cacheEnabled = false');
|
|
1271
|
+
config.cacheEnabled = false;
|
|
1272
|
+
}
|
|
1273
|
+
cacheSize = newValue;
|
|
1274
|
+
}
|
|
1275
|
+
});
|
|
1276
|
+
up.migrate.removedProperty(config, 'requestMetaKeys', { value: [], warning: 'The configuration up.network.config.requestMetaKeys has been removed. Servers that optimize responses based on request headers should instead set a Vary response header.' });
|
|
1199
1277
|
});
|
|
1200
1278
|
up.migrate.handleRequestOptions = function (options) {
|
|
1201
|
-
up.migrate.fixKey(options, 'clearCache', 'expireCache');
|
|
1279
|
+
up.migrate.fixKey(options, 'clearCache', 'expireCache', { label: 'request options', detail: options.url });
|
|
1202
1280
|
if (options.solo) {
|
|
1203
1281
|
up.migrate.warn('The option up.request({ solo }) has been removed. Use up.network.abort() or up.fragment.abort() instead.');
|
|
1204
1282
|
}
|
|
1205
1283
|
};
|
|
1206
1284
|
up.on('up:request:loaded', function (event) {
|
|
1207
|
-
if (event.response.
|
|
1208
|
-
up.migrate.warn('The server can no longer
|
|
1285
|
+
if (event.response.header('X-Up-Expire-Cache') === 'false') {
|
|
1286
|
+
up.migrate.warn('The server can no longer prevent cache expiration with an `X-Up-Expire-Cache: false` response header. The header has no effect and can be removed.');
|
|
1209
1287
|
}
|
|
1210
|
-
if (event.response.
|
|
1211
|
-
up.migrate.warn('The server can no longer
|
|
1288
|
+
if (event.response.header('X-Up-Evict-Cache') === 'false') {
|
|
1289
|
+
up.migrate.warn('The server can no longer prevent cache eviction with an `X-Up-Evict-Cache: false` response header. The header has no effect and can be removed.');
|
|
1212
1290
|
}
|
|
1213
1291
|
});
|
|
1214
1292
|
up.ajax = function (...args) {
|
|
@@ -1242,8 +1320,8 @@ up.Request.prototype.navigate = function () {
|
|
|
1242
1320
|
up.migrate.deprecated('up.Request#navigate()', 'up.Request#loadPage()');
|
|
1243
1321
|
this.loadPage();
|
|
1244
1322
|
};
|
|
1245
|
-
up.migrate.renamedProperty(up.Request.prototype, 'preload', 'background');
|
|
1246
|
-
up.migrate.renamedProperty(up.Request.prototype, 'badResponseTime', 'lateDelay');
|
|
1323
|
+
up.migrate.renamedProperty(up.Request.prototype, 'preload', 'background', { warning: 'Property up.Request#preload has been renamed to up.Request#background' });
|
|
1324
|
+
up.migrate.renamedProperty(up.Request.prototype, 'badResponseTime', 'lateDelay', { warning: 'Property up.Request#badResponseTime has been renamed to up.Request#lateDelay' });
|
|
1247
1325
|
up.Response.prototype.isSuccess = function () {
|
|
1248
1326
|
up.migrate.deprecated('up.Response#isSuccess()', 'up.Response#ok');
|
|
1249
1327
|
return this.ok;
|
|
@@ -1264,7 +1342,7 @@ const progressBarDefault = up.network.config.progressBar;
|
|
|
1264
1342
|
up.network.config.patch(function (config) {
|
|
1265
1343
|
config.progressBar = function () {
|
|
1266
1344
|
if (mayHaveCustomIndicator()) {
|
|
1267
|
-
up.migrate.warn('Disabled the default progress bar as may have built a custom loading indicator with your up:network:late listener. Please set up.network.config.progressBar to true or false.');
|
|
1345
|
+
up.migrate.warn('Disabled the default progress bar as you may have built a custom loading indicator with your up:network:late listener. Please set up.network.config.progressBar to true or false.');
|
|
1268
1346
|
return false;
|
|
1269
1347
|
}
|
|
1270
1348
|
else {
|
|
@@ -1273,28 +1351,27 @@ up.network.config.patch(function (config) {
|
|
|
1273
1351
|
};
|
|
1274
1352
|
});
|
|
1275
1353
|
up.network.shouldReduceRequests = function () {
|
|
1276
|
-
up.migrate('up.network.shouldReduceRequests() has been removed without replacement');
|
|
1354
|
+
up.migrate.warn('up.network.shouldReduceRequests() has been removed without replacement');
|
|
1277
1355
|
return false;
|
|
1278
1356
|
};
|
|
1279
1357
|
up.network.config.patch(function (config) {
|
|
1280
|
-
up.migrate.removedProperty(config, 'badRTT');
|
|
1281
|
-
up.migrate.removedProperty(config, 'badDownlink');
|
|
1282
|
-
up.migrate.renamedProperty(config, 'badResponseTime', 'lateDelay');
|
|
1358
|
+
up.migrate.removedProperty(config, 'badRTT', { label: 'up.network.config' });
|
|
1359
|
+
up.migrate.removedProperty(config, 'badDownlink', { label: 'up.network.config' });
|
|
1360
|
+
up.migrate.renamedProperty(config, 'badResponseTime', 'lateDelay', { label: 'up.network.config' });
|
|
1283
1361
|
});
|
|
1284
1362
|
|
|
1285
1363
|
|
|
1286
1364
|
/***/ }),
|
|
1287
|
-
/*
|
|
1365
|
+
/* 25 */
|
|
1288
1366
|
/***/ (() => {
|
|
1289
1367
|
|
|
1290
1368
|
const e = up.element;
|
|
1291
1369
|
up.radio.config.patch(function (config) {
|
|
1292
|
-
up.migrate.renamedProperty(config, 'hungry', 'hungrySelectors');
|
|
1370
|
+
up.migrate.renamedProperty(config, 'hungry', 'hungrySelectors', { label: 'up.radio.config' });
|
|
1293
1371
|
});
|
|
1294
|
-
up.radio.config.pollEnabled = true;
|
|
1295
1372
|
let pollEnabledRef;
|
|
1296
1373
|
up.radio.config.patch(function (config) {
|
|
1297
|
-
pollEnabledRef = up.migrate.removedProperty(config, 'pollEnabled', 'The configuration up.radio.config.pollEnabled has been removed. To disable polling, prevent up:fragment:poll instead.');
|
|
1374
|
+
pollEnabledRef = up.migrate.removedProperty(config, 'pollEnabled', { value: true, warning: 'The configuration up.radio.config.pollEnabled has been removed. To disable polling, prevent up:fragment:poll instead.' });
|
|
1298
1375
|
});
|
|
1299
1376
|
up.on('up:fragment:poll', function (event) {
|
|
1300
1377
|
if (!pollEnabledRef[0]) {
|
|
@@ -1305,6 +1382,7 @@ up.compiler('[up-hungry][up-if-history]', function (element) {
|
|
|
1305
1382
|
let ifHistory = e.booleanAttr(element, 'up-if-history');
|
|
1306
1383
|
if (!ifHistory)
|
|
1307
1384
|
return;
|
|
1385
|
+
up.migrate.warn('Attribute [up-if-history] has been deprecated. Use [up-on-hungry="if (!renderOptions.history) event.preventDefault()"] instead (found in %o).', element);
|
|
1308
1386
|
element.addEventListener('up:fragment:hungry', function (event) {
|
|
1309
1387
|
if (!event.renderOptions.history) {
|
|
1310
1388
|
event.preventDefault();
|
|
@@ -1314,17 +1392,17 @@ up.compiler('[up-hungry][up-if-history]', function (element) {
|
|
|
1314
1392
|
|
|
1315
1393
|
|
|
1316
1394
|
/***/ }),
|
|
1317
|
-
/*
|
|
1395
|
+
/* 26 */
|
|
1318
1396
|
/***/ (() => {
|
|
1319
1397
|
|
|
1320
1398
|
up.migrate.renamedPackage('layout', 'viewport');
|
|
1321
1399
|
up.viewport.config.patch(function (config) {
|
|
1322
|
-
up.migrate.renamedProperty(config, 'viewports', 'viewportSelectors');
|
|
1323
|
-
up.migrate.renamedProperty(config, 'fixedTop', 'fixedTopSelectors');
|
|
1324
|
-
up.migrate.renamedProperty(config, 'fixedBottom', 'fixedBottomSelectors');
|
|
1325
|
-
up.migrate.renamedProperty(config, 'anchoredRight', 'anchoredRightSelectors');
|
|
1326
|
-
up.migrate.renamedProperty(config, 'snap', 'revealSnap');
|
|
1327
|
-
up.migrate.removedProperty(config, 'scrollSpeed');
|
|
1400
|
+
up.migrate.renamedProperty(config, 'viewports', 'viewportSelectors', { label: 'up.viewport.config' });
|
|
1401
|
+
up.migrate.renamedProperty(config, 'fixedTop', 'fixedTopSelectors', { label: 'up.viewport.config' });
|
|
1402
|
+
up.migrate.renamedProperty(config, 'fixedBottom', 'fixedBottomSelectors', { label: 'up.viewport.config' });
|
|
1403
|
+
up.migrate.renamedProperty(config, 'anchoredRight', 'anchoredRightSelectors', { label: 'up.viewport.config' });
|
|
1404
|
+
up.migrate.renamedProperty(config, 'snap', 'revealSnap', { label: 'up.viewport.config' });
|
|
1405
|
+
up.migrate.removedProperty(config, 'scrollSpeed', { label: 'up.viewport.config' });
|
|
1328
1406
|
});
|
|
1329
1407
|
up.viewport.closest = function (...args) {
|
|
1330
1408
|
up.migrate.deprecated('up.viewport.closest()', 'up.viewport.get()');
|
|
@@ -1395,6 +1473,7 @@ __webpack_require__(22);
|
|
|
1395
1473
|
__webpack_require__(23);
|
|
1396
1474
|
__webpack_require__(24);
|
|
1397
1475
|
__webpack_require__(25);
|
|
1476
|
+
__webpack_require__(26);
|
|
1398
1477
|
up.framework.stopExtension();
|
|
1399
1478
|
|
|
1400
1479
|
})();
|