Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(engine-core): remove unnecessary props/attrs assertions #2639

Merged
merged 1 commit into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions packages/@lwc/engine-core/src/framework/modules/attrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import { assert, isNull, isUndefined, keys, StringCharCodeAt } from '@lwc/shared';
import { isNull, isUndefined, StringCharCodeAt } from '@lwc/shared';

import { setAttribute, removeAttribute } from '../../renderer';
import { VElement } from '../../3rdparty/snabbdom/types';
Expand All @@ -27,13 +27,6 @@ export function patchAttributes(oldVnode: VElement | null, vnode: VElement) {
return;
}

if (process.env.NODE_ENV !== 'production') {
assert.invariant(
oldAttrs === EmptyObject || keys(oldAttrs).join(',') === keys(attrs).join(','),
`vnode.data.attrs cannot change shape.`
);
}

const { elm } = vnode;
for (const key in attrs) {
const cur = attrs[key];
Expand Down
9 changes: 1 addition & 8 deletions packages/@lwc/engine-core/src/framework/modules/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import { assert, isNull, isUndefined, keys } from '@lwc/shared';
import { isNull, isUndefined } from '@lwc/shared';

import { getProperty, setProperty } from '../../renderer';
import { VElement } from '../../3rdparty/snabbdom/types';
Expand All @@ -28,13 +28,6 @@ export function patchProps(oldVnode: VElement | null, vnode: VElement) {
return;
}

if (process.env.NODE_ENV !== 'production') {
assert.invariant(
oldProps === EmptyObject || keys(oldProps).join(',') === keys(props).join(','),
'vnode.data.props cannot change shape.'
);
}

const isFirstPatch = isNull(oldVnode);
const { elm, sel } = vnode;

Expand Down