@bleedingdev/modern-js-app-tools 3.8.1-ultramodern.2 → 3.8.1-ultramodern.3
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/dist/cjs/presetUltramodern.js +1 -1
- package/dist/esm/presetUltramodern.mjs +1 -1
- package/dist/esm-node/presetUltramodern.mjs +1 -1
- package/dist/types/presetUltramodern.d.ts +1 -1
- package/docs/guides/advanced-features/bff/frameworks.md +6 -6
- package/docs/llms.txt +1 -1
- package/package.json +11 -11
|
@@ -79,7 +79,7 @@ const setReactRouterBridgeSafeAliases = (chain, { isProd })=>{
|
|
|
79
79
|
chain.resolve.alias.set('react-router/dist/development/index.js', developmentEntry);
|
|
80
80
|
};
|
|
81
81
|
const createPresetUltramodernConfig = (options = {})=>{
|
|
82
|
-
const { appId = 'app', deliveryUnit, enableBffRequestId = true, enableTelemetry = true, enableTelemetryExporters, otlpEndpoint = process.env.MODERN_TELEMETRY_OTLP_ENDPOINT, victoriaMetricsEndpoint = process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT, telemetryFailLoudStartup =
|
|
82
|
+
const { appId = 'app', deliveryUnit, enableBffRequestId = true, enableTelemetry = true, enableTelemetryExporters, otlpEndpoint = process.env.MODERN_TELEMETRY_OTLP_ENDPOINT, victoriaMetricsEndpoint = process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT, telemetryFailLoudStartup = false, enableModuleFederationSSR = true } = options;
|
|
83
83
|
const server = {};
|
|
84
84
|
const releaseIdentity = deliveryUnit ? (0, external_ultramodern_release_identity_js_namespaceObject.resolveUltramodernReleaseIdentity)({
|
|
85
85
|
generationBuildMarker: deliveryUnit.buildMarker,
|
|
@@ -35,7 +35,7 @@ const setReactRouterBridgeSafeAliases = (chain, { isProd })=>{
|
|
|
35
35
|
chain.resolve.alias.set('react-router/dist/development/index.js', developmentEntry);
|
|
36
36
|
};
|
|
37
37
|
const createPresetUltramodernConfig = (options = {})=>{
|
|
38
|
-
const { appId = 'app', deliveryUnit, enableBffRequestId = true, enableTelemetry = true, enableTelemetryExporters, otlpEndpoint = process.env.MODERN_TELEMETRY_OTLP_ENDPOINT, victoriaMetricsEndpoint = process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT, telemetryFailLoudStartup =
|
|
38
|
+
const { appId = 'app', deliveryUnit, enableBffRequestId = true, enableTelemetry = true, enableTelemetryExporters, otlpEndpoint = process.env.MODERN_TELEMETRY_OTLP_ENDPOINT, victoriaMetricsEndpoint = process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT, telemetryFailLoudStartup = false, enableModuleFederationSSR = true } = options;
|
|
39
39
|
const server = {};
|
|
40
40
|
const releaseIdentity = deliveryUnit ? resolveUltramodernReleaseIdentity({
|
|
41
41
|
generationBuildMarker: deliveryUnit.buildMarker,
|
|
@@ -36,7 +36,7 @@ const setReactRouterBridgeSafeAliases = (chain, { isProd })=>{
|
|
|
36
36
|
chain.resolve.alias.set('react-router/dist/development/index.js', developmentEntry);
|
|
37
37
|
};
|
|
38
38
|
const createPresetUltramodernConfig = (options = {})=>{
|
|
39
|
-
const { appId = 'app', deliveryUnit, enableBffRequestId = true, enableTelemetry = true, enableTelemetryExporters, otlpEndpoint = process.env.MODERN_TELEMETRY_OTLP_ENDPOINT, victoriaMetricsEndpoint = process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT, telemetryFailLoudStartup =
|
|
39
|
+
const { appId = 'app', deliveryUnit, enableBffRequestId = true, enableTelemetry = true, enableTelemetryExporters, otlpEndpoint = process.env.MODERN_TELEMETRY_OTLP_ENDPOINT, victoriaMetricsEndpoint = process.env.MODERN_TELEMETRY_VICTORIA_ENDPOINT, telemetryFailLoudStartup = false, enableModuleFederationSSR = true } = options;
|
|
40
40
|
const server = {};
|
|
41
41
|
const releaseIdentity = deliveryUnit ? resolveUltramodernReleaseIdentity({
|
|
42
42
|
generationBuildMarker: deliveryUnit.buildMarker,
|
|
@@ -53,7 +53,7 @@ export interface PresetUltramodernOptions {
|
|
|
53
53
|
/**
|
|
54
54
|
* Enable fail-loud startup probing for telemetry exporters.
|
|
55
55
|
* Probes only run for exporters that are actually enabled.
|
|
56
|
-
* @default
|
|
56
|
+
* @default false
|
|
57
57
|
*/
|
|
58
58
|
telemetryFailLoudStartup?: boolean;
|
|
59
59
|
/**
|
|
@@ -8,12 +8,8 @@ Modern.js supports two BFF runtime frameworks:
|
|
|
8
8
|
`effect` and `hono` are strict runtime modes. There is no automatic fallback between them.
|
|
9
9
|
|
|
10
10
|
::::info
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`bff.effect.strictEffectApproach: true`. Add or change generated UltraModern
|
|
14
|
-
HTTP API work through `shared/api.ts` and `api/index.ts`; do not add
|
|
15
|
-
Hono/file-convention handlers, raw request parsing, or manual `Response`
|
|
16
|
-
construction inside those workspaces.
|
|
11
|
+
Generated UltraModern workspaces use strict Effect APIs: author HTTP APIs in
|
|
12
|
+
`shared/api.ts` and `api/index.ts`, not Hono/file-convention handlers.
|
|
17
13
|
::::
|
|
18
14
|
|
|
19
15
|
## Switch to Effect runtime
|
|
@@ -121,6 +117,10 @@ const response = await api.client.hello.ping({});
|
|
|
121
117
|
|
|
122
118
|
The `api.client.*` surface is materialized by the BFF loader for `@api/index` imports. Do not import `api/index` directly and expect `client` to run in server code, scripts, or tests; direct entry imports expose the server runtime definition, and `client` is only a typed placeholder there.
|
|
123
119
|
|
|
120
|
+
For UltraModern, Effect `HttpApi` plus Effect BFF is the single blessed authored HTTP path. Use `HttpApi` endpoints with `query`, `params`, `payload`, `success`, and declared errors such as `HttpApiSchema.status(...)`; implement them with `HttpApiBuilder.group(...).handle(...)` and `HttpApiBuilder.layer(...).pipe(Layer.provide(...))`, then default-export the entry as `defineEffectBff({ api, layer })`. See `packages/cli/plugin-bff/tests/effect-httpapi-schema-validation.test.ts` for the real shapes.
|
|
121
|
+
|
|
122
|
+
Hono and `api/lambda/**` are internal compatibility only and feature-frozen.
|
|
123
|
+
|
|
124
124
|
### Getting Request Context
|
|
125
125
|
|
|
126
126
|
Sometimes in BFF functions, it's necessary to obtain the request context to handle more logic. In such cases, you can use `useHonoContext` to get it:
|
package/docs/llms.txt
CHANGED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
- [Deploy Application](/guides/basic-features/deploy.md): Currently, Modern.js offers two deployment way: You can host your application in a container that includes a Node.js environment on your own, which provides flexibility for the deployment of the application.You can also deploy your application through a platform. Currently, Modern.js officially supports deployment on Netlify, Vercel, and Github pages.
|
|
48
48
|
- [BFF](/guides/advanced-features/bff.md): BFF (Backends for Frontends) is an architectural pattern primarily used to address issues of data aggregation in front-end and back-end collaboration. Under the BFF architecture, front-end applications do not communicate directly with backend services. Instead, they interact with backend services through a dedicated BFF middleware layer, custom-made for the front end. The main problems it tries to solve include: Aggregation, mapping, clipping, and proxying of lower-level APIs according to their own business needs.Cache data for some specific scenarios to improve performance and thus improve user experience.Quickly development of new products based on existing interfaces.Interface with third-party systems, such as login authentication. Modern.js officially supported the BFF and provided the Integrated BFF to further strengthen the BFF's capabilities, mainly including the following capabilities: Quick development and debugging go live, running, building, and deploying BFF code in the same project.Minimal pure function call, directly import BFF function on the front end, and can be automatically converted into HTTP request when called.No private protocol, follow RESTful API specification, all BFF interfaces are standardized.Full TypeScript support.Meet user preferences and support multi-frame extension writing.
|
|
49
49
|
- [Basic Usage](/guides/advanced-features/bff/function.md): In a Modern.js application, developers can define API files under the api/lambda directory and export API functions from these files. In the frontend code, these API functions can be directly invoked by importing the file, which initiates the API requests. This invocation method is called unified invocation, where developers do not need to write glue code for the frontend and backend separately, thereby ensuring type safety across both.
|
|
50
|
-
- [Runtime Framework](/guides/advanced-features/bff/frameworks.md): Modern.js supports two BFF runtime frameworks: effect (default): use Effect HttpApi runtime from api/index.hono: use file-convention BFF handlers from api/lambda/**. effect and hono are strict runtime modes. There is no automatic fallback between them. ::::info
|
|
50
|
+
- [Runtime Framework](/guides/advanced-features/bff/frameworks.md): Modern.js supports two BFF runtime frameworks: effect (default): use Effect HttpApi runtime from api/index.hono: use file-convention BFF handlers from api/lambda/**. effect and hono are strict runtime modes. There is no automatic fallback between them. ::::info Generated UltraModern workspaces use strict Effect APIs: author HTTP APIs in shared/api.ts and api/index.ts, not Hono/file-convention handlers. ::::
|
|
51
51
|
- [Data Platform](/guides/advanced-features/bff/data-platform.md): Modern.js Effect API runtime now supports a request-envelope based data platform contract for safer and more predictable data orchestration in complex applications such as Module Federation and micro frontends.
|
|
52
52
|
- [Creating Extensible BFF Functions](/guides/advanced-features/bff/operators.md): The previous section showed how to export a simple BFF function in a file. In more complex scenarios, each BFF function may need to do independent type validation, pre-logic, etc. Therefore, Modern.js exposes Api, which supports creating BFF functions through this API. BFF functions created in this way can be easily extended with functionality.
|
|
53
53
|
- [Extend BFF Server](/guides/advanced-features/bff/extend-server.md): In some applications, developers may want to handle all BFF functions uniformly, such as authentication, logging, data processing, etc. Modern.js allows users to freely extend the BFF Server through Middleware method.
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.8.1-ultramodern.
|
|
20
|
+
"version": "3.8.1-ultramodern.3",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"exports": {
|
|
@@ -134,16 +134,16 @@
|
|
|
134
134
|
"@babel/traverse": "^8.0.0",
|
|
135
135
|
"@babel/types": "^8.0.0",
|
|
136
136
|
"@loadable/component": "5.16.7",
|
|
137
|
-
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.8.1-ultramodern.
|
|
138
|
-
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.8.1-ultramodern.
|
|
139
|
-
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.8.1-ultramodern.
|
|
140
|
-
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.8.1-ultramodern.
|
|
141
|
-
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.8.1-ultramodern.
|
|
142
|
-
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.8.1-ultramodern.
|
|
143
|
-
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.8.1-ultramodern.
|
|
144
|
-
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.8.1-ultramodern.
|
|
145
|
-
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.8.1-ultramodern.
|
|
146
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.8.1-ultramodern.
|
|
137
|
+
"@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.8.1-ultramodern.3",
|
|
138
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.8.1-ultramodern.3",
|
|
139
|
+
"@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.8.1-ultramodern.3",
|
|
140
|
+
"@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.8.1-ultramodern.3",
|
|
141
|
+
"@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.8.1-ultramodern.3",
|
|
142
|
+
"@modern-js/server": "npm:@bleedingdev/modern-js-server@3.8.1-ultramodern.3",
|
|
143
|
+
"@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.8.1-ultramodern.3",
|
|
144
|
+
"@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.8.1-ultramodern.3",
|
|
145
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.8.1-ultramodern.3",
|
|
146
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.8.1-ultramodern.3",
|
|
147
147
|
"@rsbuild/core": "2.1.5",
|
|
148
148
|
"@swc/core": "1.15.43",
|
|
149
149
|
"@swc/helpers": "^0.5.23",
|