salesforce / lwc

⚡️ LWC - A Blazing Fast, Enterprise-Grade Web Components Foundation
https://lwc.dev
Other
1.63k stars 394 forks source link

OSS compiler throws when accessing non public API from the engine #1009

Open pmdartus opened 5 years ago

pmdartus commented 5 years ago

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

ekashida commented 2 years ago

@pmdartus is this issue still relevant today?

pmdartus commented 2 years ago

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

caridy commented 2 years ago

Yes please!

uip-robot-zz commented 2 years ago

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