Removing MODULARIZE_INSTANCE

21 views
Skip to first unread message

Alon Zakai

unread,
Apr 29, 2020, 7:04:19 PM4/29/20
to emscripte...@googlegroups.com
The MODULARIZE_INSTANCE option was originally meant to be a tiny little convenient option, as described in settings.js:

// Similar to MODULARIZE, but while that mode exports a function, with which you
// can create multiple instances, this option exports a singleton instance. In
// other words, it's the same as if you used MODULARIZE and did EXPORT_NAME =
// EXPORT_NAME() to create the instance manually.

However, over time it's actually gotten complex to maintain. Worse, we are working on a major rethinking of the MODULARIZE option [1], in order to handle Promises correctly, and MODULARIZE_INSTANCE is making things much more complex there.

We'd therefore like to remove MODULARIZE_INSTANCE (see [2] for PR). Removing it will allow us to fix the Promise problems with MODULARIZE. After that is done, if there is interest we can think about how a new MODULARIZE_INSTANCE would work on top of that.

For people using MODULARIZE_INSTANCE today, after we remove it you can do what the settings.js comment says, that is, manually create the singleton instance yourself. I realize that's not quite as convenient, but given the above we (the people in the two PRs mentioned) think it's the best option overall for the project.

Are there concerns with that, or things we've missed?

- Alon

Reply all
Reply to author
Forward
0 new messages