author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1 |
/******/ (() => { // webpackBootstrap |
19 | 2 |
/******/ "use strict"; |
3 |
/******/ // The require scope |
|
4 |
/******/ var __webpack_require__ = {}; |
|
5 |
/******/ |
|
6 |
/************************************************************************/ |
|
7 |
/******/ /* webpack/runtime/define property getters */ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
8 |
/******/ (() => { |
19 | 9 |
/******/ // define getter functions for harmony exports |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
10 |
/******/ __webpack_require__.d = (exports, definition) => { |
19 | 11 |
/******/ for(var key in definition) { |
12 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
|
13 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
|
14 |
/******/ } |
|
15 |
/******/ } |
|
9 | 16 |
/******/ }; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
17 |
/******/ })(); |
19 | 18 |
/******/ |
19 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
20 |
/******/ (() => { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
21 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
22 |
/******/ })(); |
19 | 23 |
/******/ |
9 | 24 |
/************************************************************************/ |
19 | 25 |
var __webpack_exports__ = {}; |
9 | 26 |
|
19 | 27 |
// EXPORTS |
28 |
__webpack_require__.d(__webpack_exports__, { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
29 |
"default": () => (/* binding */ deprecated) |
19 | 30 |
}); |
31 |
||
32 |
// UNUSED EXPORTS: logged |
|
33 |
||
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
34 |
;// external ["wp","hooks"] |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
35 |
const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
36 |
;// ./node_modules/@wordpress/deprecated/build-module/index.js |
9 | 37 |
/** |
38 |
* WordPress dependencies |
|
39 |
*/ |
|
40 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
41 |
|
9 | 42 |
/** |
43 |
* Object map tracking messages which have been logged, for use in ensuring a |
|
44 |
* message is only logged once. |
|
45 |
* |
|
18 | 46 |
* @type {Record<string, true | undefined>} |
9 | 47 |
*/ |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
48 |
const logged = Object.create(null); |
9 | 49 |
|
50 |
/** |
|
51 |
* Logs a message to notify developers about a deprecated feature. |
|
52 |
* |
|
18 | 53 |
* @param {string} feature Name of the deprecated feature. |
54 |
* @param {Object} [options] Personalisation options |
|
55 |
* @param {string} [options.since] Version in which the feature was deprecated. |
|
56 |
* @param {string} [options.version] Version in which the feature will be removed. |
|
57 |
* @param {string} [options.alternative] Feature to use instead |
|
58 |
* @param {string} [options.plugin] Plugin name if it's a plugin feature |
|
59 |
* @param {string} [options.link] Link to documentation |
|
60 |
* @param {string} [options.hint] Additional message to help transition away from the deprecated feature. |
|
9 | 61 |
* |
62 |
* @example |
|
63 |
* ```js |
|
64 |
* import deprecated from '@wordpress/deprecated'; |
|
65 |
* |
|
66 |
* deprecated( 'Eating meat', { |
|
18 | 67 |
* since: '2019.01.01' |
68 |
* version: '2020.01.01', |
|
9 | 69 |
* alternative: 'vegetables', |
70 |
* plugin: 'the earth', |
|
71 |
* hint: 'You may find it beneficial to transition gradually.', |
|
72 |
* } ); |
|
73 |
* |
|
18 | 74 |
* // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.' |
9 | 75 |
* ``` |
76 |
*/ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
77 |
function deprecated(feature, options = {}) { |
18 | 78 |
const { |
79 |
since, |
|
80 |
version, |
|
81 |
alternative, |
|
82 |
plugin, |
|
83 |
link, |
|
84 |
hint |
|
85 |
} = options; |
|
86 |
const pluginMessage = plugin ? ` from ${plugin}` : ''; |
|
87 |
const sinceMessage = since ? ` since version ${since}` : ''; |
|
88 |
const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : ''; |
|
89 |
const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : ''; |
|
90 |
const linkMessage = link ? ` See: ${link}` : ''; |
|
91 |
const hintMessage = hint ? ` Note: ${hint}` : ''; |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
92 |
const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`; |
9 | 93 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
94 |
// Skip if already logged. |
9 | 95 |
if (message in logged) { |
96 |
return; |
|
97 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
98 |
|
9 | 99 |
/** |
100 |
* Fires whenever a deprecated feature is encountered |
|
101 |
* |
|
102 |
* @param {string} feature Name of the deprecated feature. |
|
103 |
* @param {?Object} options Personalisation options |
|
18 | 104 |
* @param {string} options.since Version in which the feature was deprecated. |
9 | 105 |
* @param {?string} options.version Version in which the feature will be removed. |
106 |
* @param {?string} options.alternative Feature to use instead |
|
107 |
* @param {?string} options.plugin Plugin name if it's a plugin feature |
|
108 |
* @param {?string} options.link Link to documentation |
|
109 |
* @param {?string} options.hint Additional message to help transition away from the deprecated feature. |
|
110 |
* @param {?string} message Message sent to console.warn |
|
111 |
*/ |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
112 |
(0,external_wp_hooks_namespaceObject.doAction)('deprecated', feature, options, message); |
9 | 113 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
114 |
// eslint-disable-next-line no-console |
9 | 115 |
console.warn(message); |
116 |
logged[message] = true; |
|
117 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
118 |
|
18 | 119 |
/** @typedef {import('utility-types').NonUndefined<Parameters<typeof deprecated>[1]>} DeprecatedOptions */ |
9 | 120 |
|
19 | 121 |
(window.wp = window.wp || {}).deprecated = __webpack_exports__["default"]; |
122 |
/******/ })() |
|
123 |
; |