🗑 add warning for deprecated apis (#1836)

* 🗑 add warning for deprecated apis

* 💚 remove 12.x version in ci for compatible
This commit is contained in:
Kuitos 2021-11-25 11:43:01 +08:00 committed by GitHub
parent 80f7c786bb
commit 4691c652ec
3 changed files with 14 additions and 3 deletions

View File

@ -14,7 +14,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [12.x, 14.x] node-version: [14.x, 16.x]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2

View File

@ -20,6 +20,10 @@ function emitGlobal(state: Record<string, any>, prevState: Record<string, any>)
} }
export function initGlobalState(state: Record<string, any> = {}) { export function initGlobalState(state: Record<string, any> = {}) {
if (process.env.NODE_ENV === 'development') {
console.warn(`[qiankun] globalState tools will be removed in 3.0, pls don't use it!`);
}
if (state === globalState) { if (state === globalState) {
console.warn('[qiankun] state has not changed'); console.warn('[qiankun] state has not changed');
} else { } else {

View File

@ -156,8 +156,8 @@ function getRender(appName: string, appContent: string, legacyRender?: HTMLConte
const render: ElementRender = ({ element, loading, container }, phase) => { const render: ElementRender = ({ element, loading, container }, phase) => {
if (legacyRender) { if (legacyRender) {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
console.warn( console.error(
'[qiankun] Custom rendering function is deprecated, you can use the container element setting instead!', '[qiankun] Custom rendering function is deprecated and will be removed in 3.0, you can use the container element setting instead!',
); );
} }
@ -275,6 +275,13 @@ export async function loadApp<T extends ObjectType>(
const appContent = getDefaultTplWrapper(appInstanceId, appName)(template); const appContent = getDefaultTplWrapper(appInstanceId, appName)(template);
const strictStyleIsolation = typeof sandbox === 'object' && !!sandbox.strictStyleIsolation; const strictStyleIsolation = typeof sandbox === 'object' && !!sandbox.strictStyleIsolation;
if (process.env.NODE_ENV === 'development' && strictStyleIsolation) {
console.warn(
"[qiankun] strictStyleIsolation configuration will be removed in 3.0, pls don't depend on it or use experimentalStyleIsolation instead!",
);
}
const scopedCSS = isEnableScopedCSS(sandbox); const scopedCSS = isEnableScopedCSS(sandbox);
let initialAppWrapperElement: HTMLElement | null = createElement( let initialAppWrapperElement: HTMLElement | null = createElement(
appContent, appContent,