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

replace serve-handler with serve-static #9594

Closed
wants to merge 1 commit into from

Conversation

iacore
Copy link

@iacore iacore commented Mar 22, 2024

This PR replaces serve-handler with serve-static

Hopefully this PR fixes #9390. I can't test this out myself since yarn install fails on my machine.

Can someone test this for me fix this?

✔️ PR Todo

  • Actually run the tests
  • Included links to related issues/PRs

Comment on lines -373 to -376
lstat: path => fs.stat(path),
realpath: path => fs.realpath(path),
createReadStream: (path, options) => fs.createReadStream(path, options),
readdir: path => fs.readdir(path),
Copy link
Member

@mischnic mischnic Mar 22, 2024

Choose a reason for hiding this comment

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

Is it possible to override the FS of server-static? You could use an in-memory FS with Parcel, then it would not work without this

Copy link
Author

@iacore iacore Mar 22, 2024

Choose a reason for hiding this comment

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

No. Not that I know of.

I thought the fs.* refer to real files.

In-memory FS: /dev/shm/xxxx

Copy link
Member

Choose a reason for hiding this comment

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

Parcel has other implementations of the fs interface, such as https://github.com/parcel-bundler/parcel/blob/v2/packages/core/fs/src/MemoryFS.js

That's why the fs parameter exist in that function

Copy link
Author

Choose a reason for hiding this comment

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

In that case, Parcel can fork serve-static (it's small).

https://github.com/expressjs/serve-static/blob/master/index.js

@iacore iacore closed this Mar 22, 2024
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.

Deprecated punycode module msg
2 participants