Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
dd27a68
#767: added meta information to configurations
petermasking Apr 29, 2026
ca90858
#767: made build manager input paths absolute
petermasking Apr 29, 2026
9be8a1a
#767: implemented build helper
petermasking Apr 29, 2026
8701154
#767: refactored the Vite plugin
petermasking Apr 29, 2026
9f825f6
#767: imporved / cleaned up plugin
petermasking Apr 29, 2026
eb3aa41
#767: improved import / export detection for rewriting
petermasking Apr 29, 2026
2a29dd6
#767: improved import/export patterns part 2
petermasking Apr 30, 2026
7b04716
#767: first draft of the new parser
petermasking May 2, 2026
c919b79
#767: New parser improvements
petermasking May 2, 2026
453c63f
#767: class related parser improvements
petermasking May 3, 2026
f280417
#767: finished class tests
petermasking May 4, 2026
664b113
#767: finished module tests
petermasking May 4, 2026
62d7206
#767: updated class and module tests
petermasking May 4, 2026
2998653
#767: added code regeneration test
petermasking May 4, 2026
e4a96f6
#767: extended module and class functionality
petermasking May 4, 2026
2834514
#767: refactored the reflector to the new model
petermasking May 4, 2026
23ad429
#767: addressed linting issues
petermasking May 4, 2026
250dc05
#767: created new index
petermasking May 4, 2026
2c14685
#767: refactored build and serialization packages
petermasking May 4, 2026
3976ce0
#767: cleaned up old parser
petermasking May 4, 2026
f7cc695
#767: extended list of operators
petermasking May 5, 2026
dd531bd
#767: extended the list of keywords
petermasking May 5, 2026
6e79a09
#767: added number token type
petermasking May 5, 2026
36d88e6
#767: extended number support
petermasking May 5, 2026
67b24b4
#767: added more value type support
petermasking May 5, 2026
bb2d5cf
#767: improved support for singleton exports
petermasking May 5, 2026
edc9c08
#767: implemented proper code generation
petermasking May 6, 2026
d1a8ec0
#767: updated parameter building
petermasking May 6, 2026
dc4c4a9
#767: made analysis model mutable and clonable
petermasking May 6, 2026
e10ce7d
#767: updated reflector
petermasking May 6, 2026
181b208
#767: updated lexer tests
petermasking May 6, 2026
ca8cda9
#767: set up body for ASI
petermasking May 7, 2026
3f7e4ba
#767: refactored module building
petermasking May 8, 2026
56227ea
#767: fixed segmented module generation
petermasking May 8, 2026
caf6513
#767: restored hello world example
petermasking May 8, 2026
f00e383
#767: refactored segment generation
petermasking May 8, 2026
f789edc
#767: processed tools feedback
petermasking May 8, 2026
55dc30b
#767: updated typescript configurations
petermasking May 8, 2026
75a23cc
#767: implemented missing errors
petermasking May 8, 2026
9758c63
#767: updated documentation
petermasking May 8, 2026
3c04687
#767: processed review feedback
petermasking May 8, 2026
9a50dcb
#767: updated dependencies
petermasking May 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions documentation/docs/develop/writing-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@ Functions can return any value that can be [(de)serialized](./data-sharing.md#au

### Arrow functions

Arrow functions are supported, but come with an important limitation. Jitar uses the function's `this` to pass context information (headers) for creating remote calls. Array functions do not have a `this` and can't provide any context.
Arrow functions are NOT supported by the segmentation system, but can be safely used inside a segment.

```ts
export const sayHello = (name: string) => { /* … */ };
// src/domain/sayHello.ts
export const sayHello = async (name: string): Promise<string> =>
{
return `Hello, ${name}!`;
};
```

This example works with the default Jitar setup, but will break when using [middleware](./middleware) that sets additional headers like authorization. To avoid this we recommend using normal functions in any situation.
Trying to segment this function results into an error a build level.

### Importing and calling

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/fundamentals/building-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To ensure your application can be broken into segments and keeps working after d
1. Must be exported (named or as default)
1. Must be stateless / pure (don't depend on global values)

As long as you follow these rules, all will be fine. One thing to keep in mind is that arrow functions are supported, but can only be safely used in a non-distributed context. Meaning that the function does not call another function that might be in another segment. Besides that, we don't like to mix styles and recommend writing normal functions in any case.
As long as you follow these rules, all will be fine. One thing to keep in mind is that arrow functions are NOT supported for segmentation. Besides that, we don't like to mix styles and recommend writing normal functions in any case.

More in depth information on writing functions and the rules can be found in the [DEVELOP section](../develop/writing-functions).

Expand Down
16 changes: 9 additions & 7 deletions documentation/docs/integrate/vite-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ const JITAR_SEGMENTS = ['frontend'];
const JITAR_MIDDLEWARES = ['./requesterMiddleware'];

const jitarConfig: JitarConfig = {
sourceDir: 'src',
targetDir: 'dist',
jitarDir: 'domain',
projectRoot: '../../',
sourceRoot: '../',
configurationFile: './jitar.json',
environmentFile: './dev.env',
jitarUrl: JITAR_URL,
segments: JITAR_SEGMENTS,
middleware: JITAR_MIDDLEWARES
Expand All @@ -63,11 +64,12 @@ export default defineConfig({
});
```

The plugin configuration has 6 parameters:
The plugin configuration has 5 parameters:

1. sourceDir - The directory of the app source files. In most cases this is the `src` folder.
1. targetDir - The directory of the output folder of the Vite build. This is the folder that Jitar uses as input for creating its cache.
1. jitarDir - The directory of the source files used by Jitar. This path is relative to the source root. We like to use `domain` (which points to `src/domain`), but feel free to use something else.
1. projectRoot - The root directory of the the project relative to the Vite configuration.
1. sourceRoot - The source directory relative to the Vite configuration.
1. configurationFile - The Jitar configuration file relative to the project root. Jitar uses `./jitar.json` by default.
1. environmentFile - The environment file relative to the project root. Is only loaded when configured.
1. jitarUrl - The URL of the Jitar instance. Jitar uses by default `http://localhost:3000`, but can be configured differently.
1. segments - The segments to use for the client app. This is an array of strings. The default is an empty array.
1. middlewares - The middlewares to use for calling remote procedures. This is an array of strings. The default is an empty array.
Expand Down
22 changes: 6 additions & 16 deletions examples/access-protection/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
22 changes: 6 additions & 16 deletions examples/data-transportation/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
22 changes: 6 additions & 16 deletions examples/error-handling/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
16 changes: 5 additions & 11 deletions examples/health-checks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":
{
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": ["cache", "dist", "node_modules"]
}
"include": ["./src"]
}
22 changes: 6 additions & 16 deletions examples/hello-world/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
22 changes: 6 additions & 16 deletions examples/load-balancing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
16 changes: 5 additions & 11 deletions examples/middleware/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions":
{
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": ["cache", "dist", "node_modules"]
}
"include": ["./src"]
}
22 changes: 6 additions & 16 deletions examples/multi-version/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
22 changes: 6 additions & 16 deletions examples/resources/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
22 changes: 6 additions & 16 deletions examples/segmentation/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"compilerOptions": {
"target": "es2022",
"module": "es2022",
"rootDir": "./src/",
"moduleResolution": "node",
"outDir": "./dist",
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"extends": "../../tsconfig.json",
"compilerOptions":
{
"rootDir": "./src",
"outDir": "./dist"
},
"exclude": [
"cache",
"dist",
"node_modules",
"segments"
]
"include": ["./src"]
}
Loading
Loading