Skip to content

Make browser exports optional#20703

Open
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:browser_exports
Open

Make browser exports optional#20703
sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
sbc100:browser_exports

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 13, 2023

No description provided.

@sbc100 sbc100 requested a review from kripken November 13, 2023 22:46
$pauseMainLoop: 'Browser.mainLoop.pause',
$resumeMainLoop: 'Browser.mainLoop.resume',
$getUserMedia: 'Browser.getUserMedia',
$createContext: 'Browser.createContext',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we automatically add helpful messages in debug builds for these? I am guessing maybe no, since I'm not sure we have a list that includes these particular functions atm. We have that for other things where the error message tells the user exactly what to do, which could be good here as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we do. In debug builds if you try to call Module['anyLibraryFuncAtAll'] you will see this one of these two errors:

var msg = `\`${sym}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`;

var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;

I locally verified this was the case with these changes, but we do have tests for that too.

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

None of the code size tests measure this? Maybe we don't use browser code there.

@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 14, 2023

Sounds good.

None of the code size tests measure this? Maybe we don't use browser code there.

Yeah we don't have any code size measurement for things like Browser and FS (our most heavy weight APIs).

@sbc100 sbc100 closed this Jan 3, 2025
@sbc100 sbc100 deleted the browser_exports branch January 3, 2025 22:45
@sbc100 sbc100 restored the browser_exports branch January 3, 2025 23:15
@sbc100 sbc100 reopened this Jan 3, 2025
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

Successfully merging this pull request may close these issues.

2 participants