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

libraries used to create MVC frameworks should not do top level DOM access #3207

Closed
lillallol opened this issue Aug 10, 2022 · 1 comment
Closed

Comments

@lillallol
Copy link

lillallol commented Aug 10, 2022

Which package is this a feature request for?

Lit Core (lit / lit-html / lit-element / reactive-element)

Description

lit-html can be used to create client side MVC frameworks (e.g. MobX + lit-html + web components). When creating an MVC app, it is natural to create tests that deal purely with the model of the app and hence no need for DOM. However, top level DOM access of lit-html prevents those tests from getting executed in nodejs.

Alternatives and Workarounds

  1. The MVC entry point has to split in two entry points, one for the pure-model, i.e. not top level DOM access, and one for the non-model (this increases complexity).
  2. Manually edit lit-html so that it does not do top level DOM access (tried it, and failed, maybe I should try more).
  3. Execute tests in browser (this increases complexity).
@justinfagnani
Copy link
Collaborator

This is fixed by #3156

On the next release there will be an export condition named "node" that will be used in Node versions that support package exports (newer than v13.7.0 or v12.16.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants