Skip to content

Commit ca8b88f

Browse files
authored
Update with router (#57)
* Update images urls * Update with router * Add newline * export types * Test token swap
1 parent 9269cb0 commit ca8b88f

19 files changed

+102
-112
lines changed

.browserslistrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Browsers we support
2+
Chrome >= 84
3+
Firefox >= 90
4+
Edge >= 84
5+
Safari >= 15
6+
iOS >= 15
7+
opera >= 70

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/FUNDING.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
github: tannerlinsley
2-
custom: https://youtube.com/tannerlinsley

.github/ISSUE_TEMPLATE/bug_report.yml

+24-70
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
name: '🐛 Bug report'
2-
description: Report a reproducible bug or regression
2+
description: Create a report to help us improve
33
body:
44
- type: markdown
55
attributes:
66
value: |
77
Thank you for reporting an issue :pray:.
88
9-
This issue tracker is for reporting reproducible bugs or regression's found in [tanstack-ranger](https://github.com/tanstack/ranger)
10-
If you have a question about how to achieve or implement something and are struggling, please post a question
11-
inside of tanstack-ranger's [Discussions tab](https://github.com/tanstack/ranger/discussions) instead of filing an issue.
9+
This issue tracker is for reporting bugs found in `react-ranger` (https://github.com/tanstack/ranger).
10+
If you have a question about how to achieve something and are struggling, please post a question
11+
inside of `react-ranger` Discussions tab: https://github.com/tanstack/ranger/discussions
1212
1313
Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
14-
- tanstack-ranger's [Discussions tab](https://github.com/tanstack/ranger/discussions)
15-
- tanstack-ranger's [Open Issues](https://github.com/tanstack/ranger/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
16-
- tanstack-ranger's [Closed Issues](https://github.com/tanstack/ranger/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed)
14+
- `react-ranger` Issues tab: https://github.com/tanstack/ranger/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
15+
- `react-ranger` closed issues tab: https://github.com/tanstack/ranger/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed
16+
- `react-ranger` Discussions tab: https://github.com/tanstack/ranger/discussions
1717
1818
The more information you fill in, the better the community can help you.
19-
20-
> ⚠️⚠️⚠️ TanStack Ranger v3 is on the horizon with beta builds and v2 is entering
21-
> an LTS phase and will only be receiving patch-level fixes. If you are experiencing
22-
> issues in v2 that require minor/feature or major/breaking changes, your issue will
23-
> be redirected to v8 or possibly even closed if the issue has already been fixed in v3.
24-
2519
- type: textarea
2620
id: description
2721
attributes:
@@ -32,28 +26,27 @@ body:
3226
- type: input
3327
id: link
3428
attributes:
35-
label: Your minimal, reproducible example
29+
label: Your Example Website or App
3630
description: |
37-
Please add a link to a minimal reproduction.
31+
Which website or app were you using when the bug happened?
3832
Note:
39-
- Your bug may get fixed much faster if we can run your code and it doesn't have dependencies other than React.
40-
- To create a shareable code example for web, you can use CodeSandbox (https://codesandbox.io/s/new) or Stackblitz (https://stackblitz.com/).
41-
- Please make sure the example is complete and runnable without prior dependencies and free of unnecessary abstractions
42-
- Feel free to fork any of the official CodeSandbox examples to reproduce your issue: https://github.com/tanstack/ranger/tree/main/examples/
43-
- For React Native, you can use: https://snack.expo.dev/
44-
- For TypeScript related issues only, a TypeScript Playground link might be sufficient: https://www.typescriptlang.org/play
45-
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
46-
placeholder: |
47-
e.g. Code Sandbox, Stackblitz, Expo Snack or TypeScript playground
33+
- Please provide a link via our pre-configured [Stackblitz project](https://stackblitz.com/github/tanstack/ranger/tree/beta/examples/react/quickstart?file=src%2Fmain.tsx) or a link to a repo that can reproduce the issue.
34+
- Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the `react-ranger` npm package / dependency.
35+
- To create a shareable code example you can use Stackblitz. Please no localhost URLs.
36+
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
37+
placeholder: reproduction URL
4838
validations:
4939
required: true
5040
- type: textarea
5141
id: steps
5242
attributes:
53-
label: Steps to reproduce
43+
label: Steps to Reproduce the Bug or Issue
5444
description: Describe the steps we have to take to reproduce the behavior.
5545
placeholder: |
56-
1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error
46+
1. Go to '...'
47+
2. Click on '....'
48+
3. Scroll down to '....'
49+
4. See error
5750
validations:
5851
required: true
5952
- type: textarea
@@ -62,20 +55,9 @@ body:
6255
label: Expected behavior
6356
description: Provide a clear and concise description of what you expected to happen.
6457
placeholder: |
65-
As a user, I expected **_ behavior but i am seeing _**
58+
As a user, I expected ___ behavior but i am seeing ___
6659
validations:
6760
required: true
68-
- type: dropdown
69-
attributes:
70-
options:
71-
- Every time
72-
- Often
73-
- Sometimes
74-
- Only once
75-
label: How often does this bug happen?
76-
description: |
77-
Following the repro steps above, how easily are you able to reproduce this bug?
78-
options: - Every time - Often - Sometimes - Only once
7961
- type: textarea
8062
id: screenshots_or_videos
8163
attributes:
@@ -90,42 +72,14 @@ body:
9072
id: platform
9173
attributes:
9274
label: Platform
93-
description: |
94-
Please let us know which Operting System, Browser and Browser version you were using when the issue occurred.
95-
placeholder: |
96-
- OS: [e.g. macOS, Windows, Linux, iOS, Android] - Browser: [e.g. Chrome, Safari, Firefox, React Native] - Version: [e.g. 91.1]
97-
validations:
98-
required: true
99-
- type: input
100-
id: library-version
101-
attributes:
102-
label: tanstack-ranger version
103-
description: |
104-
Please let us know the exact version of tanstack-ranger you were using when the issue occurred. Please don't just put in "latest", as this is subject to change.
105-
placeholder: |
106-
e.g. v3.30.1
75+
value: |
76+
- OS: [e.g. macOS, Windows, Linux]
77+
- Browser: [e.g. Chrome, Safari, Firefox]
78+
- Version: [e.g. 91.1]
10779
validations:
10880
required: true
109-
- type: input
110-
id: ts-version
111-
attributes:
112-
label: TypeScript version
113-
description: |
114-
If you are using TypeScript, please let us know the exact version of TypeScript you were using when the issue occurred.
115-
placeholder: |
116-
e.g. v4.5.4
11781
- type: textarea
11882
id: additional
11983
attributes:
12084
label: Additional context
12185
description: Add any other context about the problem here.
122-
- type: checkboxes
123-
id: agrees-to-terms
124-
attributes:
125-
label: Terms & Code of Conduct
126-
description: By submitting this issue, you agree to follow our Code of Conduct and can verify that you have followed the requirements outlined above to the best of your ability.
127-
options:
128-
- label: I agree to follow this project's Code of Conduct
129-
required: true
130-
- label: I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
131-
required: true

.github/ISSUE_TEMPLATE/config.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Feature Requests & Questions
4-
url: https://github.com/tanstack/ranger/discussions
3+
- name: 🤔 Feature Requests & Questions
4+
url: https://github.com/tanstack/router/discussions
55
about: Please ask and answer questions here.
6-
- name: Community Chat
6+
- name: 💬 Community Chat
77
url: https://discord.gg/mQd7egN
8-
about: A dedicated discord server hosted by TanStack
8+
about: A dedicated discord server hosted by Tanner Linsley
9+
- name: 💬 Tanstack Twitter
10+
url: https://twitter.com/tan_stack
11+
about: Stay up to date with new releases of our libraries

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=$NPM_TOKEN

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v12.13.1
1+
v14.17.6

CONTRIBUTING.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributing
2+
3+
- Clone the repo
4+
- `gh repo clone TanStack/ranger`
5+
- Ensure `node` is installed
6+
- https://nodejs.org/en/
7+
- Ensure `pnpm` is installed
8+
- https://pnpm.io/installation
9+
- Why? We use `pnpm` to manage workspace dependencies. It's easily the best monorepo/workspace experience available as of when this was written.
10+
- Install dependencies
11+
- `pnpm install`
12+
- This installs dependencies for all of the packages in the monorepo, even examples!
13+
- Dependencies inside of the packages and examples are automatically linked together as local/dynamic dependencies.
14+
- Run the build or dev watcher
15+
- `pnpm build` or
16+
- `pnpm dev`
17+
- Navigate to an example
18+
- `cd examples/react/basic`
19+
- Run the example
20+
- `pnpm dev`
21+
- Make changes to the code
22+
- If you ran `pnpm dev` the dev watcher will automatically rebuild the code that has changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-present Tanner Linsley
3+
Copyright (c) 2021 Tanner Linsley
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

babel.config.js

+18-11
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,31 @@ const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'
33
const loose = true
44

55
module.exports = {
6-
targets: 'defaults, not ie 11, not ie_mob 11',
76
presets: [
87
[
9-
'@babel/preset-env',
8+
'@babel/env',
109
{
1110
loose,
1211
modules: false,
12+
bugfixes: true,
13+
// useBuiltIns: false,
14+
// exclude: ['@babel/plugin-transform-regenerator'],
1315
},
1416
],
17+
'@babel/react',
1518
'@babel/preset-typescript',
1619
],
17-
plugins: [cjs && ['@babel/transform-modules-commonjs', { loose }]].filter(
18-
Boolean,
19-
),
20-
overrides: [
21-
{
22-
include: ['./packages/react-ranger/**'],
23-
presets: ['@babel/preset-react'],
24-
},
25-
],
20+
plugins: [
21+
// 'babel-plugin-transform-async-to-promises',
22+
cjs && ['@babel/transform-modules-commonjs', { loose }],
23+
// [
24+
// '@babel/transform-runtime',
25+
// {
26+
// useESModules: !cjs,
27+
// version: require('./package.json').devDependencies[
28+
// '@babel/runtime'
29+
// ].replace(/^[^0-9]*/, ''),
30+
// },
31+
// ],
32+
].filter(Boolean),
2633
}

lerna.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"packages": ["packages/*"],
3+
"version": "0.0.0",
4+
"npmClient": "yarn",
5+
"useWorkspaces": true
6+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"repository": "https://github.com/TanStack/ranger.git",
3+
"repository": "https://github.com/tanstack/ranger.git",
44
"scripts": {
55
"clean-dist": "pnpm -rc --parallel exec 'rm -rf build dist'",
66
"clean-all": "pnpm -rc --parallel exec 'rm -rf build dist node_modules'",

packages/ranger/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { linearInterpolator, getBoundingClientRect, sortNumList } from './utils'
22

3-
type RangerChangeEvent<TTrackElement> = (
3+
export type RangerChangeEvent<TTrackElement> = (
44
instance: Ranger<TTrackElement>,
55
) => void
66

7-
type RangerInterpolator = {
7+
export type RangerInterpolator = {
88
getPercentageForValue: (val: number, min: number, max: number) => number
99
getValueForClientX: (
1010
clientX: number,
@@ -14,7 +14,7 @@ type RangerInterpolator = {
1414
) => number
1515
}
1616

17-
type RangerClassConfig<TTrackElement = unknown> = {
17+
export type RangerClassConfig<TTrackElement = unknown> = {
1818
getRangerElement: () => TTrackElement | null
1919
values: ReadonlyArray<number>
2020

packages/react-ranger/src/index.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@ export function useRanger<TTrackElement>(
3131

3232
return instance
3333
}
34-
35-
export type { Ranger }

rollup.config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { RollupOptions } from 'rollup'
22
import babel from '@rollup/plugin-babel'
33
import { terser } from 'rollup-plugin-terser'
4+
// @ts-ignore
45
import size from 'rollup-plugin-size'
56
import visualizer from 'rollup-plugin-visualizer'
67
import replace from '@rollup/plugin-replace'
@@ -186,7 +187,7 @@ function umdProd({
186187
sourcemap: true,
187188
file: `${packageDir}/build/umd/index.production.js`,
188189
name: jsName,
189-
// globals,
190+
globals,
190191
banner,
191192
},
192193
plugins: [

scripts/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'path'
22
import { BranchConfig, Package } from './types'
33

4-
// TODO: List your npm packages here. The first package will be used as the versioner.
4+
// TODO: List your npm packages here.
55
export const packages: Package[] = [
66
{
77
name: '@tanstack/ranger',

scripts/tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"strict": true,
88
"noImplicitAny": true,
99
"skipLibCheck": true,
10-
"checkJs": true,
11-
"strictNullChecks": true
10+
"checkJs": true
1211
},
1312
"ts-node": {
1413
"transpileOnly": true,

scripts/utils.ts

-6
This file was deleted.

tsconfig.base.json

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
{
32
"compilerOptions": {
43
"lib": ["DOM", "DOM.Iterable", "ES2020"],
@@ -7,22 +6,20 @@
76
"moduleResolution": "node",
87
"allowSyntheticDefaultImports": true,
98
"strict": true,
10-
"noImplicitAny": true,
11-
"noImplicitReturns": false,
12-
"noImplicitThis": true,
13-
"noUnusedLocals": true,
14-
"noUnusedParameters": true,
159
"noUncheckedIndexedAccess": true,
1610
"strictNullChecks": true,
1711
"jsx": "react",
1812
"declaration": true,
1913
"emitDeclarationOnly": true,
14+
"noImplicitReturns": true,
2015
"esModuleInterop": true,
2116
"skipLibCheck": true,
2217
"baseUrl": ".",
2318
"paths": {
24-
"@tanstack/react-ranger": ["packages/react-ranger/src"],
25-
"@tanstack/ranger": ["packages/ranger/src"]
19+
"@tanstack/router": ["packages/router"],
20+
"@tanstack/react-router": ["packages/react-router"],
21+
"@tanstack/react-router-devtools": ["packages/react-router-devtools"],
22+
"@tanstack/router-cli": ["packages/router-cli"]
2623
}
2724
}
2825
}

0 commit comments

Comments
 (0)