Commit Graph

411 Commits

Author SHA1 Message Date
James Daniels
5487096955 Now that we're GA don't publish RCs on latest v2.0.1 2020-02-26 16:15:40 -08:00
Jeff
325415e7b0 Fix useObservable edge case (#220)
* changes caused by updated prettier config
* change "share()" to "shareReplay(1)"
v2.0.0 v2.0.0-rc.3
2020-02-26 14:51:47 -08:00
James Daniels
51baa2266f Update preloadFirestore example 2020-02-25 23:31:33 -08:00
James Daniels
8a54d42d9e New preload API & larger column width (#219) v2.0.0-rc.2 2020-02-25 23:19:56 -08:00
James Daniels
ce716feab1 Using our subject/cache to fix the init race I introduced (#218)
* Using our subject/cache to fix the init race I introduced with the refactor

* Naming

* Await init on non-contextual app, if one is passed

* void | Promise<any> better describes the contract

* Global cache and test
2020-02-25 15:47:33 -08:00
Jeff
32c2bb3c40 [WIP] Docs updates 📚 (#208)
* add sdk init to docs

* add profile page example

* add Analytics example

* address review comments

* update root description

* enable concurrent mode in initial sample

* update quickstart

* automatically fork on stackblitz

* fix readme sample

* remove contributing in favor of contributing.md

* move docs links higher up

* document useObservable and preloadFirestoreDoc

* update usage docs

* add useTransition docs

* fix anchor links

* polish

* fix useobservable link

* Address James and David's in-person feedback
2020-02-25 11:49:51 -08:00
jhuleatt
c67dfa7554 update deps 2020-02-24 09:32:28 -08:00
jhuleatt
6065d7ffaa remove extra folder 2020-02-24 09:32:20 -08:00
James Daniels
e6962e38e7 Remove perf import on README
No longer need to manually import `firebase/performance`
2020-02-20 14:11:56 -08:00
James Daniels
3cebaa921a Refactoring use/preload and more (#215)
* Drop `initPerformance` (closes #207)
* Cleaning up the use/preload types
* Use my good friend `Proxy` to allow access to both the `serviceProps` and the initialized instance without double calling (e.g, `useAuth()()`)
* More checks against double initializing
* Added binding to the initialize call (closes #213)
* `SuspenseWithPerf` now lazy loads performance monitoring and uses the user timing API
* Fixed the CJS build with a better external test (closes #214)
v2.0.0-rc.1
2020-02-20 13:32:37 -08:00
James Daniels
aa0f822417 Updating the FOSS & Github urls 2020-02-19 21:26:06 -08:00
James Daniels
d1068fe9d3 Remove next and canary tags from README and quickstart 2020-02-12 16:45:57 -08:00
James Daniels
64d26c04ad Bump the timeout on Cloud Build 2020-02-12 16:20:54 -08:00
James Daniels
66246ca7ab Fix worked kinda, sorta, still flaking. Comment out for now. v2.0.0-rc.0 2020-02-12 15:36:44 -08:00
James Daniels
11d6a1926d Fix for the flaky test 2020-02-12 15:26:00 -08:00
David Smith
ca32a93aea Add hooks to get firestore document data once (#211)
* Add hooks to get firestore document data once
* use checkStartWithValue for consistency

Co-authored-by: James Daniels <james@jamesdaniels.net>
2020-02-12 13:07:48 -08:00
James Daniels
121f5e15f9 Refactor on the core observable engine (#210)
Refactoring `useObservable` and `preloadObservable` to be more suspense friendly.

The core idea here is that our "observable" should expose a promise that resolves on first emission (which can be thrown for suspense), a synchronous means of getting the latest value (to pass into `useState`), and a shared subscription for use thereafter (for `useEffect`).

As a matter of optimization they will keep their cache around for only a present amount of time (30 seconds by default) unless they are subscribed to (`useEffect`); in which case the cache will remain until the component is unloaded. This should be enough time to prevent suspense from thrashing.

To encapsulate this behavior this we've implemented our own `Subject`.

Other changes in this PR:

* Ensure that the observable cache has to be keyed very specifically taking into account the firebase app, options, etc.
* Make sure no cache keys overlap on tests & different exports
* We're using more typescript in the tests, build them as part of the main build step since jest wasn't playing nice
* There's still some meh types kicking around here, should take as an AI
* Errors are thrown again until the cache timeout elapses, put down a TODO for now
* `FirebaseAppProvider` now throws if the provided config does not match the existing instance options, rather than simply returning the default
* `FirebaseAppProvider` now takes an `appName` property allowing you to have more than one app
2020-02-12 12:59:03 -08:00
David East
e2f1b1f58c Preload settings callbacks (#205)
Provide a way for all SDKs to be initialized before they're called by any ReactFire hooks
2020-01-31 11:02:28 -08:00
David East
f417133bd0 Remote Config API (#204)
Add Remote Config
2020-01-30 10:27:58 -08:00
Jeff
33f1e6ae78 Fix build: "sh: 1: node: Permission denied" (#199)
* add `--unsafe-perm` flag

* remove . so that .nvmrc file is used
2020-01-17 15:35:57 -08:00
Jeff
6fff36284e Update Dependencies (#200)
* update deps

* fix rollup import
2020-01-16 14:52:23 -08:00
Jeff
4b90236831 Add *Data methods for RTDB (#184)
* extract checkOptions and friends

* add useDatabaseListData and useDatabaseObjectData

* update sample

* update types

* add to docs
2020-01-16 13:56:25 -08:00
Jeff
fb1c51691b correct contributing file (#198) 2020-01-15 16:39:53 -08:00
Jeff
e1daab435f add missing packages (#191) 2019-12-09 16:00:09 -08:00
James Daniels
1fce6b94ac Make npm canary version less sensitive to NPM version & fix sh syntax 2019-11-18 16:57:02 -08:00
James Daniels
854b2d2ee2 Publish release candidates under the NPM latest tag 2019-11-18 16:46:01 -08:00
James Daniels
592457eabf Don't ignore the rollup.js 2019-11-18 16:21:08 -08:00
Jeff
14ea5295f1 Remove all references to sample-complex and sample-simple (#187)
* remove all references to sample-complex

* remove sample-simple too
2019-11-13 14:43:38 -08:00
Jeff
2c02415cf0 fix package.json (#186) 2019-11-12 17:31:40 -08:00
jhuleatt
7820b0f162 remove the sample-complex folder 2019-11-11 16:59:08 -08:00
Jeff
b863eed4ff [WIP] Concurrent Mode! (#170)
* Move sample-simple to Concurrent Mode

* Preload a query and lazy import Firestore

* more work on async/preloading

* demonstrate useTransition

* Update docs

* add note about experimental react build

* Update rollup config

Now that we're doing lazy imports with multiple chunks,
rollup needs to output to a directory

* docs fixes

* lazy import the rest of the SDKs

* remove some extra imports

* remove some extra imports
2019-11-11 16:32:19 -08:00
Ricardo Lopes
2c9ad08e11 Fixed Firestore hooks return type definitions (#141) 2019-11-11 15:11:30 -08:00
Jeff
ff1c1ea053 Add a StorageImage component (#182) 2019-11-11 14:24:42 -08:00
James Daniels
e8506dc921 Merge pull request #181 from FirebaseExtended/compile_cjs
Generating CJS with rollup.js (fixes #146)
2019-11-07 19:29:38 -08:00
James Daniels
fa4bd673d9 Don't need browser: true in the resolve anylonger, defaults are ok 2019-11-07 15:27:45 -08:00
Chinmay Atrawalkar
99b729e68f 'added_React_Fragment' (#180) 2019-11-07 14:28:41 -08:00
James Daniels
5643497870 Generating CJS with rollup.js 2019-11-07 13:04:00 -08:00
Scott Prue
3875691c28 feat(auth): set auth.currentUser as its startWithValue in useUser - #158 (#172)
* feat(auth): set auth.currentUser as its startWithValue in useUser - #158

* fix(useUser): prevent flicker by only skipping suspending if auth.currentUser returns a user - [#172](https://github.com/FirebaseExtended/reactfire/pull/172)
2019-11-06 09:54:35 -08:00
Sean Emmer
d96bda44b4 update return type for AuthCheck and SuspenseWithPerf to JSX.Element (#162)
* update return type for AuthCheck and SuspenseWithPerf to JSX.Element

* remove changes to yarn.lock

* wrap AuthCheck fallback and children in React Fragment

* fix brackets
2019-11-05 15:06:41 -08:00
Jeff
6bf1f31a42 prevent suspend when initialValue is null (#177) 2019-11-05 14:41:18 -08:00
David East
49437e13e1 Merge pull request #164 from FirebaseExtended/jh-auth-claims
[New Stuff] Auth Custom Claims
2019-11-04 14:38:44 -07:00
Chinmay Atrawalkar
fa4e20e689 'changed_contribution_steps' (#173)
* 'changed_contribution_steps'

* 'revised_documentation'
2019-11-01 10:45:17 -07:00
Jeff
72b1c2d1b7 test and fix for error swallowing (#171) 2019-10-31 15:28:09 -07:00
Jeff
459d52452c Improve IDs passed to useObservable (#167)
* add realtime database tests

* better observable ids

* throw an error if no observableid is provided

* fix comment about emulators

* update the docs
2019-10-31 14:52:27 -07:00
Danny Tatom
0a4789a501 Clarify versions in README (#165) 2019-10-21 09:59:40 -07:00
jhuleatt
6b815c6d63 Implement AuthCheck's requiredClaims 2019-10-18 16:01:24 -07:00
Jeff
803159c62a Make sure useUser works predictably in AuthCheck (#156)
* Make sure useUser works predictably in AuthCheck

* add a test for useObservable too
2019-10-17 17:40:40 -07:00
Jeff
99dac6c4ca Fix SuspenseWithPerf error (#154)
* fix test to reproduce error when a suspense child throws a promise more than once

* create new trace every time the fallback renders
2019-10-11 17:10:14 -07:00
Jeff
0916a27839 Improve local dev experience (#152)
* make sample-simple depend on local reactfire instead of published version

* add a Prettier formatter pre-commit hook

* run prettier on the whole project

* Clarify local development instructions
2019-10-11 15:34:54 -07:00
David East
3462ec579f Feature: Add Firestore unwrap data hooks
Feature: Add Firestore unwrap data hooks
2019-10-11 13:57:34 -06:00