Skip to content

[FS] Deprecate FS.analyzePath and remove internal usages - #27765

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:remove_analyzePath_internal
Open

sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:remove_analyzePath_internal

Conversation

@sbc100

@sbc100 sbc100 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Replace the remaining internal calls to FS.analyzePath:

  • In emscripten_run_preload_plugins (src/lib/libbrowser.js), read the file contents directly via FS.readFile(_file).
  • In src/lib/liblz4.js, use FS.lookupPath directly to get the underlying FSNode.
  • Remove the stub FS.analyzePath from src/lib/libwasmfs.js (which was only added in WasmFS: Get emscripten_run_preload_plugins working #19634 for emscripten_run_preload_plugins) and drop _wasmfs_identify from REQUIRED_EXPORTS in tools/link.py.

Also move FS.analyzePath documentation to the legacy v1 compatibility section in advanced-apis.rst and emit a warnOnce deprecation notice in ASSERTIONS builds.

Why are we doing this:

  • The analyzePath returns a large grab-bag of properties and no callers seem to need
  • Supported it in wasmfs fully seems hard/impossible.
  • Its dead code (once we remove our internal usage of it)

@sbc100 sbc100 changed the title [FS] Deprecate legacy FS.analyzePath and remove internal usages [FS] Deprecate FS.analyzePath and remove internal usages Sep 22, 2026
@sbc100
sbc100 force-pushed the remove_analyzePath_internal branch 2 times, most recently from 8376656 to fda4986 Compare September 22, 2026 20:27
@sbc100
sbc100 force-pushed the remove_analyzePath_internal branch from fda4986 to 0bcc110 Compare September 22, 2026 20:36
@sbc100
sbc100 requested review from hoodmane and kripken September 22, 2026 20:37
@sbc100
sbc100 force-pushed the remove_analyzePath_internal branch from 0bcc110 to 1085dab Compare September 22, 2026 20:40
sbc100 added a commit that referenced this pull request Sep 22, 2026
Comment thread src/lib/libbrowser.js Outdated
@sbc100
sbc100 force-pushed the remove_analyzePath_internal branch 2 times, most recently from 25bfb05 to 8dc24a5 Compare September 22, 2026 21:48
@kripken

kripken commented Sep 22, 2026

Copy link
Copy Markdown
Member

What is the motivation/background?

@sbc100

sbc100 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

What is the motivation/background?

  1. The analyzePath returns a large grab-bag of properties and no callers seem to need
  2. Supported it in wasmfs fully seems hard/impossible.
  3. Its dead code (once we remove our internal usage of it)

@sbc100

sbc100 commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

(added to the PR description)

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, lgtm

@sbc100
sbc100 force-pushed the remove_analyzePath_internal branch from 8dc24a5 to 076db70 Compare September 22, 2026 22:32
Replace the remaining internal calls to `FS.analyzePath`:
- In `emscripten_run_preload_plugins` (`src/lib/libbrowser.js`), read the
  file contents directly via `FS.readFile(_file)`.
- In `src/lib/liblz4.js` and `src/postamble.js`, use `FS.lookupPath`
  directly to get the underlying `FSNode`.
- Remove the stub `FS.analyzePath` from `src/lib/libwasmfs.js` (which was
  only added in emscripten-core#19634 for `emscripten_run_preload_plugins`) and drop
  `_wasmfs_identify` from `REQUIRED_EXPORTS` in `tools/link.py`.

Also move `FS.analyzePath` documentation to the legacy v1 compatibility
section in `advanced-apis.rst` and emit a `warnOnce` deprecation notice
in `ASSERTIONS` builds.
@sbc100
sbc100 force-pushed the remove_analyzePath_internal branch from 076db70 to 82e8232 Compare September 22, 2026 22:46

This branch has not been deployed

No deployments
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.

3 participants