@nerest/nerest 1.6.0 → 1.7.1

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/README.md CHANGED
@@ -121,14 +121,6 @@ Include specified PostCSS plugins in the build by providing their full package n
121
121
 
122
122
  In the above example, `postcss-extend` is added to vite's PostCSS configuration with default options, enabling the use of `@extend` rules in CSS code. `postcss-short` is added with specific options provided.
123
123
 
124
- #### clientSideEffects: `string[]`
125
-
126
- List of names of apps that have client side-effects, for example have their own self-initialization code that runs on import. Their entries will be loaded when hydration starts to run side-effect code.
127
-
128
- ```
129
- "clientSideEffects": ["foo", "bar"]
130
- ```
131
-
132
124
  ### Runtime
133
125
 
134
126
  If the module `nerest/runtime.ts` exists in the micro frontend's root directory and exports a default function, it will be executed when the server starts. The Fastify app instance will be passed as the function's only argument. Example of `nerest/runtime.ts`:
@@ -18,9 +18,6 @@ export async function viteConfigShared({
18
18
  }: BuildArgs): Promise<InlineConfig> {
19
19
  // This will be available to client scripts with import.meta.env
20
20
  process.env.NEREST_PROJECT_NAME = project.name;
21
- process.env.NEREST_CLIENT_SIDE_EFFECTS = JSON.stringify(
22
- buildConfig?.clientSideEffects ?? []
23
- );
24
21
 
25
22
  return {
26
23
  root,
package/client/index.ts CHANGED
@@ -46,11 +46,3 @@ if (document.readyState !== 'complete') {
46
46
  } else {
47
47
  runHydration();
48
48
  }
49
-
50
- // Entries might be self-initializing (e.g. client-only apps) or have other
51
- // side effects. In that case we have to load them eagerly, so that their
52
- // initialization code can run, even if there is nothing to hydrate.
53
- const clientSideEffects: string[] | undefined = JSON.parse(
54
- import.meta.env.NEREST_CLIENT_SIDE_EFFECTS
55
- );
56
- clientSideEffects?.forEach((name) => modules[`/apps/${name}/index.tsx`]?.());
@@ -1,7 +1,6 @@
1
1
  export async function viteConfigShared({ root, base, buildConfig, project, }) {
2
2
  // This will be available to client scripts with import.meta.env
3
3
  process.env.NEREST_PROJECT_NAME = project.name;
4
- process.env.NEREST_CLIENT_SIDE_EFFECTS = JSON.stringify(buildConfig?.clientSideEffects ?? []);
5
4
  return {
6
5
  root,
7
6
  base,
@@ -32,8 +32,3 @@ if (document.readyState !== 'complete') {
32
32
  else {
33
33
  runHydration();
34
34
  }
35
- // Entries might be self-initializing (e.g. client-only apps) or have other
36
- // side effects. In that case we have to load them eagerly, so that their
37
- // initialization code can run, even if there is nothing to hydrate.
38
- const clientSideEffects = JSON.parse(import.meta.env.NEREST_CLIENT_SIDE_EFFECTS);
39
- clientSideEffects?.forEach((name) => modules[`/apps/${name}/index.tsx`]?.());
@@ -1 +1 @@
1
- export declare function runLoggerHook(loader: () => Promise<unknown>): Promise<boolean | (import("fastify").FastifyLoggerOptions<import("fastify").RawServerDefault, import("fastify").FastifyRequest<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown, import("fastify").FastifyBaseLogger, import("fastify/types/type-provider.js").ResolveFastifyRequestType<import("fastify").FastifyTypeProviderDefault, import("fastify").FastifySchema, import("fastify").RouteGenericInterface>>, import("fastify").FastifyReply<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown>> & import("fastify/types/logger.js").PinoLoggerOptions) | null | undefined>;
1
+ export declare function runLoggerHook(loader: () => Promise<unknown>): Promise<boolean | (import("fastify").FastifyLoggerOptions<import("fastify").RawServerDefault, import("fastify").FastifyRequest<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("node:http").IncomingMessage, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown, import("fastify").FastifyBaseLogger, import("fastify/types/type-provider.js").ResolveFastifyRequestType<import("fastify").FastifyTypeProviderDefault, import("fastify").FastifySchema, import("fastify").RouteGenericInterface>>, import("fastify").FastifyReply<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("node:http").IncomingMessage, import("node:http").ServerResponse<import("node:http").IncomingMessage>, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown>> & import("pino").LoggerOptions<never, boolean>) | null | undefined>;
@@ -14,7 +14,7 @@ export async function runRuntimeHook(app, loader) {
14
14
  await module.default(app);
15
15
  }
16
16
  catch (e) {
17
- app.log.fatal('Failed to execute runtime hook', e);
17
+ app.log.fatal(e, 'Failed to execute runtime hook');
18
18
  process.exit(1);
19
19
  }
20
20
  }
@@ -1,2 +1 @@
1
- import RefParser from '@apidevtools/json-schema-ref-parser';
2
- export declare function loadAppSchema(appRoot: string): Promise<RefParser.JSONSchema | null>;
1
+ export declare function loadAppSchema(appRoot: string): Promise<import("@apidevtools/json-schema-ref-parser").JSONSchema | null>;
@@ -10,5 +10,5 @@ type ServerOptions = {
10
10
  loadPropsHook: (entry: string) => Promise<unknown>;
11
11
  loadRuntimeHook: () => Promise<unknown>;
12
12
  };
13
- export declare function createServer(options: ServerOptions): Promise<fastify.FastifyInstance<fastify.RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>>;
13
+ export declare function createServer(options: ServerOptions): Promise<fastify.FastifyInstance<fastify.RawServerDefault, import("node:http").IncomingMessage, import("node:http").ServerResponse<import("node:http").IncomingMessage>, fastify.FastifyBaseLogger, fastify.FastifyTypeProviderDefault>>;
14
14
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nerest/nerest",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "description": "React micro frontend framework",
5
5
  "homepage": "https://github.com/nerestjs/nerest",
6
6
  "repository": {
@@ -49,39 +49,39 @@
49
49
  ]
50
50
  },
51
51
  "dependencies": {
52
- "@apidevtools/json-schema-ref-parser": "^14.0.3",
53
- "@fastify/middie": "^9.0.3",
54
- "@fastify/static": "^8.2.0",
55
- "@fastify/swagger": "^9.5.1",
56
- "@fastify/swagger-ui": "^5.2.3",
52
+ "@apidevtools/json-schema-ref-parser": "^15.1.3",
53
+ "@fastify/middie": "^9.1.0",
54
+ "@fastify/static": "^9.0.0",
55
+ "@fastify/swagger": "^9.6.1",
56
+ "@fastify/swagger-ui": "^5.2.4",
57
57
  "ajv": "^8.17.1",
58
58
  "ajv-formats": "^3.0.1",
59
- "dotenv": "^17.0.1",
59
+ "dotenv": "^17.2.3",
60
60
  "fast-glob": "^3.3.3",
61
- "fast-uri": "^3.0.6",
62
- "fastify": "^5.4.0",
63
- "fastify-graceful-shutdown": "^4.0.1",
61
+ "fast-uri": "^3.1.0",
62
+ "fastify": "^5.6.2",
63
+ "fastify-graceful-shutdown": "^5.0.0",
64
64
  "json-schema-to-typescript": "^15.0.4",
65
- "vite": "^7.0.0",
65
+ "vite": "^7.3.1",
66
66
  "vite-plugin-externals": "^0.6.2"
67
67
  },
68
68
  "devDependencies": {
69
- "@commitlint/cli": "^19.8.1",
70
- "@commitlint/config-conventional": "^19.8.1",
71
- "@playwright/test": "^1.53.2",
69
+ "@commitlint/cli": "^20.3.1",
70
+ "@commitlint/config-conventional": "^20.3.1",
71
+ "@playwright/test": "^1.57.0",
72
72
  "@tinkoff/eslint-config": "^5.0.1",
73
73
  "@tinkoff/eslint-config-react": "^5.0.1",
74
74
  "@tinkoff/prettier-config": "^5.0.0",
75
- "@types/react": "^19.1.8",
76
- "@types/react-dom": "^19.1.6",
77
- "execa": "^9.6.0",
78
- "lint-staged": "^16.1.2",
79
- "react": "^19.1.0",
80
- "react-dom": "^19.1.0",
81
- "simple-git-hooks": "^2.13.0",
82
- "sort-package-json": "^3.3.1",
83
- "typescript": "^5.8.3",
84
- "vitest": "^3.2.4"
75
+ "@types/react": "^19.2.8",
76
+ "@types/react-dom": "^19.2.3",
77
+ "execa": "^9.6.1",
78
+ "lint-staged": "^16.2.7",
79
+ "react": "^19.2.3",
80
+ "react-dom": "^19.2.3",
81
+ "simple-git-hooks": "^2.13.1",
82
+ "sort-package-json": "^3.6.0",
83
+ "typescript": "^5.9.3",
84
+ "vitest": "^4.0.16"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "react": "^18.0.0 || ^19.0.0",
@@ -26,9 +26,5 @@ export interface BuildConfiguration {
26
26
  };
27
27
  [k: string]: unknown;
28
28
  };
29
- /**
30
- * List of names of apps that have client side-effects, for example have their own self-initialization code that runs on import. Their entries will be loaded when hydration starts to run side-effect code.
31
- */
32
- clientSideEffects?: string[];
33
29
  [k: string]: unknown;
34
30
  }
@@ -30,13 +30,6 @@
30
30
  }
31
31
  }
32
32
  }
33
- },
34
- "clientSideEffects": {
35
- "description": "List of names of apps that have client side-effects, for example have their own self-initialization code that runs on import. Their entries will be loaded when hydration starts to run side-effect code.",
36
- "type": "array",
37
- "items": {
38
- "type": "string"
39
- }
40
33
  }
41
34
  }
42
35
  }
@@ -23,7 +23,7 @@ export async function runRuntimeHook(
23
23
  try {
24
24
  await module.default(app);
25
25
  } catch (e) {
26
- app.log.fatal('Failed to execute runtime hook', e);
26
+ app.log.fatal(e, 'Failed to execute runtime hook');
27
27
  process.exit(1);
28
28
  }
29
29
  } else if (module) {