-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Armin Jazi
committed
Apr 11, 2024
0 parents
commit 122509d
Showing
53 changed files
with
10,254 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/recommended", | ||
"prettier" | ||
], | ||
"overrides": [], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"indent": ["error", 2], | ||
"linebreak-style": ["error", "unix"], | ||
"quotes": ["error", "double"], | ||
"semi": ["error", "always"], | ||
"import/no-unresolved": "error" | ||
}, | ||
"settings": { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".tsx"] | ||
}, | ||
"import/resolver": { | ||
"typescript": { | ||
"alwaysTryTypes": true, | ||
"project": ["tsconfig.json"] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# These are some examples of commonly ignored file patterns. | ||
# You should customize this list as applicable to your project. | ||
# Learn more about .gitignore: | ||
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore | ||
|
||
# Node artifact files | ||
node_modules/ | ||
dist/ | ||
|
||
# Compiled Java class files | ||
*.class | ||
|
||
# Compiled Python bytecode | ||
*.py[cod] | ||
|
||
# Log files | ||
*.log | ||
|
||
# Package files | ||
*.jar | ||
|
||
# Maven | ||
target/ | ||
|
||
# JetBrains IDE | ||
.idea/ | ||
|
||
# Unit test reports | ||
TEST*.xml | ||
|
||
# Generated by MacOS | ||
.DS_Store | ||
|
||
# Generated by Windows | ||
Thumbs.db | ||
|
||
# Applications | ||
*.app | ||
*.exe | ||
*.war | ||
|
||
# Large media files | ||
*.mp4 | ||
*.tiff | ||
*.avi | ||
*.flv | ||
*.mov | ||
*.wmv | ||
|
||
|
||
# Logs | ||
logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
stages: | ||
- test | ||
- publish | ||
|
||
test-job: | ||
image: node:16.14.2 | ||
stage: test | ||
cache: | ||
key: npm | ||
policy: pull-push | ||
paths: | ||
- .npm/ | ||
script: | ||
- npm ci | ||
- npm run lint | ||
- npm run test:unit | ||
- npm run build | ||
artifacts: | ||
paths: | ||
- node_modules/ | ||
- dist/ | ||
expire_in: 1 days | ||
tags: | ||
- infra-cicd | ||
|
||
publish-job: | ||
image: node:16.14.2 | ||
stage: publish | ||
only: | ||
- /^release\/*/ | ||
cache: | ||
key: npm | ||
policy: pull-push | ||
paths: | ||
- .npm/ | ||
script: | ||
- echo "//registry.npmjs.org/:_authToken=${NPM_PUBLISH_TOKEN}">.npmrc | ||
- npm publish | ||
tags: | ||
- infra-cicd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16.14.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## TODOS | ||
|
||
- [ ] add default cache and use query integration tests | ||
- [ ] add global sync default cache and use query integration tests | ||
- [ ] variables as query keys. | ||
- [ ] optimistic UI queries | ||
- [ ] storage options -> session, cookie, indexdb etc… | ||
- [ ] Performance optimizations like pagination and lazy loading data | ||
- [ ] Deduping multiple requests for the same data into a single request | ||
- [ ] refetchOnReconnect, refetchInterval | ||
- [ ] retry mechanism | ||
- [ ] structural sharing | ||
- [ ] dependent queries | ||
```javascript | ||
let userId = null; | ||
useQuery(['user', email], getUserByEmail, { | ||
onSuccess: (user) => { | ||
userId = user.id; | ||
}, | ||
}) | ||
useQuery(['projects', userId], getProjectsByUser, | ||
{ | ||
// The query will not execute until the userId exists | ||
enabled: !!userId, | ||
} | ||
) | ||
``` | ||
- [ ] refetchInterval number | false | ||
- [ ] refetchIntervalInBackground boolean | ||
- [ ] refetchOnMount boolean | ||
- [ ] refetchOnReconnect boolean | ||
|
||
|
||
## Fetching Indicators | ||
|
||
- isLoading: indicates a hard state reload | ||
- isFetching: indicates a background state reload, where initial data is still available through cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + TS</title> | ||
<style> | ||
.shell { | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
grid-gap: 4rem; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
min-height: 100vh; | ||
margin: auto; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="shell"> | ||
<div id="app-1"> | ||
<h1>App 1 - sync</h1> | ||
</div> | ||
<div id="app-2"> | ||
<h1>App 2 - sync</h1> | ||
</div> | ||
<div id="app-3"> | ||
<h1>App 3 - sync</h1> | ||
</div> | ||
<div id="app-4"> | ||
<h1>App 4 - non-sync</h1> | ||
</div> | ||
</div> | ||
<script type="module" src="/src/app-1/main.ts"></script> | ||
<script type="module" src="/src/app-2/main.ts"></script> | ||
<script type="module" src="/src/app-3/main.ts"></script> | ||
<script type="module" src="/src/app-4/main.ts"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.