Bump express from 4.17.2 to 4.18.2 in /webapp
Bumps express from 4.17.2 to 4.18.2.
Release notes
Sourced from express's releases.
4.18.2
- Fix regression routing a large stack in a single route
- deps: [email protected]
- deps: [email protected]
- perf: remove unnecessary object clone
- deps: [email protected]
4.18.1
- Fix hanging on large stack of sync routes
4.18.0
- Add "root" option to
res.download- Allow
optionswithoutfilenameinres.download- Deprecate string and non-integer arguments to
res.status- Fix behavior of
null/undefinedasmaxAgeinres.cookie- Fix handling very large stacks of sync middleware
- Ignore
Object.prototypevalues in settings throughapp.set/app.get- Invoke
defaultwith same arguments as types inres.format- Support proper 205 responses using
res.send- Use
http-errorsforres.formaterror- deps: [email protected]
- Fix error message for json parse whitespace in
strict- Fix internal error when inflated body exceeds limit
- Prevent loss of async hooks context
- Prevent hanging when request already read
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- Add
priorityoption- Fix
expiresoption to reject invalid dates- deps: [email protected]
- Replace internal
evalusage withFunctionconstructor- Use instance methods on
processto check for listeners- deps: [email protected]
- Remove set content headers that break response
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- Prevent loss of async hooks context
- deps: [email protected]
- deps: [email protected]
- Fix emitted 416 error missing headers property
- Limit the headers removed for 304 response
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
... (truncated)
Changelog
Sourced from express's changelog.
4.18.2 / 2022-10-08
- Fix regression routing a large stack in a single route
- deps: [email protected]
- deps: [email protected]
- perf: remove unnecessary object clone
- deps: [email protected]
4.18.1 / 2022-04-29
- Fix hanging on large stack of sync routes
4.18.0 / 2022-04-25
- Add "root" option to
res.download- Allow
optionswithoutfilenameinres.download- Deprecate string and non-integer arguments to
res.status- Fix behavior of
null/undefinedasmaxAgeinres.cookie- Fix handling very large stacks of sync middleware
- Ignore
Object.prototypevalues in settings throughapp.set/app.get- Invoke
defaultwith same arguments as types inres.format- Support proper 205 responses using
res.send- Use
http-errorsforres.formaterror- deps: [email protected]
- Fix error message for json parse whitespace in
strict- Fix internal error when inflated body exceeds limit
- Prevent loss of async hooks context
- Prevent hanging when request already read
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- Add
priorityoption- Fix
expiresoption to reject invalid dates- deps: [email protected]
- Replace internal
evalusage withFunctionconstructor- Use instance methods on
processto check for listeners- deps: [email protected]
- Remove set content headers that break response
- deps: [email protected]
- deps: [email protected]
- deps: [email protected]
- Prevent loss of async hooks context
- deps: [email protected]
- deps: [email protected]
... (truncated)
Commits
8368dc14.18.261f4049docs: replace Freenode with Libera Chatbb7907bbuild: [email protected]f56ce73build: [email protected]24b3dc5deps: [email protected]689d175deps: [email protected]340be0fbuild: [email protected]33e8dc3docs: use Node.js name style644f646build: [email protected]ecd7572build: [email protected]- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) -
@dependabot use these labelswill set the current labels as the default for future PRs for this repo and language -
@dependabot use these reviewerswill set the current reviewers as the default for future PRs for this repo and language -
@dependabot use these assigneeswill set the current assignees as the default for future PRs for this repo and language -
@dependabot use this milestonewill set the current milestone as the default for future PRs for this repo and language
You can disable automated security fix PRs for this repo from the Security Alerts page.
@dayo09
They say that fs does not consider ssh support. It's safe to use vscode.workspace.fs instead of fs to support our extension on ssh on wheels.
Could you provide reference URLs if any? Thanks!
@hyunsik-yoon As you can see below, it's MS vscode's recommendation to use their api for filesystem approaches.
vscode/index.d.ts>vscode.workspace.fs
/**
* A {@link FileSystem file system} instance that allows to interact with local and remote
* files, e.g. `vscode.workspace.fs.readDirectory(someUri)` allows to retrieve all entries
* of a directory or `vscode.workspace.fs.stat(anotherUri)` returns the meta data for a
* file.
*/
export const fs: FileSystem;
From vscode api guide
Look out for usages of the fs node module for file system operations. If possible, use the vscode.workspace.fs API, which delegates to the appropriate file system provider.
From their release note
Call to Action: If your extension is currently using the fs module from Node.js, consider migrating to the new vscode.workspace.fs API
I've investigated as I don't know how different it is.
as-is (nodejs-api)
Buffer.from(): https://nodejs.org/dist/latest-v10.x/docs/api/buffer.html#buffer_class_method_buffer_from_string_encoding writeFile(): https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_writefile_file_data_options_callback
- file:
<string> | <Buffer> | <URL> | <integer> filename or file descriptor - data:
<string> | <Buffer> | <TypedArray> | <DataView>
const writeBytes = Buffer.from('Hello Node.js'); // Buffer.from(): nodejs api
const data = new Uint8Array(writeBytes);
fs.writeFile('message.txt', data, (err) => {
if (err) throw err;
console.log('The file has been saved!');
});
to-be (vscode-api)
fs: https://code.visualstudio.com/api/references/vscode-api#FileSystem uri: https://code.visualstudio.com/api/references/vscode-api#Uri
const good = URI.file('/coding/c#/project1');
good.scheme === 'file';
good.path === '/coding/c#/project1';
good.fragment === '';
const bad = URI.parse('file://' + '/coding/c#/project1');
bad.scheme === 'file';
bad.path === '/coding/c'; // path is now broken
bad.fragment === '/project1';
writeFile
- uri:
Uri. The uri of the file. - content:
Uint8Array. The new content of the file.
const writeBytes = Buffer.from('Hello vscode'); // Buffer.from(): nodejs api
// someUri: Uri of vscode-api, used like `Uri.file('message.txt')`
// writeBytes: class Buffer -> Uint8Array
await vscode.workspace.fs.writeFile(someUri, writeBytes); // writeFile: fs of vscode-api
vscode fs api doesn't take string as param. nodejs api does so it looks easier. It's good to support util classes to wrap vscode fs api.
@YongseopKim Yes, if you use fs.promises.writeFile, then it's rather similar to vscode.workspace.fs.writeFile. The differences are
-
fs.promises.writeFilereturns promise whilevscode.workspace.fs.writeFilereturns Thenable. -
fs.promises.writeFiletakes string whilevscode.workspace.fs.writeFiletakes Uint8Array, as you mentioned.
It looks like a good idea to provide a utility wrapping the Uint8Array conversion. :-D
Q. fs.promises.writeFile is a kind of api of vscode?
@YongseopKim Nope, it's a basic fs module. They just support promises version of their functions.
NOTE: vscode.workspace.fs doesn't support synchronous functions.
https://github.com/microsoft/vscode/issues/84175#issuecomment-551445383
readFileSync() - currently using node's fs.readFileSync() Our design/architecture prohibits anything sync here. This will not happen.
It seems that they internally decided not to support sync functions for their apis, for whatever reason.
NOTE: vscode.workspace.fs is too slow
I tested the function latency.
As vscode.workspace.fs is asynchronouse function, I wrapped the statSync with promise.
- vscode.workspace.fs: 1721 ms
- Promise + fs.statSync: 9.92 ms
console.time("1");
console.timeLog("1", "Promise statSync start")
const p = new Promise((resolve, reject)=>{
fs.statSync("/home/dayo/git/ONE-vscode/res/modelDir/truediv/model.cfg")
resolve("DONE")
});
p.then(()=>{
// 9.928955078125 ms
console.timeLog("1", "Promise statSync end")
})
console.time("2");
console.timeLog("2", "vscode.workspace.fs start");
vscode.workspace.fs
.stat(
vscode.Uri.file(
"/home/dayo/git/ONE-vscode/res/modelDir/truediv/model.cfg"
)
)
.then(
(stat) => {
// 1.721s
console.timeLog("2", "vscode.workspace.fs end");
},
(error) => console.log(error)
);