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

MJSON objects are instantiated when the file is loaded, not required #2008

Open
cdebost opened this issue Feb 6, 2019 · 0 comments
Open

Comments

@cdebost
Copy link
Collaborator

cdebost commented Feb 6, 2019

JS files are processed in two steps: first the file's text is put into memory on load, and then the contents are actually executed when the file is required. MJSON files, however, are both loaded and executed on load.

This causes issues in mop, which has to load modules but does not want to execute them, as there may be some runtime-only logic in object constructors that could crash the build. Objects should be instantiated on require instead.

A temporary work around for mop is in montagejs/mop#94

@cdebost cdebost added this to the v18.2.0 new APIs/Features milestone Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant