lwc
lwc copied to clipboard
OSS compiler throws when accessing non public API from the engine
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 is this issue still relevant today?
Yes, it's still an issue. We should move this restriction to an ESLint rule.
Yes please!
This issue has been linked to a new work item: W-10536242