Skip to content

Commit 89198db

Browse files
authored
fix(ssr): remove dev-only accessor warnings (#5135)
1 parent a081d0d commit 89198db

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/@lwc/engine-core/src/framework/base-bridge-element.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ export function HTMLBridgeElementFactory(
150150
const descriptors: PropertyDescriptorMap = create(null);
151151

152152
// present a hint message so that developers are aware that they have not decorated property with @api
153-
if (process.env.NODE_ENV !== 'production') {
153+
// Note that we also don't do this in SSR because we cannot sniff for what props are declared on
154+
// HTMLElementPrototype, and it seems not worth it to have these dev-only warnings there, since
155+
// an `in` check could mistakenly assume that a prop is declared on a LightningElement prototype.
156+
if (process.env.NODE_ENV !== 'production' && process.env.IS_BROWSER) {
154157
// TODO [#3761]: enable for components that don't extend from LightningElement
155158
if (!isUndefined(proto) && !isNull(proto) && !hasCustomSuperClass) {
156159
const nonPublicPropertiesToWarnOn = new Set(

packages/@lwc/engine-server/src/__tests__/fixtures/attribute-global-html/as-component-prop/without-@api/expected.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<x-component>
22
<template shadowrootmode="open">
3-
<x-child aria-activedescendant="foo" aria-atomic="foo" aria-autocomplete="foo" aria-busy="foo" aria-checked="foo" aria-colcount="foo" aria-colindex="foo" aria-colspan="foo" aria-controls="foo" aria-current="foo" aria-describedby="foo" aria-details="foo" aria-disabled="foo" aria-errormessage="foo" aria-expanded="foo" aria-flowto="foo" aria-haspopup="foo" aria-hidden="foo" aria-invalid="foo" aria-keyshortcuts="foo" aria-label="foo" aria-labelledby="foo" aria-level="foo" aria-live="foo" aria-modal="foo" aria-multiline="foo" aria-multiselectable="foo" aria-orientation="foo" aria-owns="foo" aria-placeholder="foo" aria-posinset="foo" aria-pressed="foo" aria-readonly="foo" aria-relevant="foo" aria-required="foo" aria-roledescription="foo" aria-rowcount="foo" aria-rowindex="foo" aria-rowspan="foo" aria-selected="foo" aria-setsize="foo" aria-sort="foo" aria-valuemax="foo" aria-valuemin="foo" aria-valuenow="foo" aria-valuetext="foo" exportparts="foo" role="foo">
3+
<x-child accesskey="foo" aria-activedescendant="foo" aria-atomic="foo" aria-autocomplete="foo" aria-busy="foo" aria-checked="foo" aria-colcount="foo" aria-colindex="foo" aria-colspan="foo" aria-controls="foo" aria-current="foo" aria-describedby="foo" aria-details="foo" aria-disabled="foo" aria-errormessage="foo" aria-expanded="foo" aria-flowto="foo" aria-haspopup="foo" aria-hidden="foo" aria-invalid="foo" aria-keyshortcuts="foo" aria-label="foo" aria-labelledby="foo" aria-level="foo" aria-live="foo" aria-modal="foo" aria-multiline="foo" aria-multiselectable="foo" aria-orientation="foo" aria-owns="foo" aria-placeholder="foo" aria-posinset="foo" aria-pressed="foo" aria-readonly="foo" aria-relevant="foo" aria-required="foo" aria-roledescription="foo" aria-rowcount="foo" aria-rowindex="foo" aria-rowspan="foo" aria-selected="foo" aria-setsize="foo" aria-sort="foo" aria-valuemax="foo" aria-valuemin="foo" aria-valuenow="foo" aria-valuetext="foo" dir="foo" draggable="foo" exportparts="foo" id="foo" lang="foo" role="foo" spellcheck="foo" tabindex="foo" title="foo">
44
<template shadowrootmode="open">
55
<span>
66
accessKey:

0 commit comments

Comments
 (0)