Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core, react): @stackflow/react/future #478

Merged
merged 44 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
44702a9
feat(react): `@stackflow/react/future`
tonyfromundefined Jul 18, 2024
84270c6
refactor: group common logics in `__internal__`
tonyfromundefined Jul 18, 2024
c4678bc
feat(react): init `future`
tonyfromundefined Jul 18, 2024
2eb6b4a
fix(react): import React
tonyfromundefined Jul 18, 2024
0fbd2a4
throw unimpl
tonyfromundefined Jul 18, 2024
7312151
feat(core): `createConfig()`
tonyfromundefined Jul 19, 2024
36bd141
조금씩 통합
tonyfromundefined Jul 19, 2024
c6bea00
WIP
tonyfromundefined Jul 19, 2024
18f420e
WIP
tonyfromundefined Jul 19, 2024
f639353
WIP: 짜잔
tonyfromundefined Jul 19, 2024
2129b3c
WIP
tonyfromundefined Jul 19, 2024
4e90ea9
WIP
tonyfromundefined Jul 19, 2024
54caf67
feat: loader
tonyfromundefined Jul 19, 2024
e189310
fix: vendor history-sync module
tonyfromundefined Jul 19, 2024
15930c0
rollback
tonyfromundefined Jul 19, 2024
6eda987
remove comment for future api
tonyfromundefined Jul 19, 2024
7c598b8
rollback
tonyfromundefined Jul 19, 2024
ce50789
fix types
tonyfromundefined Jul 19, 2024
149760a
feat: useStepFlow
tonyfromundefined Jul 19, 2024
08c2604
rollback
tonyfromundefined Jul 19, 2024
4370a93
feat: infer activity name without `as const`
malangcat Jul 25, 2024
4e36e27
feat: infer paramTypes without explicit `paramTypes` definition
malangcat Jul 25, 2024
9539fe0
feat: merge paramType from Activity and loader
malangcat Jul 25, 2024
73a30f9
format
tonyfromundefined Jul 26, 2024
4161db8
hmmmmm
tonyfromundefined Jul 26, 2024
892b62c
fix
tonyfromundefined Jul 29, 2024
ae44309
fix
tonyfromundefined Jul 29, 2024
d73a21f
fix interface
tonyfromundefined Jul 29, 2024
60af98b
feat(plugin-history-sync): ActivityDefinition.path
tonyfromundefined Jul 29, 2024
23395e8
fix dev
tonyfromundefined Jul 29, 2024
2468bde
tonyfromundefined Jul 29, 2024
42af779
remove unused dep
tonyfromundefined Jul 30, 2024
792ddaf
canary
tonyfromundefined Jul 30, 2024
36acc67
feat: initialContext.initialLoaderData
tonyfromundefined Jul 30, 2024
92dc4e0
initialLoaderData
tonyfromundefined Jul 30, 2024
aa38141
WIP: change stackflow ESM Only
tonyfromundefined Jul 30, 2024
ed1dc49
fix
tonyfromundefined Jul 30, 2024
c43a126
fix vercel build
tonyfromundefined Jul 31, 2024
20d7b38
support esm, cjs both
tonyfromundefined Jul 31, 2024
1ea5232
canary
tonyfromundefined Jul 31, 2024
fea287f
mjs -> js
tonyfromundefined Jul 31, 2024
a457501
changeset
tonyfromundefined Jul 31, 2024
e465bf9
changeset
tonyfromundefined Jul 31, 2024
814c7b7
change message
tonyfromundefined Jul 31, 2024
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
5 changes: 5 additions & 0 deletions .changeset/funny-pears-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stackflow/react": minor
---

Change package to ESM Only
5 changes: 5 additions & 0 deletions .changeset/plenty-birds-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@stackflow/react": minor
---

Future API
28 changes: 28 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"mode": "exit",
"tag": "canary",
"initialVersions": {
"@stackflow/config": "1.0.1-canary.0",
"@stackflow/core": "1.0.13",
"@stackflow/demo": "1.3.0-canary.0",
"@stackflow/docs": "1.2.25-canary.0",
"@stackflow/compat-await-push": "1.1.11-canary.0",
"@stackflow/link": "1.4.3-canary.0",
"@stackflow/plugin-basic-ui": "1.8.3-canary.0",
"@stackflow/plugin-devtools": "0.1.10",
"@stackflow/plugin-google-analytics-4": "1.1.13-canary.0",
"@stackflow/plugin-history-sync": "1.6.0-canary.0",
"@stackflow/plugin-map-initial-activity": "1.0.9-canary.0",
"@stackflow/plugin-preload": "1.3.3-canary.0",
"@stackflow/plugin-renderer-basic": "1.1.11-canary.0",
"@stackflow/plugin-renderer-web": "1.1.11-canary.0",
"@stackflow/plugin-stack-depth-change": "1.1.4",
"@stackflow/react": "1.2.0-canary.1",
"@stackflow/esbuild-config": "1.0.3"
},
"changesets": [
"funny-pears-fold",
"plenty-birds-learn",
"sixty-spiders-teach"
]
}
8 changes: 8 additions & 0 deletions .changeset/sixty-spiders-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@stackflow/plugin-history-sync": minor
"@stackflow/react": minor
"@stackflow/demo": minor
"@stackflow/config": patch
---

Future API
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ coverage
dist
lib

vite.config.js.timestamp-**
41 changes: 38 additions & 3 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @stackflow/config

## 1.0.1-canary.0

### Patch Changes

- Future API
29 changes: 29 additions & 0 deletions config/esbuild.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { context } = require("esbuild");
const config = require("@stackflow/esbuild-config");
const pkg = require("./package.json");

const watch = process.argv.includes("--watch");
const external = Object.keys({
...pkg.dependencies,
...pkg.peerDependencies,
});

Promise.all([
context({
...config({}),
format: "cjs",
external,
}).then((ctx) =>
watch ? ctx.watch() : ctx.rebuild().then(() => ctx.dispose()),
),
context({
...config({}),
format: "esm",
outExtension: {
".js": ".mjs",
},
external,
}).then((ctx) =>
watch ? ctx.watch() : ctx.rebuild().then(() => ctx.dispose()),
),
]).catch(() => process.exit(1));
49 changes: 49 additions & 0 deletions config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@stackflow/config",
"version": "1.0.1-canary.0",
"repository": {
"type": "git",
"url": "https://github.com/daangn/stackflow.git",
"directory": "config"
},
"license": "MIT",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
"src",
"README.md"
],
"scripts": {
"build": "yarn build:js && yarn build:dts",
"build:dts": "tsc --emitDeclarationOnly",
"build:js": "node ./esbuild.config.js",
"clean": "rimraf dist",
"dev": "yarn build:js --watch && yarn build:dts --watch",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@stackflow/esbuild-config": "^1.0.3",
"esbuild": "^0.23.0",
"rimraf": "^3.0.2",
"typescript": "^5.5.3",
"ultra-runner": "^3.10.5"
},
"publishConfig": {
"access": "public"
},
"ultra": {
"concurrent": [
"dev",
"build"
]
}
}
3 changes: 3 additions & 0 deletions config/src/ActivityBaseParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type ActivityBaseParams = {
[key in string]?: string;
};
6 changes: 6 additions & 0 deletions config/src/ActivityDefinition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { ActivityLoader } from "./ActivityLoader";

export interface ActivityDefinition<ActivityName extends string> {
name: ActivityName;
loader?: ActivityLoader<any>;
}
6 changes: 6 additions & 0 deletions config/src/ActivityLoader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { ActivityLoaderArgs } from "./ActivityLoaderArgs";
import type { RegisteredActivityParamTypes } from "./RegisteredActivityParamTypes";

export type ActivityLoader<
ActivityName extends Extract<keyof RegisteredActivityParamTypes, string>,
> = (args: ActivityLoaderArgs<ActivityName>) => any;
8 changes: 8 additions & 0 deletions config/src/ActivityLoaderArgs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { InferActivityParams } from "./InferActivityParams";
import type { RegisteredActivityParamTypes } from "./RegisteredActivityParamTypes";

export type ActivityLoaderArgs<
ActivityName extends Extract<keyof RegisteredActivityParamTypes, string>,
> = {
params: InferActivityParams<ActivityName>;
};
7 changes: 7 additions & 0 deletions config/src/Config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ActivityDefinition } from "./ActivityDefinition";

export type Config<T extends ActivityDefinition<string>> = {
activities: T[];
transitionDuration: number;
initialActivity?: () => T["name"];
};
8 changes: 8 additions & 0 deletions config/src/InferActivityParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { ActivityBaseParams } from "./ActivityBaseParams";
import type { RegisteredActivityParamTypes } from "./RegisteredActivityParamTypes";

export type InferActivityParams<
ActivityName extends Extract<keyof RegisteredActivityParamTypes, string>,
> = RegisteredActivityParamTypes[ActivityName] extends never
? ActivityBaseParams
: RegisteredActivityParamTypes[ActivityName];
2 changes: 2 additions & 0 deletions config/src/Register.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// biome-ignore lint/suspicious/noEmptyInterface: declaration merging
export interface Register {}
8 changes: 8 additions & 0 deletions config/src/RegisteredActivityParamTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { ActivityBaseParams } from "./ActivityBaseParams";
import type { Register } from "./Register";

export type RegisteredActivityParamTypes = keyof Register extends never
? {
[key: string]: ActivityBaseParams;
}
: Register;
9 changes: 9 additions & 0 deletions config/src/defineConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { ActivityDefinition } from "./ActivityDefinition";
import type { Config } from "./Config";

export function defineConfig<
ActivityName extends string,
Activity extends ActivityDefinition<ActivityName>,
>(config: Config<Activity>) {
return config;
}
9 changes: 9 additions & 0 deletions config/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export * from "./defineConfig";
export * from "./ActivityBaseParams";
export * from "./ActivityDefinition";
export * from "./ActivityLoader";
export * from "./ActivityLoaderArgs";
export * from "./Config";
export * from "./InferActivityParams";
export * from "./Register";
export * from "./RegisteredActivityParamTypes";
8 changes: 8 additions & 0 deletions config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": "./src",
"outDir": "./dist"
},
"exclude": ["./dist"]
}
19 changes: 19 additions & 0 deletions demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# @stackflow/demo

## 1.3.0-canary.0

### Minor Changes

- Future API

### Patch Changes

- Updated dependencies
- @stackflow/[email protected]
- @stackflow/[email protected]
- @stackflow/[email protected]
- @stackflow/[email protected]
- @stackflow/[email protected]
- @stackflow/[email protected]
- @stackflow/[email protected]
- @stackflow/[email protected]
- @stackflow/[email protected]

## 1.2.23

### Patch Changes
Expand Down
Loading
Loading