@fluidframework/request-handler 2.118.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,42 @@
1
1
  # @fluidframework/request-handler
2
2
 
3
- ## 2.118.0
3
+ ## 3.0.0
4
4
 
5
- Dependency updates only.
5
+ ### Minor Changes
6
6
 
7
- ## 2.117.0
7
+ - Removal of direct CommonJS support ([#28124](https://github.com/microsoft/FluidFramework/pull/28124)) [0f84e3b8878](https://github.com/microsoft/FluidFramework/commit/0f84e3b8878a5e75b2253976d98fd963bbd9db88)
8
8
 
9
- Dependency updates only.
9
+ Direct `require()` import is no longer directly supported.
10
+ Package is transpiled as ECMAScript Module.
11
+
12
+ See [Removal of direct CommonJS support in v3.0](https://github.com/microsoft/FluidFramework/issues/27444) for more information.
13
+
14
+ - Require modern TypeScript module resolution ([#27970](https://github.com/microsoft/FluidFramework/pull/27970)) [325e2016ca9](https://github.com/microsoft/FluidFramework/commit/325e2016ca9978d4a1f7552c97ba34feac9df41f)
15
+
16
+ Fluid Framework Client packages no longer include type declaration compatibility entrypoints for TypeScript's legacy Node10 resolution mode (`"moduleResolution": "node"` or `"node10"`).
17
+ Applications upgrading to Fluid Framework 3.0 must use one of the following supported configurations:
18
+ - `"module": "Node16"` with `"moduleResolution": "Node16"`
19
+ - `"module": "NodeNext"` with `"moduleResolution": "NodeNext"`
20
+ - `"module": "ESNext"` with `"moduleResolution": "Bundler"`
21
+
22
+ Existing public package entrypoints exposed through `package.json` exports, including `/alpha`, `/beta`, and `/legacy`, remain available under supported module resolution modes.
23
+
24
+ See [Removal of Node10 resolutions in v3.0](https://github.com/microsoft/FluidFramework/issues/27457) for more information.
25
+
26
+ - Client packages now target ES2022 ([#27846](https://github.com/microsoft/FluidFramework/pull/27846)) [91c78541bdd](https://github.com/microsoft/FluidFramework/commit/91c78541bddcbca5d6c5f357b023eeaee617d885)
27
+
28
+ The TypeScript compilation `target` and `lib` for the Fluid Framework client packages have been raised from ES2021/ES2020 to **ES2022**.
29
+ The published JavaScript now uses ES2022 language features (with correspondingly less down-leveling), so consuming these packages requires a runtime that supports ES2022.
30
+ All actively supported Node.js versions and evergreen browsers already meet this requirement.
31
+
32
+ Note that Fluid Framework has not officially supported targets older than ES2022 since before 2.0: this is documented in [ClientRequirements.md](https://github.com/microsoft/FluidFramework/blob/main/ClientRequirements.md) as well as the README for every client package.
33
+
34
+ It is possible this change could impact users of less up to date JavaScript runtimes.
35
+ Impacted users can use a tool like [babel](https://babeljs.io/) to transpile out unsupported language features.
36
+
37
+ - Build with TypeScript 6 ([#28052](https://github.com/microsoft/FluidFramework/pull/28052)) [7ab015c49de](https://github.com/microsoft/FluidFramework/commit/7ab015c49deec84833cdfe1fb5e1606b901f6e81)
38
+
39
+ FluidFramework Client SDK is now built using TypeScript 6. Consumers should build with TypeScript v6 or v7 or compatible tooling.
10
40
 
11
41
  ## 2.116.0
12
42
 
package/README.md CHANGED
@@ -9,15 +9,15 @@ A simple request-handling library for the Fluid Framework.
9
9
 
10
10
  ## Using Fluid Framework libraries
11
11
 
12
- When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`.
13
- While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
- library consumers should always prefer `^`.
12
+ For a dependency on a Fluid Framework library's public APIs, we recommend a `^` (caret) version range.
13
+ For example, use `^1.3.4`.
15
14
 
16
- If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
15
+ For a dependency on an unstable API, such as a `beta` API, we recommend a more restrictive version range.
16
+ For example, use a `~` version range.
17
17
 
18
18
  ## Installation
19
19
 
20
- To get started, install the package by running the following command:
20
+ Run this command to install the package:
21
21
 
22
22
  ```bash
23
23
  npm i @fluidframework/request-handler
@@ -25,16 +25,16 @@ npm i @fluidframework/request-handler
25
25
 
26
26
  ## Importing from this package
27
27
 
28
- This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
29
- For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
28
+ This package uses [package.json exports](https://nodejs.org/api/packages.html#exports) to separate APIs by support level.
29
+ For information about the support guarantees, read [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
30
30
 
31
- To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/request-handler` like normal.
31
+ Import the `public` APIs from `@fluidframework/request-handler`.
32
32
 
33
- To access the `legacy` APIs, import via `@fluidframework/request-handler/legacy`.
33
+ Import the `legacy` APIs from `@fluidframework/request-handler/legacy`.
34
34
 
35
35
  ## API Documentation
36
36
 
37
- API documentation for **@fluidframework/request-handler** is available at <https://fluidframework.com/docs/apis/request-handler>.
37
+ Read the **@fluidframework/request-handler** API documentation at <https://fluidframework.com/docs/apis/request-handler>.
38
38
 
39
39
  <!-- prettier-ignore-end -->
40
40
 
@@ -47,62 +47,69 @@ API documentation for **@fluidframework/request-handler** is available at <https
47
47
 
48
48
  ## Minimum Client Requirements
49
49
 
50
- These are the platform requirements for the current version of Fluid Framework Client Packages.
51
- These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
52
- For Long Term Support (LTS) versions this can require supporting these platforms for several years.
50
+ Fluid Framework client libraries support the platforms in this document.
51
+ These requirements are intentionally restrictive.
52
+ Within a major version series, we can relax these requirements, but we cannot make them stricter.
53
+ For a Long Term Support (LTS) version, we might need to support these platforms for several years.
53
54
 
54
- It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
55
- If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
56
- When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
55
+ Other configurations can work, but Fluid Framework does not support them.
56
+ If an unsupported configuration stops working, we do not classify this as a bug.
57
+ To request support for a configuration that is not listed, file an issue.
58
+ The product team will evaluate your request.
59
+ In the issue, specify the current status of the configuration:
60
+
61
+ - The configuration works but needs official support.
62
+ - The configuration does not work and requires changes.
57
63
 
58
64
  ### Supported Runtimes
59
65
 
60
- - NodeJs ^22.22.2 except that we will drop support for it [when NodeJs 22 loses its upstream support on 2027-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS at least 1 year before 22 is end-of-life.
61
- - Running Fluid in a Node.js environment with the `--no-experimental-fetch` flag is not supported.
62
- - Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
66
+ - Fluid Framework supports Node.js versions 22 and 24 while they receive [upstream support](https://nodejs.org/en/about/previous-releases).
67
+ - Fluid Framework will stop support for version 22 [when upstream support ends on 2027-04-30](https://github.com/nodejs/release#release-schedule).
68
+ - Fluid Framework does not support Node.js with the `--no-experimental-fetch` flag.
69
+ - Fluid Framework supports modern browsers that support the ES2022 standard library.
63
70
 
64
71
  ### Supported Tools
65
72
 
66
- - TypeScript 5.4:
67
- - All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
68
- - [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
69
- - [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
70
- - `exactOptionalPropertyTypes` is currently not fully supported.
71
- If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
73
+ - [TypeScript 6.0](https://typescriptdocs.com/release-notes/TypeScript%206.0):
74
+ - Fluid Framework supports all [`strict`](https://www.typescriptlang.org/tsconfig) options.
75
+ - Set the build targets (`lib`, `target`) to `ES2022` or later.
76
+ - Enable [`strictNullChecks`](https://www.typescriptlang.org/tsconfig).
77
+ - Fluid Framework does not support [configuration options deprecated in TypeScript 6.0](https://typescriptdocs.com/release-notes/TypeScript%206.0#breaking-changes-and-deprecations-in-typescript-6-0).
78
+ - Fluid Framework does not fully support `exactOptionalPropertyTypes`.
79
+ If you enable this option, do not use `in`, `Reflect.has`, `Object.hasOwn`, or `Object.prototype.hasOwnProperty` to narrow members of Fluid Framework types.
80
+ These methods can incorrectly exclude `undefined` from the possible values.
72
81
  - [webpack](https://webpack.js.org/) 5
73
- - We are not intending to be prescriptive about what bundler to use.
74
- Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
82
+ - We do not require a specific bundler.
83
+ Other bundlers that handle ES Modules can work, but we actively test only webpack.
75
84
 
76
85
  ### Module Resolution
77
86
 
78
- [`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
79
- Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
87
+ In TypeScript `compilerOptions`, use [`Node16`, `Node20`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) module resolution.
88
+ These settings follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
89
+
90
+ Do not use `Node10` module resolution.
80
91
 
81
92
  ### Module Formats
82
93
 
83
94
  - ES Modules:
84
- ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
85
- - CommonJs:
86
- Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
87
- This is done to accommodate some workflows without good ES Module support.
88
- If you have a workflow you would like included in this list, file an issue.
89
- Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
90
-
91
- - Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
95
+ Use ES Modules to consume Fluid Framework client packages, including in Node.js.
96
+ - CommonJS:
97
+ Fluid Framework does not officially support CommonJS in version 3.0 or later.
92
98
 
93
99
  ## Contribution Guidelines
94
100
 
95
- There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
101
+ You can [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid Framework in these ways:
96
102
 
97
- - Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
98
- - [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
99
- - Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
103
+ - Answer questions in [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
104
+ - [Submit bug reports](https://github.com/microsoft/FluidFramework/issues) and help verify fixes.
105
+ - Review [source code changes](https://github.com/microsoft/FluidFramework/pulls).
100
106
  - [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
101
107
 
102
- Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
108
+ For detailed instructions, read the [repo documentation](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Home.md).
103
109
 
104
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
105
- For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
110
+ This project follows the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
111
+ For more information, read the [Code of Conduct frequently asked questions](https://opensource.microsoft.com/codeofconduct/faq/).
112
+ For questions or comments, contact [opencode@microsoft.com](mailto:opencode@microsoft.com).
106
113
 
107
114
  This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
108
115
  Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
@@ -110,13 +117,9 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
110
117
 
111
118
  ## Help
112
119
 
113
- Not finding what you're looking for in this README?
114
- Check out [fluidframework.com](https://fluidframework.com/docs/).
115
-
116
- Still not finding what you're looking for?
117
- Please [file an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
120
+ Read the [Fluid Framework documentation](https://fluidframework.com/docs/) for information about Fluid Framework concepts and APIs.
118
121
 
119
- Thank you!
122
+ To request information that the documentation does not contain, [create an issue](https://github.com/microsoft/FluidFramework/blob/main/docs/content/Contributing/Submitting-Bugs-and-Feature-Requests.md).
120
123
 
121
124
  ## Trademark
122
125
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-model.esm.json"
3
+ "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-model.esm.json"
4
4
  }
@@ -4,17 +4,15 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.buildRuntimeRequestHandler = void 0;
7
+ exports.buildRuntimeRequestHandler = buildRuntimeRequestHandler;
8
8
  const internal_1 = require("@fluidframework/runtime-utils/internal");
9
9
  /**
10
10
  * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
11
11
  * The provided handlers sequentially applied until one is able to satisfy the request.
12
12
  */
13
13
  class RuntimeRequestHandlerBuilder {
14
- constructor() {
15
- // eslint-disable-next-line import-x/no-deprecated
16
- this.handlers = [];
17
- }
14
+ // eslint-disable-next-line import-x/no-deprecated
15
+ handlers = [];
18
16
  // eslint-disable-next-line import-x/no-deprecated
19
17
  pushHandler(...handlers) {
20
18
  if (handlers !== undefined) {
@@ -46,5 +44,4 @@ function buildRuntimeRequestHandler(
46
44
  builder.pushHandler(...handlers);
47
45
  return async (request, runtime) => builder.handleRequest(request, runtime);
48
46
  }
49
- exports.buildRuntimeRequestHandler = buildRuntimeRequestHandler;
50
47
  //# sourceMappingURL=runtimeRequestHandlerBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,qEAA0F;AAK1F;;;GAGG;AACH,MAAM,4BAA4B;IAAlC;QACC,kDAAkD;QACjC,aAAQ,GAA4B,EAAE,CAAC;IAsBzD,CAAC;IApBA,kDAAkD;IAC3C,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAAiB,EACjB,OAA0B;QAE1B,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC5B,OAAO,QAAQ,CAAC;YACjB,CAAC;QACF,CAAC;QACD,OAAO,IAAA,4BAAiB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;;;;GAMG;AACH,SAAgB,0BAA0B;AACzC,kDAAkD;AAClD,GAAG,QAAiC;IAEpC,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AARD,gEAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated\nimport type { RuntimeRequestHandler } from \"./requestHandlers.js\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n */\nclass RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import-x/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]): void {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(\n\t\trequest: IRequest,\n\t\truntime: IContainerRuntime,\n\t): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * Deprecated.\n *\n * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @internal\n */\nexport function buildRuntimeRequestHandler(\n\t// eslint-disable-next-line import-x/no-deprecated\n\t...handlers: RuntimeRequestHandler[]\n): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse> {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA8CH,gEAQC;AAlDD,qEAA0F;AAK1F;;;GAGG;AACH,MAAM,4BAA4B;IACjC,kDAAkD;IACjC,QAAQ,GAA4B,EAAE,CAAC;IAExD,kDAAkD;IAC3C,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAAiB,EACjB,OAA0B;QAE1B,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC5B,OAAO,QAAQ,CAAC;YACjB,CAAC;QACF,CAAC;QACD,OAAO,IAAA,4BAAiB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;;;;GAMG;AACH,SAAgB,0BAA0B;AACzC,kDAAkD;AAClD,GAAG,QAAiC;IAEpC,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated\nimport type { RuntimeRequestHandler } from \"./requestHandlers.js\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n */\nclass RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import-x/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]): void {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(\n\t\trequest: IRequest,\n\t\truntime: IContainerRuntime,\n\t): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * Deprecated.\n *\n * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @internal\n */\nexport function buildRuntimeRequestHandler(\n\t// eslint-disable-next-line import-x/no-deprecated\n\t...handlers: RuntimeRequestHandler[]\n): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse> {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
package/lib/legacy.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /*
7
7
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
8
+ * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
11
  export {
package/lib/public.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  /*
7
7
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
8
+ * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
11
  export {}
@@ -8,10 +8,8 @@ import { RequestParser, create404Response } from "@fluidframework/runtime-utils/
8
8
  * The provided handlers sequentially applied until one is able to satisfy the request.
9
9
  */
10
10
  class RuntimeRequestHandlerBuilder {
11
- constructor() {
12
- // eslint-disable-next-line import-x/no-deprecated
13
- this.handlers = [];
14
- }
11
+ // eslint-disable-next-line import-x/no-deprecated
12
+ handlers = [];
15
13
  // eslint-disable-next-line import-x/no-deprecated
16
14
  pushHandler(...handlers) {
17
15
  if (handlers !== undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAK1F;;;GAGG;AACH,MAAM,4BAA4B;IAAlC;QACC,kDAAkD;QACjC,aAAQ,GAA4B,EAAE,CAAC;IAsBzD,CAAC;IApBA,kDAAkD;IAC3C,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAAiB,EACjB,OAA0B;QAE1B,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC5B,OAAO,QAAQ,CAAC;YACjB,CAAC;QACF,CAAC;QACD,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B;AACzC,kDAAkD;AAClD,GAAG,QAAiC;IAEpC,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated\nimport type { RuntimeRequestHandler } from \"./requestHandlers.js\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n */\nclass RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import-x/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]): void {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(\n\t\trequest: IRequest,\n\t\truntime: IContainerRuntime,\n\t): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * Deprecated.\n *\n * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @internal\n */\nexport function buildRuntimeRequestHandler(\n\t// eslint-disable-next-line import-x/no-deprecated\n\t...handlers: RuntimeRequestHandler[]\n): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse> {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAK1F;;;GAGG;AACH,MAAM,4BAA4B;IACjC,kDAAkD;IACjC,QAAQ,GAA4B,EAAE,CAAC;IAExD,kDAAkD;IAC3C,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAAiB,EACjB,OAA0B;QAE1B,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC5B,OAAO,QAAQ,CAAC;YACjB,CAAC;QACF,CAAC;QACD,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B;AACzC,kDAAkD;AAClD,GAAG,QAAiC;IAEpC,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n// eslint-disable-next-line import-x/no-deprecated\nimport type { RuntimeRequestHandler } from \"./requestHandlers.js\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n */\nclass RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import-x/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import-x/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]): void {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(\n\t\trequest: IRequest,\n\t\truntime: IContainerRuntime,\n\t): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * Deprecated.\n *\n * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @internal\n */\nexport function buildRuntimeRequestHandler(\n\t// eslint-disable-next-line import-x/no-deprecated\n\t...handlers: RuntimeRequestHandler[]\n): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse> {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/request-handler",
3
- "version": "2.118.0",
3
+ "version": "3.0.0",
4
4
  "description": "A simple request handling library for Fluid Framework",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -14,38 +14,24 @@
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {
17
- "import": {
18
- "types": "./lib/public.d.ts",
19
- "default": "./lib/index.js"
20
- },
21
- "require": {
22
- "types": "./dist/public.d.ts",
23
- "default": "./dist/index.js"
17
+ "types": "./lib/public.d.ts",
18
+ "default": "./lib/index.js",
19
+ "internal-entrypoint-generation": {
20
+ "types": "./dist/public.d.ts"
24
21
  }
25
22
  },
26
23
  "./legacy": {
27
- "import": {
28
- "types": "./lib/legacy.d.ts",
29
- "default": "./lib/index.js"
30
- },
31
- "require": {
32
- "types": "./dist/legacy.d.ts",
33
- "default": "./dist/index.js"
24
+ "types": "./lib/legacy.d.ts",
25
+ "default": "./lib/index.js",
26
+ "internal-entrypoint-generation": {
27
+ "types": "./dist/legacy.d.ts"
34
28
  }
35
29
  },
36
30
  "./internal": {
37
- "import": {
38
- "types": "./lib/index.d.ts",
39
- "default": "./lib/index.js"
40
- },
41
- "require": {
42
- "types": "./dist/index.d.ts",
43
- "default": "./dist/index.js"
44
- }
31
+ "types": "./lib/index.d.ts",
32
+ "default": "./lib/index.js"
45
33
  }
46
34
  },
47
- "main": "lib/index.js",
48
- "types": "lib/public.d.ts",
49
35
  "c8": {
50
36
  "all": true,
51
37
  "cache-dir": "nyc/.cache",
@@ -69,16 +55,16 @@
69
55
  "temp-directory": "nyc/.nyc_output"
70
56
  },
71
57
  "dependencies": {
72
- "@fluidframework/container-runtime-definitions": "~2.118.0",
73
- "@fluidframework/core-interfaces": "~2.118.0",
74
- "@fluidframework/core-utils": "~2.118.0",
75
- "@fluidframework/runtime-definitions": "~2.118.0",
76
- "@fluidframework/runtime-utils": "~2.118.0"
58
+ "@fluidframework/container-runtime-definitions": "~3.0.0",
59
+ "@fluidframework/core-interfaces": "~3.0.0",
60
+ "@fluidframework/core-utils": "~3.0.0",
61
+ "@fluidframework/runtime-definitions": "~3.0.0",
62
+ "@fluidframework/runtime-utils": "~3.0.0"
77
63
  },
78
64
  "devDependencies": {
79
65
  "@arethetypeswrong/cli": "^0.18.5",
80
66
  "@biomejs/biome": "~2.4.5",
81
- "@fluid-internal/mocha-test-setup": "~2.118.0",
67
+ "@fluid-internal/mocha-test-setup": "~3.0.0",
82
68
  "@fluid-tools/build-cli": "^0.67.0",
83
69
  "@fluidframework/build-common": "^2.0.3",
84
70
  "@fluidframework/build-tools": "^0.67.0",
@@ -98,7 +84,7 @@
98
84
  "mocha": "^11.7.5",
99
85
  "mocha-multi-reporters": "^1.5.1",
100
86
  "rimraf": "^6.1.3",
101
- "typescript": "~5.4.5"
87
+ "typescript": "~6.0.3"
102
88
  },
103
89
  "typeValidation": {
104
90
  "broken": {},
@@ -107,19 +93,20 @@
107
93
  "scripts": {
108
94
  "build": "fluid-build . --task build",
109
95
  "build:api-reports": "concurrently \"npm:build:api-reports:*\"",
110
- "build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
111
- "build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
96
+ "build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor-report.current.json",
97
+ "build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor-report.legacy.json",
98
+ "build:cjs": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
112
99
  "build:commonjs": "fluid-build . --task commonjs",
113
100
  "build:compile": "fluid-build . --task compile",
114
- "build:docs": "api-extractor run --local",
101
+ "build:docs": "api-extractor run --local --config api-extractor/api-extractor-model.json",
115
102
  "build:entrypoints": "fluid-build . --task build:entrypoints",
116
103
  "build:entrypoints:cjs": "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist",
117
- "build:entrypoints:esm": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat",
118
- "build:esnext": "tsc --project ./tsconfig.json",
104
+ "build:entrypoints:esm": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib",
105
+ "build:esm": "tsc --project ./tsconfig.json",
119
106
  "build:test": "concurrently npm:build:test:esm npm:build:test:cjs",
120
107
  "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
121
108
  "build:test:esm": "tsc --project ./src/test/tsconfig.json",
122
- "check:are-the-types-wrong": "attw --pack .",
109
+ "check:are-the-types-wrong": "attw --pack . --profile esm-only",
123
110
  "check:biome": "biome check .",
124
111
  "check:exports": "concurrently \"npm:check:exports:*\"",
125
112
  "check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
@@ -129,9 +116,9 @@
129
116
  "check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
130
117
  "check:format": "npm run check:biome",
131
118
  "ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
132
- "ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
133
- "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
134
- "ci:build:docs": "api-extractor run",
119
+ "ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor-report.current.json",
120
+ "ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor-report.legacy.json",
121
+ "ci:build:docs": "api-extractor run --config api-extractor/api-extractor-model.json",
135
122
  "clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
136
123
  "eslint": "eslint --quiet --format stylish src",
137
124
  "eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout",
@@ -145,7 +132,6 @@
145
132
  "test:mocha:cjs": "cross-env FLUID_TEST_MODULE_SYSTEM=CJS mocha",
146
133
  "test:mocha:esm": "mocha",
147
134
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
148
- "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
149
135
  "typetests:gen": "flub generate typetests --dir . -v"
150
136
  }
151
137
  }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../../common/build/build-common/tsconfig.node16.json",
2
+ "extends": "../../../common/build/build-common/tsconfig.node20.json",
3
3
  "include": ["src/**/*"],
4
4
  "exclude": ["src/test/**/*"],
5
5
  "compilerOptions": {
package/internal.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- /*
7
- * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
9
- */
10
-
11
- export * from "./lib/index.js";
package/legacy.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- /*
7
- * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
- * Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
9
- */
10
-
11
- export * from "./lib/legacy.js";