Skip to content

refactor custom element definitions being shared #24

@thescientist13

Description

@thescientist13

Type of Change

  • Other (please clarify below)

Summary

As encountered in #21 , it was determined through mocha testing that having definitions outside of any function, would effectively act as a global variable between runs, or otherwise cause caching issues in NodeJS between renderToString calls.

Details

I had always wanted a better way to code this initially as definitions is updated / read globally by all those functions, so is effectively global state, which is not idea. And as revealed in that PR and verified in mochajs/mocha#1637, this causes odd behaviors.

So basically we need to get rid of let definitions as a shared variable, and still somehow make it all work. Also open to using better data structures if it fits, like a Map or Set.

Also seeing an issue in Greenwood when using metadata for hydration it was breaking GitHub Actions on Windows. 😬

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions