lwc icon indicating copy to clipboard operation
lwc copied to clipboard

OSS compiler throws when accessing non public API from the engine

Open pmdartus opened this issue 6 years ago • 4 comments

Description

In order to test the @lwc/engine test files need access to some of the @lwc/engine protected APIs like isNodeFromTemplate. However, the OSS compiler throws when accessing those APIs.

import { isNodeFromTemplate } from 'lwc';
//       ^ Compilation Error: isNodeFromTemplate is not exported by lwc

I generally think we should not try to restrict the during the OSS compilation what API can be accessed. It can be restricted migrating the checks in eslint rules. Those rules can then be disabled in some specific cases (e.g. testing the engine internals).

Version

  • LWC: 0.35.4

pmdartus avatar Jan 24 '19 13:01 pmdartus

@pmdartus is this issue still relevant today?

ekashida avatar Feb 02 '22 16:02 ekashida

Yes, it's still an issue. We should move this restriction to an ESLint rule.

pmdartus avatar Feb 02 '22 17:02 pmdartus

Yes please!

caridy avatar Feb 03 '22 19:02 caridy

This issue has been linked to a new work item: W-10536242

uip-robot-zz avatar Feb 03 '22 21:02 uip-robot-zz