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
Showing
47 changed files
with
4,251 additions
and
3,263 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = { | ||
extends: [ | ||
'eslint:recommended', | ||
|
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
language: node_js | ||
node_js: | ||
- node | ||
- 14 | ||
- 13 | ||
- 12 | ||
- 10 | ||
cache: yarn | ||
|
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
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/* eslint-env node */ | ||
|
||
module.exports = { | ||
presets: ['@babel/react', '@babel/preset-typescript'], | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"lerna": "3.20.2", | ||
"lerna": "3.22.1", | ||
"packages": ["packages/*"], | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"npmClient": "yarn", | ||
"useWorkspaces": true | ||
} |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...rnate-dev-helpers/src/components/index.ts → packages/dev-helpers/src/components/index.ts
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { default as DemoContainer } from './DemoContainer'; | ||
export * from './DemoContainer'; | ||
|
||
export { default as NestedState } from './NestedState'; | ||
export * from './NestedState'; |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...t-hibernate-dev-helpers/src/jest/index.ts → packages/dev-helpers/src/jest/index.ts
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { default as renderWithRouterContext } from './renderWithRouterContext'; | ||
export * from './renderWithRouterContext'; | ||
|
||
export * from './suppressReactDevErrors'; |
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...-hibernate-dev-helpers/src/redux/index.ts → packages/dev-helpers/src/redux/index.ts
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { default as reduxDecorator } from './reduxDecorator'; | ||
export * from './reduxDecorator'; | ||
|
||
export { default as store } from './store'; | ||
export * from './store'; |
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
{ | ||
"extends": "../../tsconfig", | ||
|
||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"baseUrl": "./" | ||
}, | ||
"include": ["./src"] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
# Unless https://github.com/prettier/prettier/issues/4081 is ever resolved, | ||
# this MUST be copied into each package dir for local runs to work. | ||
|
||
# Whitelist supported files only | ||
**/*.* | ||
!**/*.css | ||
!**/*.html | ||
!**/*.js | ||
!**/*.jsx | ||
!**/*.json | ||
!**/*.less | ||
!**/*.md | ||
!**/*.scss | ||
!**/*.ts | ||
!**/*.tsx | ||
|
||
# Unless they're somewhere we can ignore | ||
build/ | ||
dist/ | ||
coverage/ | ||
coverage-local/ | ||
node_modules/ | ||
storybook-static/ |
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,33 @@ | ||
# React-Hibernate | ||
|
||
**This package is in active development. Things will change rapidly, and it is not yet production-ready. Feedback is welcome.** | ||
|
||
Restore previously-unmounted subtrees -- state and all -- on remount. | ||
|
||
[![npm version](https://img.shields.io/npm/v/react-hibernate.svg)](https://www.npmjs.com/package/react-hibernate) | ||
[![gzip size](https://img.shields.io/bundlephobia/minzip/react-hibernate)](https://bundlephobia.com/result?p=react-hibernate@latest) | ||
|
||
## Core Package | ||
|
||
This package provides the main functionality for [React-Hibernate](../../). | ||
|
||
## Roadmap | ||
|
||
- [x] Proof of concept | ||
- [x] Project scaffolding | ||
- [x] Core functionality | ||
- [ ] Tests (in progress) | ||
- [x] Demos | ||
- [x] Monorepo | ||
- [ ] Initial release | ||
- [ ] Explore: `useHibernatingEffect` hook (successfully prototyped) | ||
- [ ] Explore: `maxCacheTime` override per-route (successfully prototyped) | ||
- [ ] Explore: Options to better control which/when to add a subtree | ||
- [ ] Explore: React-Router v6 | ||
|
||
#### Known Issues | ||
|
||
"Cannot update a component from inside the function body of a different component" warning in React 16.13 | ||
|
||
- This will be addressed as part of supporting React-Router v6, when subtree activation will need to be done via a | ||
component instead of a callback. |
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,7 @@ | ||
/* eslint-env node */ | ||
const baseConfig = require('../../jest-base.config'); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
coverageDirectory: 'coverage-local', | ||
}; |
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,66 @@ | ||
{ | ||
"name": "react-hibernate", | ||
"version": "0.0.2", | ||
"description": "Restore previously-unmounted subtrees -- state and all -- on remount.", | ||
"keywords": [], | ||
"license": "MIT", | ||
"homepage": "https://github.com/spautz/react-hibernate#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/spautz/react-hibernate.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/spautz/react-hibernate/issues" | ||
}, | ||
"author": "Steven Pautz <spautz@gmail.com>", | ||
"files": [ | ||
"dist/", | ||
"src/", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"source": "src/index.ts", | ||
"main": "dist/index.js", | ||
"module": "dist/index.esm.js", | ||
"jsnext:main": "dist/index.esm.js", | ||
"types": "dist/index.d.ts", | ||
"sideEffects": false, | ||
"scripts": { | ||
"____ BASE COMMANDS _________________________________________________": "", | ||
"build": "microbundle build --jsx React.createElement", | ||
"build:watch": "microbundle watch --jsx React.createElement", | ||
"clean": "rimraf dist/ node_modules/.cache/", | ||
"format": "prettier --write \"**/*.*\"", | ||
"format:checkup": "prettier --list-different \"**/*.*\"", | ||
"lint": "eslint \"**/*.{js,jsx,json,ts,tsx}\"", | ||
"test": "echo \"@TODO: tests for react-hibernate\"", | ||
"test:clean": "rimraf coverage/", | ||
"test:coverage": "echo \"@TODO: tests for react-hibernate\"", | ||
"test:watch": "echo \"@TODO: tests for react-hibernate\"", | ||
"types": "tsc --noEmit --p tsconfig.json --jsx react", | ||
"____ HOOKS _________________________________________________________": "", | ||
"prepare": "yon build", | ||
"prebuild": "yon clean", | ||
"prerelease": "yon clean", | ||
"prepublishOnly": "yon checkup && yon build", | ||
"pretest": "yon test:clean", | ||
"____ INTEGRATION ___________________________________________________": "", | ||
"dev": "yon run format && yon run types && yon run lint", | ||
"checkup": "yon format:checkup && yon run types && yon run lint", | ||
"all": "yon run dev && yon run test:coverage && yon run build" | ||
}, | ||
"dependencies": { | ||
"limited-cache": "^0.5.0", | ||
"prop-types": "^15.7.2", | ||
"react-is": "^16.12.0", | ||
"react-reverse-portal": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"react-hibernate-dev-helpers": "0.0.2" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=16.8.0", | ||
"react-dom": ">=16.8.0", | ||
"react-router": ">=5.0.0" | ||
} | ||
} |
Oops, something went wrong.