twig.js
twig.js copied to clipboard
Switch to Module Pattern (replace Twig global)
@RobLoach
Each of the files simply serve to build up the Twig
god object.
What was the rationale behind this design? God objects are considered to be an anti-pattern.
God is an anti-pattern :smiling_imp:
Likely legacy, for allowing acting on a global through the web browser. Packages like Browserify and webpack can fix that pattern for us. Would be good to switch to ES6 modules across all the files.
There were mentions of a 2.0.0 release in other topics and PRs. The 2.0.0 release should breakup the global object into modules as part of the changes, would you agree?
We can wait on a 2.x for this, yes.