Skip to content

Commit 82ad636

Browse files
authored
Merge pull request #4056 from reduxjs/feature/4x-update-build-tooling
2 parents c3cbe2e + 117be71 commit 82ad636

File tree

84 files changed

+7052
-4310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+7052
-4310
lines changed

.codesandbox/ci.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sandboxes": [
3+
"vanilla",
4+
"vanilla-ts"
5+
],
6+
"node": "14"
7+
}

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: timdorr

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,41 @@ name: "\U0001F41BBug report"
33
about: Something is wrong with Redux.
44
---
55

6-
**Do you want to request a _feature_ or report a _bug_?**
6+
<!--
7+
Thank you for contributing to open source!
78
8-
(If this is a _usage question_, please **do not post it here**—post it on [Stack Overflow](http://stackoverflow.com/questions/tagged/redux) instead. If this is not a “feature” or a “bug”, or the phrase “How do I...?” applies, then it's probably a usage question.)
9+
Do you need some help?
10+
======================
911
10-
**What is the current behavior?**
12+
The issue tracker is meant for bug reports only. This isn't the best place for support or usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:
1113
12-
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.**
14+
- Read the docs: https://redux.js.org/
15+
- Check out the troubleshooting guide: https://redux.js.org/troubleshooting
16+
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/redux
17+
- Ask in chat: https://www.reactiflux.com/
1318
14-
**What is the expected behavior?**
19+
Think you found a bug?
20+
======================
21+
The best bug report is a failing test in the repository as a pull request. Otherwise, please use the template below.
1522
16-
**Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?**
23+
-->
24+
25+
### Prior Issues
26+
27+
Are there any existing issues or PRs that relate to this problem? If so, link them here.
28+
29+
### What is the current behavior?
30+
31+
What does Redux do right now.
32+
33+
### Steps to Reproduce
34+
35+
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://codesandbox.io or similar.
36+
37+
### What is the expected behavior?
38+
39+
What should Redux be doing?
40+
41+
### Environment Details
42+
43+
Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?

.github/ISSUE_TEMPLATE/Custom.md

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: 👍 Feature Request
3+
about: I'd like Redux to do something new.
4+
---
5+
6+
<!--
7+
Thank you for contributing to open source!
8+
9+
Do you need some help?
10+
======================
11+
12+
The issue tracker is meant for feature requests and bug reports only. This isn't the best place for
13+
support or usage questions. Questions here don't have as much visibility as they do elsewhere. Before
14+
you ask a question, here are some resources to get help first:
15+
16+
- Read the docs: https://redux.js.org/
17+
- Check out the troubleshooting guide: https://redux.js.org/troubleshooting
18+
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/redux
19+
- Ask in chat: https://www.reactiflux.com/
20+
21+
Have a feature request?
22+
=======================
23+
Remove the template from below and provide thoughtful commentary *and code samples* on what this
24+
feature means for your product. What will it allow you to do that you can't do today? How will it
25+
make current work-arounds straightforward? What potential bugs and edge cases does it help to
26+
avoid? etc. Please keep it product-centric.
27+
28+
-->
29+
30+
## New Features
31+
32+
### What is the new or updated feature that you are suggesting?
33+
34+
### Why should this feature be included?
35+
36+
### What docs changes are needed to explain this?

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 🤔 Questions and Help
4+
url: https://redux.js.org/introduction/getting-started#help-and-discussion
5+
about: This is a bug tracker, not a support system. For usage questions, please use our support resources.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: "\U0001F4DD Documentation Fix"
3+
about: Fixing a problem in an existing docs page
4+
---
5+
6+
## What docs page needs to be fixed?
7+
8+
- **Section**:
9+
- **Page**:
10+
11+
## What is the problem?
12+
13+
## What should be changed to fix the problem?
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: "\U0001F4D6 New/Updated Documentation Content"
3+
about: Adding a new docs page, or updating content in an existing docs page
4+
---
5+
6+
## What docs page is being added or updated?
7+
8+
- **Section**:
9+
- **Page**:
10+
11+
## For Adding New Content
12+
13+
### What kind of content category is this page (tutorial, how-to, explanation, reference)?
14+
15+
### Who is the intended target audience?
16+
17+
#### What knowledge are we assuming they have?
18+
19+
### What are the intended results or takeaways from reading this page?
20+
21+
### What is the most critical info they should learn?
22+
23+
## For Updating Existing Content
24+
25+
### What updates should be made to the page?
26+
27+
### Do these updates change any of the assumptions or target audience? If so, how do they change?

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Thanks for the PR!
2+
3+
To better assist you, please select the type of PR you want to create.
4+
5+
Click the "Preview" tab above, and click on the link for the PR type:
6+
7+
- [:bug: Bug fix or new feature](?template=bugfix.md)
8+
- [:memo: Documentation Fix](?template=documentation-edit.md)
9+
- [:book: New/Updated Documentation Content](?template=documentation-new.md)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: :bug: Bug fix or new feature
3+
about: Fixing a problem with Redux
4+
---
5+
6+
## PR Type
7+
8+
### Does this PR add a new _feature_, or fix a _bug_?
9+
10+
### Why should this PR be included?
11+
12+
## Checklist
13+
14+
- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
15+
- [ ] Is there an existing issue for this PR?
16+
- _link issue here_
17+
- [ ] Have the files been linted and formatted?
18+
- [ ] Have the docs been updated to match the changes in the PR?
19+
- [ ] Have the tests been updated to match the changes in the PR?
20+
- [ ] Have you run the tests locally to confirm they pass?
21+
22+
## New Features
23+
24+
### What new capabilities does this PR add?
25+
26+
### What docs changes are needed to explain this?
27+
28+
## Bug Fixes
29+
30+
### What is the current behavior, and the steps to reproduce the issue?
31+
32+
### What is the expected behavior?
33+
34+
### How does this PR fix the problem?
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: :memo: Documentation Fix
3+
about: Fixing a problem in an existing docs page
4+
---
5+
6+
## Checklist
7+
8+
- [ ] Is there an existing issue for this PR?
9+
- _link issue here_
10+
- [ ] Have the files been linted and formatted?
11+
12+
## What docs page needs to be fixed?
13+
14+
- **Section**:
15+
- **Page**:
16+
17+
## What is the problem?
18+
19+
## What changes does this PR make to fix the problem?
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: :book: New/Updated Documentation Content
3+
about: Adding a new docs page, or updating content in an existing docs page
4+
---
5+
6+
## PR Type
7+
8+
**Does this PR add a _new_ page, or update an _existing_ page?**
9+
10+
## Checklist
11+
12+
- [ ] Is there an existing issue for this PR?
13+
- _link issue here_
14+
- [ ] Have the files been linted and formatted?
15+
16+
## What docs page is being added or updated?
17+
18+
- **Section**:
19+
- **Page**:
20+
21+
## For Adding New Content
22+
23+
### What kind of content category is this page (tutorial, how-to, explanation, reference)?
24+
25+
### Who is the intended target audience?
26+
27+
#### What knowledge are we assuming they have?
28+
29+
### What are the intended results or takeaways from reading this page?
30+
31+
### What is the most critical info they should learn?
32+
33+
## For Updating Existing Content
34+
35+
### What updates should be made to the page?
36+
37+
### Do these updates change any of the assumptions or target audience? If so, how do they change?

.github/workflows/size.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Bundle Size
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
name: Check compressed size
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2-beta
12+
with:
13+
fetch-depth: 1
14+
- uses: preactjs/compressed-size-action@v1
15+
with:
16+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
17+
pattern: './{dist,es,lib}/*.js'

.github/workflows/test.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [4.x]
6+
pull_request:
7+
branches: [4.x]
8+
9+
jobs:
10+
build:
11+
name: Test Suite
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Set up Node
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 14.x
19+
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Cache dependencies
24+
uses: actions/cache@v2
25+
with:
26+
path: ~/.npm
27+
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.OS }}-npm-
30+
${{ runner.OS }}-
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Check formatting
36+
run: npm run format:check
37+
38+
- name: Lint code
39+
run: npm run lint
40+
41+
- name: Run test suite
42+
run: npm test

.travis.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/Troubleshooting.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function todos(state = [], action) {
3131
// Wrong! This mutates state
3232
state.push({
3333
text: action.text,
34-
completed: false
34+
completed: false,
3535
})
3636
return state
3737
case 'COMPLETE_TODO':
@@ -55,16 +55,16 @@ function todos(state = [], action) {
5555
...state,
5656
{
5757
text: action.text,
58-
completed: false
59-
}
58+
completed: false,
59+
},
6060
]
6161
case 'COMPLETE_TODO':
6262
// Return a new array
6363
return state.map((todo, index) => {
6464
if (index === action.index) {
6565
// Copy the object before mutating
6666
return Object.assign({}, todo, {
67-
completed: true
67+
completed: true,
6868
})
6969
}
7070
return todo
@@ -82,7 +82,7 @@ It's more code, but it's exactly what makes Redux predictable and efficient. If
8282
return state.map((todo, index) => {
8383
if (index === action.index) {
8484
return Object.assign({}, todo, {
85-
completed: true
85+
completed: true,
8686
})
8787
}
8888
return todo
@@ -92,9 +92,9 @@ return state.map((todo, index) => {
9292
return update(state, {
9393
[action.index]: {
9494
completed: {
95-
$set: true
96-
}
97-
}
95+
$set: true,
96+
},
97+
},
9898
})
9999
```
100100

@@ -109,7 +109,7 @@ You can also enable the [object spread operator proposal](recipes/UsingObjectSpr
109109
return state.map((todo, index) => {
110110
if (index === action.index) {
111111
return Object.assign({}, todo, {
112-
completed: true
112+
completed: true,
113113
})
114114
}
115115
return todo

0 commit comments

Comments
 (0)