-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Document EXPORT_ES6 #14383
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
Comments
Would this be solved (at least partially) by exporting/exposing the existing docs that exist for all settings in settings.js on the docs site? |
Do you mean https://emsettings.surma.technology/#EXPORT_ES6? If so that's what I meant by "not counting settings.js note" - I don't think that's enough. It doesn't mention But yeah I guess it would be better than nothing. |
Ah I see. In that case I agree. Do you think updating/improving the docs in settings.js would be enough? Maybe if we also make those more visible? Or do you want to this more front and center somewhere? |
I think updating it in settings.js would be certainly useful either way, but I also think we should encourage new users to use In particular, I think adding a section very much like https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html?highlight=modularize#interacting-with-an-api-written-in-c-c-from-nodejs but for For now I keep running into users (e.g. on StackOverflow) who are linking back to @surma's https://developers.google.com/web/updates/2019/01/emscripten-npm as the only guide for emitting ES6 modules, and until I tried to search emscripten.org for "EXPORT_ES6" I didn't connect the dots that it's literally the only guide out there. It's well written, but 1) it's a bit outdated by now, 2) it explains several features at once and 3) not part of the official docs, so I think a dedicated official section is still useful. I can probably try and add this to my backlog, but wanted to open an issue for tracking and also just in case someone wants to write those docs up sooner :) |
Bump! We're trying to figure out how to create es6 module builds for the new sqlite3.org WASM builds and the only docs about it in settings.js are not nearly meaty enough to work through this. This is where google led me when i asked about es6 modules with Emscripten: http://philiplassen.com/2021/08/11/node-es6-emscripten.html Searching emscripten.org for EXPORT_ES6 currently returns 0 results. |
i don't care about node.js (quite the opposite!). We're currently only interested in browser-side builds. |
Is this option working for browser builds? The changes seem to be purely cosmetic on JS side. |
Works For Me™: https://www.npmjs.com/package/soundswallower?activeTab=explore (built with https://github.com/ReadAlongs/SoundSwallower/blob/master/js/CMakeLists.txt) |
Hi! I'll try to put together a PR for documentation, for the moment you can also look at the packaging guide I've written. There are still some bugs in EXPORT_ES6 like #18811, perhaps I will try to make PRs for them as well... |
Fixes a 'missing default export' error. See: emscripten-core/emscripten#14383
I've just noticed that
EXPORT_ES6
option, while very useful in modern Web development stack, is currently undocumented (not countingsettings.js
note) and not even mentioned anywhere on the website: https://emscripten.org/search.html?q=EXPORT_ES6&check_keywords=yes&area=default#At the very least, it would be useful to mention it in the same places where we have
MODULARIZE
: https://emscripten.org/search.html?q=MODULARIZE&check_keywords=yes&area=default#The text was updated successfully, but these errors were encountered: