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

Switch to Module Pattern (replace Twig global) #622

Open
PolyPik opened this issue May 8, 2019 · 3 comments
Open

Switch to Module Pattern (replace Twig global) #622

PolyPik opened this issue May 8, 2019 · 3 comments

Comments

@PolyPik
Copy link
Contributor

PolyPik commented May 8, 2019

@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.

@PolyPik PolyPik changed the title Why does this library center around a "god object"? Why does this package center around a "god object"? May 8, 2019
@RobLoach
Copy link
Collaborator

RobLoach commented May 8, 2019

God is an anti-pattern 😈

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.

@RobLoach RobLoach changed the title Why does this package center around a "god object"? Switch to Module Pattern (replace Twig global) May 8, 2019
@PolyPik
Copy link
Contributor Author

PolyPik commented May 16, 2019

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?

@RobLoach
Copy link
Collaborator

We can wait on a 2.x for this, yes.

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

No branches or pull requests

3 participants