From 6064ccf846f305fb3b9e50c7983ce0902ec1729d Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Fri, 7 Aug 2020 17:45:54 -0400 Subject: [PATCH 01/28] Update MFA companion package --- companion-packages/meteorrn-ndev-mfa/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/companion-packages/meteorrn-ndev-mfa/index.js b/companion-packages/meteorrn-ndev-mfa/index.js index 2492c2d..93b70e5 100644 --- a/companion-packages/meteorrn-ndev-mfa/index.js +++ b/companion-packages/meteorrn-ndev-mfa/index.js @@ -26,7 +26,7 @@ let assembleChallengeCompletionArguments = async function (finishLoginParams, co assertion = {challengeId, challengeSecret, ...code}; } else { - assertion = await solveU2FChallenge(res); + throw new Error("Code must be a U2FAuthorizationCode"); } methodArguments.push(assertion); } From 7e6cf8601f071f5a5361651a90d3de3a4fae09c9 Mon Sep 17 00:00:00 2001 From: Polaris Web Technology Date: Fri, 7 Aug 2020 14:49:57 -0700 Subject: [PATCH 02/28] Replace code for depreciated componentWillMount() (#10) * Allow other AsyncStorage packages to be used * Allows for option to specify AsyncStorage package... Either React Native Async Storage (Expo), with fallback using @react-native-community/async-storage if no AsyncStorage is provided for backwards compatibility. * Remove commented code * Fix package version * Add "Custom Storage Adapter" to Installation * Update AsyncStorage options * Bump package version to 2.0.2 since no longer a breaking change * Throw an error instead of console error if no AsyncStorage installed * Remove dead code `setItem()` * Temporary solution to depreciated componentWillUpdate... Using the [`UNSAFE_componentWillUpdate()`](https://reactjs.org/docs/react-component.html#unsafe_componentwillupdate) version to get throgh React v17. * Moved code to a constructor to replace componentWillMount()... depreciated code Co-authored-by: Nathaniel Dsouza --- src/components/ReactMeteorData.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/ReactMeteorData.js b/src/components/ReactMeteorData.js index 21963a7..cfce2ff 100644 --- a/src/components/ReactMeteorData.js +++ b/src/components/ReactMeteorData.js @@ -5,16 +5,7 @@ import Data from '../Data'; import MeteorDataManager from './MeteorDataManager'; const ReactMeteorData = { - UNSAFE_componentWillMount() { - Data.waitDdpReady(() => { - if (this.getMeteorData) { - this.data = {}; - this._meteorDataManager = new MeteorDataManager(this); - const newData = this._meteorDataManager.calculateData(); - this._meteorDataManager.updateData(newData); - } - }); - }, + UNSAFE_componentWillUpdate(nextProps, nextState) { if (this.startMeteorSubscriptions) { @@ -65,6 +56,7 @@ export { ReactMeteorData }; class ReactComponent extends React.Component {} Object.assign(ReactComponent.prototype, ReactMeteorData); + class ReactPureComponent extends React.PureComponent {} Object.assign(ReactPureComponent.prototype, ReactMeteorData); @@ -81,9 +73,23 @@ export default function connect(options) { const BaseComponent = pure ? ReactPureComponent : ReactComponent; return WrappedComponent => class ReactMeteorDataComponent extends BaseComponent { + constructor(props) { + super(props); + + Data.waitDdpReady(() => { + if (this.getMeteorData) { + this.data = {}; + this._meteorDataManager = new MeteorDataManager(this); + const newData = this._meteorDataManager.calculateData(); + this._meteorDataManager.updateData(newData); + } + }); + } + getMeteorData() { return getMeteorData(this.props); } + render() { return ; } From faf2ea390ba57cec3df513cd1df58047cf823778 Mon Sep 17 00:00:00 2001 From: Sandeep Jain Date: Sat, 8 Aug 2020 03:20:22 +0530 Subject: [PATCH 03/28] Add useTracker function (#17) --- src/Meteor.js | 2 ++ src/components/useTracker.js | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/components/useTracker.js diff --git a/src/Meteor.js b/src/Meteor.js index 3c32142..9ad5c64 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -17,6 +17,7 @@ import { Collection, runObservers, localCollections } from './Collection'; import call from './Call'; import withTracker from './components/ReactMeteorData'; +import useTracker from './components/useTracker'; import ReactiveDict from './ReactiveDict'; @@ -42,6 +43,7 @@ module.exports = { return new Collection(name, options); }, withTracker, + useTracker, getData() { return Data; }, diff --git a/src/components/useTracker.js b/src/components/useTracker.js new file mode 100644 index 0000000..f498a88 --- /dev/null +++ b/src/components/useTracker.js @@ -0,0 +1,23 @@ +import React, { useEffect, useState } from 'react'; +import Trackr from 'trackr'; + +export default useTracker = (trackerFn, deps = []) => { + const [response, setResponse] = useState(trackerFn()); + let computation = null; + + const stopComputation = () => { + computation && computation.stop(); + computation = null; + }; + + useEffect(() => { + stopComputation(); + Trackr.autorun(currentComputation => { + computation = currentComputation; + setResponse(trackerFn()); + }); + return stopComputation; + }, deps); + + return response; +}; From 11288f6fb22f04bdae3c8e5a5161c9fd56f81e22 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Fri, 7 Aug 2020 17:51:22 -0400 Subject: [PATCH 04/28] Bump dev package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5251b8d..de9b7f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.0.12", + "version": "2.1.0", "description": "Full Meteor Client for React Native", "main": "src/Meteor.js", "repository": { From 03bcd2823c36ac6fc246a3bf96ea67398305c26e Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Sun, 9 Aug 2020 01:24:18 +0000 Subject: [PATCH 05/28] 2.1.0-beta1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de9b7f3..db41c3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.1.0", + "version": "2.1.0-beta1", "description": "Full Meteor Client for React Native", "main": "src/Meteor.js", "repository": { From 528ffce89b68e0024860b9e806247e888bbeedc4 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Sat, 8 Aug 2020 21:32:52 -0400 Subject: [PATCH 06/28] Removing useTracker.js from dev since author has said it is not ready --- src/components/useTracker.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/components/useTracker.js diff --git a/src/components/useTracker.js b/src/components/useTracker.js deleted file mode 100644 index f498a88..0000000 --- a/src/components/useTracker.js +++ /dev/null @@ -1,23 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import Trackr from 'trackr'; - -export default useTracker = (trackerFn, deps = []) => { - const [response, setResponse] = useState(trackerFn()); - let computation = null; - - const stopComputation = () => { - computation && computation.stop(); - computation = null; - }; - - useEffect(() => { - stopComputation(); - Trackr.autorun(currentComputation => { - computation = currentComputation; - setResponse(trackerFn()); - }); - return stopComputation; - }, deps); - - return response; -}; From 01593b2f6784cd696eca999fddb12d5788abe12c Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Sat, 8 Aug 2020 21:33:12 -0400 Subject: [PATCH 07/28] Remove useTracker --- src/Meteor.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Meteor.js b/src/Meteor.js index 9ad5c64..b4a4ed8 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -17,7 +17,6 @@ import { Collection, runObservers, localCollections } from './Collection'; import call from './Call'; import withTracker from './components/ReactMeteorData'; -import useTracker from './components/useTracker'; import ReactiveDict from './ReactiveDict'; @@ -43,7 +42,6 @@ module.exports = { return new Collection(name, options); }, withTracker, - useTracker, getData() { return Data; }, @@ -352,4 +350,4 @@ module.exports = { }, }; -export default module.exports; \ No newline at end of file +export default module.exports; From 8ed46591755cd2a638b86b5e5fd2a4d1543ea9ce Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Sat, 8 Aug 2020 21:38:22 -0400 Subject: [PATCH 08/28] Remove unnecessary code --- src/user/Accounts.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/user/Accounts.js b/src/user/Accounts.js index d63b8df..e6d4f81 100644 --- a/src/user/Accounts.js +++ b/src/user/Accounts.js @@ -8,9 +8,6 @@ class AccountsPassword { _hashPassword = hashPassword; createUser = (options, callback = () => {}) => { - if (options.username) options.username = options.username; - if (options.email) options.email = options.email; - // Replace password with the hashed password. options.password = hashPassword(options.password); @@ -76,4 +73,4 @@ class AccountsPassword { } } -export default new AccountsPassword(); \ No newline at end of file +export default new AccountsPassword(); From 63f1ae5b5c500bfd6b3de8ca7eb52f4d79c84e97 Mon Sep 17 00:00:00 2001 From: Kelly Copley Date: Sun, 9 Aug 2020 14:30:32 -0400 Subject: [PATCH 09/28] add useTracker and rewrite withTracker to use it (#31) fixes #29 --- src/Meteor.js | 20 ++--- src/components/MeteorDataManager.js | 118 ---------------------------- src/components/ReactMeteorData.js | 97 ----------------------- src/components/useTracker.js | 30 +++++++ src/components/withTracker.js | 16 ++++ 5 files changed, 57 insertions(+), 224 deletions(-) delete mode 100644 src/components/MeteorDataManager.js delete mode 100644 src/components/ReactMeteorData.js create mode 100644 src/components/useTracker.js create mode 100644 src/components/withTracker.js diff --git a/src/Meteor.js b/src/Meteor.js index b4a4ed8..566c3c0 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -16,7 +16,8 @@ import Mongo from './Mongo'; import { Collection, runObservers, localCollections } from './Collection'; import call from './Call'; -import withTracker from './components/ReactMeteorData'; +import withTracker from './components/withTracker'; +import useTracker from './components/useTracker'; import ReactiveDict from './ReactiveDict'; @@ -42,6 +43,7 @@ module.exports = { return new Collection(name, options); }, withTracker, + useTracker, getData() { return Data; }, @@ -84,7 +86,7 @@ module.exports = { if((!endpoint.startsWith("ws") || !endpoint.endsWith("/websocket")) && !options.suppressUrlErrors) { throw new Error(`Your url "${endpoint}" may be in the wrong format. It should start with "ws://" or "wss://" and end with "/websocket", e.g. "wss://myapp.meteor.com/websocket". To disable this warning, connect with option "suppressUrlErrors" as true, e.g. Meteor.connect("${endpoint}", {suppressUrlErrors:true});`); } - + if (!options.AsyncStorage) { const AsyncStorage = require('@react-native-community/async-storage').default; @@ -155,9 +157,9 @@ module.exports = { _id: message.id, ...message.fields, }; - + Data.db[message.collection].upsert(document); - + runObservers("added", message.collection, document); }); @@ -192,18 +194,18 @@ module.exports = { ...message.fields, ...unset, }; - + const oldDocument = Data.db[message.collection].findOne({_id:message.id}); - + Data.db[message.collection].upsert(document); - - runObservers("changed", message.collection, document, oldDocument); + + runObservers("changed", message.collection, document, oldDocument); } }); Data.ddp.on('removed', message => { if(Data.db[message.collection]) { - const oldDocument = Data.db[message.collection].findOne({_id:message.id}); + const oldDocument = Data.db[message.collection].findOne({_id:message.id}); Data.db[message.collection].del(message.id); runObservers("removed", message.collection, oldDocument); } diff --git a/src/components/MeteorDataManager.js b/src/components/MeteorDataManager.js deleted file mode 100644 index c6b75bd..0000000 --- a/src/components/MeteorDataManager.js +++ /dev/null @@ -1,118 +0,0 @@ -import Trackr from 'trackr'; -import Data from '../Data'; - -// A class to keep the state and utility methods needed to manage -// the Meteor data for a component. -class MeteorDataManager { - constructor(component) { - this.component = component; - this.computation = null; - this.oldData = null; - this._meteorDataDep = new Trackr.Dependency(); - this._meteorDataChangedCallback = () => { - this._meteorDataDep.changed(); - }; - - Data.onChange(this._meteorDataChangedCallback); - } - - dispose() { - if (this.computation) { - this.computation.stop(); - this.computation = null; - } - - Data.offChange(this._meteorDataChangedCallback); - } - - calculateData() { - const component = this.component; - - if (!component.getMeteorData) { - return null; - } - - if (this.computation) { - this.computation.stop(); - this.computation = null; - } - - let data; - // Use Tracker.nonreactive in case we are inside a Tracker Computation. - // This can happen if someone calls `ReactDOM.render` inside a Computation. - // In that case, we want to opt out of the normal behavior of nested - // Computations, where if the outer one is invalidated or stopped, - // it stops the inner one. - - this.computation = Trackr.nonreactive(() => { - return Trackr.autorun(c => { - this._meteorDataDep.depend(); - if (c.firstRun) { - const savedSetState = component.setState; - try { - component.setState = () => { - throw new Error( - "Can't call `setState` inside `getMeteorData` as this could cause an endless" + - ' loop. To respond to Meteor data changing, consider making this component' + - ' a "wrapper component" that only fetches data and passes it in as props to' + - ' a child component. Then you can use `componentWillReceiveProps` in that' + - ' child component.' - ); - }; - - data = component.getMeteorData(); - } finally { - component.setState = savedSetState; - } - } else { - // Stop this computation instead of using the re-run. - // We use a brand-new autorun for each call to getMeteorData - // to capture dependencies on any reactive data sources that - // are accessed. The reason we can't use a single autorun - // for the lifetime of the component is that Tracker only - // re-runs autoruns at flush time, while we need to be able to - // re-call getMeteorData synchronously whenever we want, e.g. - // from componentWillUpdate. - c.stop(); - // Calling forceUpdate() triggers componentWillUpdate which - // recalculates getMeteorData() and re-renders the component. - try { - component.forceUpdate(); - } catch (e) { - console.error(e); - } - } - }); - }); - - return data; - } - - updateData(newData) { - const component = this.component; - const oldData = this.oldData; - - if (!(newData && typeof newData === 'object')) { - throw new Error('Expected object returned from getMeteorData'); - } - // update componentData in place based on newData - for (let key in newData) { - component.data[key] = newData[key]; - } - // if there is oldData (which is every time this method is called - // except the first), delete keys in newData that aren't in - // oldData. don't interfere with other keys, in case we are - // co-existing with something else that writes to a component's - // this.data. - if (oldData) { - for (let key in oldData) { - if (!(key in newData)) { - delete component.data[key]; - } - } - } - this.oldData = newData; - } -} - -export default MeteorDataManager; diff --git a/src/components/ReactMeteorData.js b/src/components/ReactMeteorData.js deleted file mode 100644 index cfce2ff..0000000 --- a/src/components/ReactMeteorData.js +++ /dev/null @@ -1,97 +0,0 @@ -import React from 'react'; -import EJSON from 'ejson'; - -import Data from '../Data'; -import MeteorDataManager from './MeteorDataManager'; - -const ReactMeteorData = { - - - UNSAFE_componentWillUpdate(nextProps, nextState) { - if (this.startMeteorSubscriptions) { - if ( - !EJSON.equals(this.state, nextState) || - !EJSON.equals(this.props, nextProps) - ) { - this._meteorSubscriptionsManager._meteorDataChangedCallback(); - } - } - - if (this.getMeteorData) { - const saveProps = this.props; - const saveState = this.state; - let newData; - try { - // Temporarily assign this.state and this.props, - // so that they are seen by getMeteorData! - // This is a simulation of how the proposed Observe API - // for React will work, which calls observe() after - // componentWillUpdate and after props and state are - // updated, but before render() is called. - // See https://github.com/facebook/react/issues/3398. - this.props = nextProps; - this.state = nextState; - newData = this._meteorDataManager.calculateData(); - } finally { - this.props = saveProps; - this.state = saveState; - } - - this._meteorDataManager.updateData(newData); - } - }, - - componentWillUnmount() { - if (this._meteorDataManager) { - this._meteorDataManager.dispose(); - } - - if (this._meteorSubscriptionsManager) { - this._meteorSubscriptionsManager.dispose(); - } - }, -}; - -export { ReactMeteorData }; - -class ReactComponent extends React.Component {} -Object.assign(ReactComponent.prototype, ReactMeteorData); - -class ReactPureComponent extends React.PureComponent {} -Object.assign(ReactPureComponent.prototype, ReactMeteorData); - -export default function connect(options) { - let expandedOptions = options; - if (typeof options === 'function') { - expandedOptions = { - getMeteorData: options, - }; - } - - const { getMeteorData, pure = true } = expandedOptions; - - const BaseComponent = pure ? ReactPureComponent : ReactComponent; - return WrappedComponent => - class ReactMeteorDataComponent extends BaseComponent { - constructor(props) { - super(props); - - Data.waitDdpReady(() => { - if (this.getMeteorData) { - this.data = {}; - this._meteorDataManager = new MeteorDataManager(this); - const newData = this._meteorDataManager.calculateData(); - this._meteorDataManager.updateData(newData); - } - }); - } - - getMeteorData() { - return getMeteorData(this.props); - } - - render() { - return ; - } - }; -} diff --git a/src/components/useTracker.js b/src/components/useTracker.js new file mode 100644 index 0000000..b32a510 --- /dev/null +++ b/src/components/useTracker.js @@ -0,0 +1,30 @@ +import { useEffect, useState } from 'react'; +import Tracker from 'trackr'; +import Data from '../Data'; + +export default (trackerFn, deps = []) => { + const [response, setResponse] = useState(trackerFn()); + const meteorDataDep = new Tracker.Dependency(); + let computation = null; + const dataChangedCallback = () => { + meteorDataDep.changed(); + }; + + const stopComputation = () => { + computation && computation.stop(); + computation = null; + }; + + Data.onChange(dataChangedCallback); + + useEffect(() => { + stopComputation(); + Tracker.autorun(currentComputation => { + meteorDataDep.depend(); + computation = currentComputation; + setResponse(trackerFn()); + }); + return () => { stopComputation(); Data.offChange(dataChangedCallback); }; + }, deps); + return response; +}; diff --git a/src/components/withTracker.js b/src/components/withTracker.js new file mode 100644 index 0000000..749e15b --- /dev/null +++ b/src/components/withTracker.js @@ -0,0 +1,16 @@ +import React, { forwardRef, memo } from 'react'; +import useTracker from './useTracker'; + +export default function withTracker (options) { + return Component => { + const expandedOptions = typeof options === 'function' ? { getMeteorData: options } : options; + const { getMeteorData, pure = true } = expandedOptions; + + const WithTracker = forwardRef((props, ref) => { + const data = useTracker(() => getMeteorData(props) || {}); + return ; + }); + + return pure ? memo(WithTracker) : WithTracker; + }; +} From 137445ac0263221ba266583025eadebacf5df541 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Sun, 9 Aug 2020 14:37:30 -0400 Subject: [PATCH 10/28] Merge changes from master into dev (#32) * Update MFA companion package (#27) * Create manual.yml --- .github/workflows/manual.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..4cfe17a --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,30 @@ +# This is a basic workflow that is manually triggered + +name: Send Review Message + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Release name' + # Default value if no value is explicitly provided + default: '100' + # Input has to be provided for the workflow to run + required: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + reviewMessage: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Send review message + run: echo "This PR for release ${{ github.event.inputs.name }} needs review from the community. Check out the changelog and provide your feedback!" From 21a7ff48a37032a235ee02092aaf251bca78b0d5 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Thu, 27 Aug 2020 20:38:14 -0400 Subject: [PATCH 11/28] Merge updates from master into dev (#37) * Update MFA companion package (#27) * Create manual.yml * Create stale.yml * Update stale.yml * Update index.js * Add a semicolon * Remove unused assignment to options (#34) * Remove unused assignment to options * Mark SHA256 insufficient as wontfix * Remove unused variable self * Remove unused variable serializedValue * Remove unused state properties loading --- .github/workflows/stale.yml | 19 +++++++++++++++++++ companion-packages/meteorrn-local/index.js | 2 +- companion-packages/meteorrn-ndev-mfa/index.js | 2 +- examples/Login.jsx | 2 +- lib/utils.js | 2 +- src/Collection.js | 2 -- src/ReactiveDict.js | 2 -- 7 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..74262fe --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,19 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "30 1 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Closing this issue due to no activity. Feel free to reopen.' + stale-pr-message: 'Closing this PR due to no activity. Feel free to reopen.' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' diff --git a/companion-packages/meteorrn-local/index.js b/companion-packages/meteorrn-local/index.js index 038a691..19c5ac0 100644 --- a/companion-packages/meteorrn-local/index.js +++ b/companion-packages/meteorrn-local/index.js @@ -55,7 +55,7 @@ const Local = { else { await _storeLocalCol(); } - } + }; const loadData = async () => { diff --git a/companion-packages/meteorrn-ndev-mfa/index.js b/companion-packages/meteorrn-ndev-mfa/index.js index 93b70e5..bebbac3 100644 --- a/companion-packages/meteorrn-ndev-mfa/index.js +++ b/companion-packages/meteorrn-ndev-mfa/index.js @@ -1,6 +1,6 @@ import Meteor, { Accounts } from '@meteorrn/core'; -import {authorizeActionChallengeHandler, authorizeActionCompletionHandler, resetPasswordCheckMFARequired, registrationChallengeHandlerTOTP, registrationCompletionHandlerTOTP, resetPasswordChallengeHandler, registrationChallengeHandlerU2F, registerCompletionHandlerU2F, loginChallengeHandler, loginCompletionHandler } from './method-names'; +import { loginChallengeHandler, loginCompletionHandler } from './method-names'; let useU2FAuthorizationCode = function (code) { if(typeof(code) !== "string" || code.length !== 6) { diff --git a/examples/Login.jsx b/examples/Login.jsx index 44734b8..75e8ba2 100644 --- a/examples/Login.jsx +++ b/examples/Login.jsx @@ -4,7 +4,7 @@ import { withTracker, Meteor } from 'meteor-react-native'; class Login extends React.Component { - state = {email:"", password:"", loading:false}; + state = {email:"", password:""}; onLogin = () => { let { email, password } = this.state; diff --git a/lib/utils.js b/lib/utils.js index b31a8a0..b21c97e 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -8,7 +8,7 @@ export function uniqueId() { export function hashPassword(password) { return { - digest: SHA256(password).toString(), + digest: SHA256(password).toString(), // lgtm [js/insufficient-password-hash] algorithm: 'sha-256', }; } diff --git a/src/Collection.js b/src/Collection.js index f624e6f..f390644 100644 --- a/src/Collection.js +++ b/src/Collection.js @@ -154,7 +154,6 @@ export class Collection { update(id, modifier, options = {}, callback = () => {}) { if (typeof options == 'function') { callback = options; - options = {}; } if (!this._collection.get(id)) @@ -202,7 +201,6 @@ export class Collection { } helpers(helpers) { - var self = this; let _transform; if (this._transform && !this._helpers) _transform = this._transform; diff --git a/src/ReactiveDict.js b/src/ReactiveDict.js index e6f877e..6b0bc61 100644 --- a/src/ReactiveDict.js +++ b/src/ReactiveDict.js @@ -74,8 +74,6 @@ export default class ReactiveDict { ) throw new Error('ReactiveDict.equals: value must be scalar'); - const serializedValue = stringify(value); - let oldValue = undefined; if (Object.keys(this.keys).indexOf(key) != -1) { oldValue = parse(this.keys[key]); From ad4c7943f353ca384385b278530b19ee32b26b23 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Mon, 31 Aug 2020 13:42:42 -0400 Subject: [PATCH 12/28] Bump package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db41c3b..54887ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.1.0-beta1", + "version": "2.1.0-beta2", "description": "Full Meteor Client for React Native", "main": "src/Meteor.js", "repository": { From d15d39e2bffa4f76cbffe23dd2a0d8d82e0d4fa4 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Wed, 16 Sep 2020 15:02:51 -0400 Subject: [PATCH 13/28] Deprecate `Meteor.collection` (lowercase-C) --- src/Meteor.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Meteor.js b/src/Meteor.js index 566c3c0..fb7234e 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -38,9 +38,8 @@ module.exports = { EJSON, ReactiveDict, Collection, - collection(name, options) { - console.error("Meteor.collection is deprecated. Use Mongo.Collection"); - return new Collection(name, options); + collection() { + throw new Error("Meteor.collection is deprecated. Use Mongo.Collection"); }, withTracker, useTracker, From 1556a2ed3788cdba7437d824b32f0fd785be379e Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Wed, 16 Sep 2020 15:11:16 -0400 Subject: [PATCH 14/28] Update Mongo Docs --- docs/api.md | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/docs/api.md b/docs/api.md index aff646d..67f3efc 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,3 +1,4 @@ + ## Meteor `import Meteor from '@meteorrn/core';` @@ -72,16 +73,27 @@ https://atmospherejs.com/meteor/reactive-dict ## Mongo `import { Mongo } from '@meteorrn/core';` -#### `Mongo.Collection(collectionName, options)` -*collectionName*: Name of the remote collection, or pass `null` for a client-side collection +#### `new Mongo.Collection(collectionName, options) => Collection` +Creates a *Collection* -**options**: - * [.insert(doc, callback)](http://docs.meteor.com/#/full/insert) - * [.update(id, modifier, [options], [callback])](http://docs.meteor.com/#/full/update) - * [.remove(id, callback(err, countRemoved))](http://docs.meteor.com/#/full/remove) +**Arguments** + * collectionName - Name of the remote collection, or pass `null` for a client-side collection + +### *Collection* + +***Collection* Methods:** + * .insert(document) + * .update(query, modifications) + * .remove(query) + * .find(query) => *Cursor* + * .findOne(query) => Document -#### *Cursor*.observe -Mirrors Meteor's observe behavior. Accepts object with the properties `added`, `changed`, and `removed`. + +### *Cursor* + +***Cursor* Methods:** + * .obsrve() - Mirrors Meteor's observe behavior. Accepts object with the properties `added`, `changed`, and `removed`. + * .fetch() => `[Document]` - Retrieves an array of matching documents ## Accounts @@ -102,4 +114,4 @@ Enables verbose mode which logs detailed information about accounts. **Note:** t ```` enableVerbose() -```` \ No newline at end of file +```` From 87f7469b1e3a20095b3dc18d53475f9c84d5d028 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Wed, 16 Sep 2020 15:13:06 -0400 Subject: [PATCH 15/28] Update api.md --- docs/api.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/api.md b/docs/api.md index 67f3efc..1105e94 100644 --- a/docs/api.md +++ b/docs/api.md @@ -74,22 +74,22 @@ https://atmospherejs.com/meteor/reactive-dict `import { Mongo } from '@meteorrn/core';` #### `new Mongo.Collection(collectionName, options) => Collection` -Creates a *Collection* +Creates and returns a *Collection* **Arguments** * collectionName - Name of the remote collection, or pass `null` for a client-side collection -### *Collection* +#### *`Collection`* ***Collection* Methods:** - * .insert(document) - * .update(query, modifications) - * .remove(query) - * .find(query) => *Cursor* - * .findOne(query) => Document + * .insert(document) - Inserts document into collection + * .update(query, modifications) - Updates document in collection + * .remove(query) - Removes document from collection + * .find(query) => *Cursor* - Returns a Cursor + * .findOne(query) => Document - Retrieves first matching Document -### *Cursor* +#### *`Cursor`* ***Cursor* Methods:** * .obsrve() - Mirrors Meteor's observe behavior. Accepts object with the properties `added`, `changed`, and `removed`. From 9c142949d079c2fe76240479067d88db6dec493e Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Wed, 16 Sep 2020 15:17:42 -0400 Subject: [PATCH 16/28] Update Accounts Docs --- docs/api.md | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/docs/api.md b/docs/api.md index 1105e94..00ab818 100644 --- a/docs/api.md +++ b/docs/api.md @@ -73,7 +73,7 @@ https://atmospherejs.com/meteor/reactive-dict ## Mongo `import { Mongo } from '@meteorrn/core';` -#### `new Mongo.Collection(collectionName, options) => Collection` +#### `new Mongo.Collection(collectionName, options)` => `Collection` Creates and returns a *Collection* **Arguments** @@ -85,7 +85,7 @@ Creates and returns a *Collection* * .insert(document) - Inserts document into collection * .update(query, modifications) - Updates document in collection * .remove(query) - Removes document from collection - * .find(query) => *Cursor* - Returns a Cursor + * .find(query) => *`Cursor`* - Returns a Cursor * .findOne(query) => Document - Retrieves first matching Document @@ -99,13 +99,41 @@ Creates and returns a *Collection* ## Accounts `import { Accounts } from '@meteorrn/core';` -* [Accounts.createUser](http://docs.meteor.com/#/full/accounts_createuser) -* [Accounts.changePassword](http://docs.meteor.com/#/full/accounts_forgotpassword) +#### `Accounts.createUser(user, callback)` +Creates a user + +**Arguments** + * user - The user object + * callback - Called with a single error object or null on success + +#### `Accounts.changePassword(oldPassword, newPassword)` +Changes a user's password + +**Arguments** + * oldPassword - The user's current password + * newPassword - The user's new password + +#### `Accounts.onLogin(callback)` +Registers a callback to be called when user is logged in + +**Arguments** + * callback + +#### `Accounts.onLoginFailure(callback)` +Registers a callback to be called when login fails + +**Arguments** + * callback + +#### `Accounts._hashPassword(plaintext)` => `{algorithm:"sha-256", digest:"..."}` +Hashes a password using the sha-256 algorithm. Returns an object formatted for use in accounts calls. You can access the raw hashed string using the digest property. + +**Arguments** + * plaintext - The plaintext string you want to hash + + * [Accounts.forgotPassword](http://docs.meteor.com/#/full/accounts_changepassword) * [Accounts.resetPassword](http://docs.meteor.com/#/full/accounts_resetpassword) -* [Accounts.onLogin](http://docs.meteor.com/#/full/accounts_onlogin) -* [Accounts.onLoginFailure](http://docs.meteor.com/#/full/accounts_onloginfailure) -* `Accounts._hashPassword` - SHA-256 hashes password, for use with methods that may require authentication ## enableVerbose `import { enableVerbose } from '@meteorrn/core';` From 78af2c631a321c62cd6ba2b5734c079bf05ca0e9 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Wed, 16 Sep 2020 15:25:03 -0400 Subject: [PATCH 17/28] Update Tracker and Verbosity Docs --- docs/api.md | 68 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 22 deletions(-) diff --git a/docs/api.md b/docs/api.md index 00ab818..f219de2 100644 --- a/docs/api.md +++ b/docs/api.md @@ -47,27 +47,41 @@ Returns true if attempting to login ### `Meteor.logoutOtherClients` -## withTracker -`import { withTracker } from '@meteorrn/core'`; - -The `withTracker` component is used the same way as [`meteor/react-meteor-data`](https://guide.meteor.com/react.html#using-withTracker) - -```javascript -export default withTracker(() => { - let handle = Meteor.subscribe("mySubscription"); - let loading = !handle.ready(); - let myStuff = Stuff.find({}).fetch(); - - return { - myStuff - }; -})(MyComponent); -``` + + +## Tracker +`import { withTracker, useTracker } from '@meteorrn/core'`; + + +#### `withTracker(trackerFunc)(Component)` +Creates a new Tracker + +**Arguments:** + * trackerFunc - Function which will be re-run reactively when it's dependencies are updated. Must return an object that is passed as properties to `Component` + * Component - React Component which will receive properties from trackerFunc + + +#### `useTracker(trackerFunc)` => `React Hook` +Creates a new Tracker React Hook. Can only be used inside a function component. See React Docs for more info. + +**Arguments:** + * trackerFunc - Function which will be re-run reactively when it's dependencies are updated. + + ## ReactiveDict `import { ReactiveDict } from '@meteorrn/core'` -https://atmospherejs.com/meteor/reactive-dict +#### `new ReactiveDict()` => *`ReactiveDict`* +Creates a new reactive dictionary + + +#### *`ReactiveDict`* + +***ReactiveDict* Methods:** + * .get(key) - Gets value of key (Reactive) + * .set(key, value) - Sets value of key + ## Mongo @@ -79,6 +93,7 @@ Creates and returns a *Collection* **Arguments** * collectionName - Name of the remote collection, or pass `null` for a client-side collection + #### *`Collection`* ***Collection* Methods:** @@ -96,9 +111,11 @@ Creates and returns a *Collection* * .fetch() => `[Document]` - Retrieves an array of matching documents + ## Accounts `import { Accounts } from '@meteorrn/core';` + #### `Accounts.createUser(user, callback)` Creates a user @@ -106,6 +123,7 @@ Creates a user * user - The user object * callback - Called with a single error object or null on success + #### `Accounts.changePassword(oldPassword, newPassword)` Changes a user's password @@ -113,33 +131,39 @@ Changes a user's password * oldPassword - The user's current password * newPassword - The user's new password + #### `Accounts.onLogin(callback)` Registers a callback to be called when user is logged in **Arguments** * callback + #### `Accounts.onLoginFailure(callback)` Registers a callback to be called when login fails **Arguments** * callback + #### `Accounts._hashPassword(plaintext)` => `{algorithm:"sha-256", digest:"..."}` Hashes a password using the sha-256 algorithm. Returns an object formatted for use in accounts calls. You can access the raw hashed string using the digest property. **Arguments** * plaintext - The plaintext string you want to hash +Other: * [Accounts.forgotPassword](http://docs.meteor.com/#/full/accounts_changepassword) * [Accounts.resetPassword](http://docs.meteor.com/#/full/accounts_resetpassword) -## enableVerbose + + +## Verbosity `import { enableVerbose } from '@meteorrn/core';` -Enables verbose mode which logs detailed information about accounts. **Note:** this will expose login tokens and other private information to the console. +Verbose Mode logs detailed information from various places around MeteorRN. **Note:** this will expose login tokens and other private information to the console. + -```` -enableVerbose() -```` +#### `enableVerbose()` +Enables verbose mode From 826b1392dfd7bed7f1bf65f45ccd457bd1e9d203 Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Wed, 16 Sep 2020 15:27:00 -0400 Subject: [PATCH 18/28] Start adding table of contents --- docs/api.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index f219de2..4b345c2 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,7 +1,13 @@ +# Meteor React Native Docs -## Meteor +Table of Contents +- [Meteor](#meteor) +- [Tracker](#tracker) + +

Meteor

`import Meteor from '@meteorrn/core';` + ### `Meteor.connect(url, options)` Connect to the Meteor Server @@ -49,7 +55,7 @@ Returns true if attempting to login -## Tracker +

Tracker

`import { withTracker, useTracker } from '@meteorrn/core'`; From 3bab57379bc8ea6756c81a6dc2347f7e80aec88e Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 11 Dec 2020 04:46:54 +0000 Subject: [PATCH 19/28] Refactor to remove require cycle --- package.json | 2 +- src/Meteor.js | 6 ++---- src/index.js | 4 ++++ src/user/User.js | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 src/index.js diff --git a/package.json b/package.json index 54887ac..7f8fbf3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@meteorrn/core", "version": "2.1.0-beta2", "description": "Full Meteor Client for React Native", - "main": "src/Meteor.js", + "main": "src/index.js", "repository": { "type": "git", "url": "git+https://github.com/TheRealNate/meteor-react-native.git" diff --git a/src/Meteor.js b/src/Meteor.js index fb7234e..0421516 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -21,12 +21,11 @@ import useTracker from './components/useTracker'; import ReactiveDict from './ReactiveDict'; -import User from './user/User'; import Accounts from './user/Accounts'; let isVerbose = false; -module.exports = { +const Meteor = { isVerbose, enableVerbose() { isVerbose = true; @@ -46,7 +45,6 @@ module.exports = { getData() { return Data; }, - ...User, status() { return { connected: Data.ddp ? Data.ddp.status == 'connected' : false, @@ -351,4 +349,4 @@ module.exports = { }, }; -export default module.exports; +export default Meteor; diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..cc27d3d --- /dev/null +++ b/src/index.js @@ -0,0 +1,4 @@ +import Meteor from './Meteor.js'; +import './user/User.js'; + +export default Meteor; \ No newline at end of file diff --git a/src/user/User.js b/src/user/User.js index b2da824..3ed3ebc 100644 --- a/src/user/User.js +++ b/src/user/User.js @@ -130,4 +130,4 @@ const User = { }, }; -export default User; +Object.assign(Meteor, User); \ No newline at end of file From 8852e46e6132f1581d20da321596b4a1202b0ffe Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 11 Dec 2020 04:47:05 +0000 Subject: [PATCH 20/28] 2.1.0-beta3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f8fbf3..ccd90f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.1.0-beta2", + "version": "2.1.0-beta3", "description": "Full Meteor Client for React Native", "main": "src/index.js", "repository": { From e914293f15a57d359cb6624143d077a76bb49c57 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 11 Dec 2020 04:50:55 +0000 Subject: [PATCH 21/28] 2.1.0-beta4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ccd90f2..fb6510a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.1.0-beta3", + "version": "2.1.0-beta4", "description": "Full Meteor Client for React Native", "main": "src/index.js", "repository": { From 6c2e2fe033c5bbdb92b52c010726b35ccf6c8896 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 11 Dec 2020 04:54:28 +0000 Subject: [PATCH 22/28] local: Automaticallly commit changes to storage after .insert, .update, or .remove --- companion-packages/meteorrn-local/README.md | 3 +-- companion-packages/meteorrn-local/index.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/companion-packages/meteorrn-local/README.md b/companion-packages/meteorrn-local/README.md index 29c81f8..b5842f8 100644 --- a/companion-packages/meteorrn-local/README.md +++ b/companion-packages/meteorrn-local/README.md @@ -6,8 +6,7 @@ This package introduces the `Local.Collection`, which will mirror the specified ### Caveats - This package (currently) works by creating a second local Mongo Collection. This means you are esentially keeping two copies of each document (that you store locally) in memory. This issue can be mitigated by keeping an "age" or "version" on all your documents, and only publishing documents that have been changed from local -- This package (currently) does not support the removal of documents. Once a document has been inserted into the local database, it is there forever (unless you manually call `remove` on the Local.Collection) -- Performing `.insert`, `.update`, `.remove`, etc on a Local.Collection only makes those modifications to the in-memory minimongo. Those changes won't be sent to the server, and those changes (currently) dont trigger the saving procedure, so they will not be committed to the disk (unless a remote change is made afterwards) +- This package (currently) does not support the automatic removal/expiry of documents. Once a document has been inserted into the local database, it is there forever (unless you manually call `remove` on the Local.Collection) ### Usage: diff --git a/companion-packages/meteorrn-local/index.js b/companion-packages/meteorrn-local/index.js index 19c5ac0..cf7c572 100644 --- a/companion-packages/meteorrn-local/index.js +++ b/companion-packages/meteorrn-local/index.js @@ -93,6 +93,24 @@ const Local = { }); }; + + LocalCol.insert = LocalCol.__insert; + LocalCol.update = LocalCol.__update; + LocalCol.remove = LocalCol.__remove; + + LocalCol.insert = (...args) => { + LocalCol.__insert(...args); + storeLocalCol(); + }; + LocalCol.update = (...args) => { + LocalCol.__update(...args); + storeLocalCol(); + }; + LocalCol.remove = (...args) => { + LocalCol.__remove(...args); + storeLocalCol(); + }; + LocalCol.loadPromise = loadData(); LocalCol.save = storeLocalCol; From 3039ba1763ce2ea9771cae4e0a87b3c8f145f92e Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Fri, 11 Dec 2020 00:03:50 -0500 Subject: [PATCH 23/28] Update User.js --- src/user/User.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/user/User.js b/src/user/User.js index 3ed3ebc..0270573 100644 --- a/src/user/User.js +++ b/src/user/User.js @@ -130,4 +130,5 @@ const User = { }, }; -Object.assign(Meteor, User); \ No newline at end of file +export default User; +Object.assign(Meteor, User); From cfd8f8e1e194d11bd0be993e6fb55fac96b5d4a6 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 11 Dec 2020 05:07:32 +0000 Subject: [PATCH 24/28] 2.1.0-beta5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f870c76..5aa9a9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.1.0-beta4", + "version": "2.1.0-beta5", "description": "Full Meteor Client for React Native", "main": "src/index.js", "repository": { From 78e4db3ff2ff506a40c1b32820595eb536334844 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 11 Dec 2020 20:16:06 +0000 Subject: [PATCH 25/28] Refactor code to remove require cycles --- src/Meteor.js | 23 ++++++++++++----------- src/components/withTracker.js | 2 +- src/index.js | 10 +++++++++- src/user/User.js | 1 - 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/Meteor.js b/src/Meteor.js index 1c77c96..b933083 100644 --- a/src/Meteor.js +++ b/src/Meteor.js @@ -1,5 +1,3 @@ -import NetInfo from "@react-native-community/netinfo"; - import { name as packageName } from '../package.json'; if(packageName !== "@meteorrn/core") { @@ -21,8 +19,6 @@ import useTracker from './components/useTracker'; import ReactiveDict from './ReactiveDict'; -import Accounts from './user/Accounts'; - let isVerbose = false; const Meteor = { @@ -31,7 +27,6 @@ const Meteor = { isVerbose = true; }, Random, - Accounts, Mongo, Tracker: Trackr, EJSON, @@ -102,12 +97,18 @@ const Meteor = { SocketConstructor: WebSocket, ...options, }); - - NetInfo.addEventListener(({type, isConnected, isInternetReachable, isWifiEnabled}) => { - if (isConnected && Data.ddp.autoReconnect) { - Data.ddp.connect(); - } - }); + + try { + const NetInfo = require("@react-native-community/netinfo").default; + NetInfo.addEventListener(({type, isConnected, isInternetReachable, isWifiEnabled}) => { + if (isConnected && Data.ddp.autoReconnect) { + Data.ddp.connect(); + } + }); + } + catch(e) { + console.warn("Warning: NetInfo not installed, so DDP will not automatically reconnect"); + } Data.ddp.on('connected', () => { // Clear the collections of any stale data in case this is a reconnect diff --git a/src/components/withTracker.js b/src/components/withTracker.js index 749e15b..cede3e0 100644 --- a/src/components/withTracker.js +++ b/src/components/withTracker.js @@ -8,7 +8,7 @@ export default function withTracker (options) { const WithTracker = forwardRef((props, ref) => { const data = useTracker(() => getMeteorData(props) || {}); - return ; + return React.createElement(Component, {ref, ...props, ...data}); }); return pure ? memo(WithTracker) : WithTracker; diff --git a/src/index.js b/src/index.js index cc27d3d..7b5303f 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,12 @@ import Meteor from './Meteor.js'; -import './user/User.js'; +import User from './user/User.js'; +import Accounts from './user/Accounts.js'; +Object.assign(Meteor, User); + +const { + withTracker, Mongo, packageInterface, ReactiveDict +} = Meteor; + +export { Accounts, withTracker, Mongo, packageInterface, ReactiveDict }; export default Meteor; \ No newline at end of file diff --git a/src/user/User.js b/src/user/User.js index 0270573..b2da824 100644 --- a/src/user/User.js +++ b/src/user/User.js @@ -131,4 +131,3 @@ const User = { }; export default User; -Object.assign(Meteor, User); From 65cda3e80b0a99b94b6b32ae773cb5772de5cc90 Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 11 Dec 2020 20:16:52 +0000 Subject: [PATCH 26/28] Bump Package Version to 2.1.0-rc1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5aa9a9d..9fea6af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.1.0-beta5", + "version": "2.1.0-rc1", "description": "Full Meteor Client for React Native", "main": "src/index.js", "repository": { From 4310f0e58dce92b09743e8e54bf6515354789a2d Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Fri, 11 Dec 2020 15:27:30 -0500 Subject: [PATCH 27/28] Delete shiftleft-analysis.yml --- .github/workflows/shiftleft-analysis.yml | 36 ------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/shiftleft-analysis.yml diff --git a/.github/workflows/shiftleft-analysis.yml b/.github/workflows/shiftleft-analysis.yml deleted file mode 100644 index 831315f..0000000 --- a/.github/workflows/shiftleft-analysis.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow integrates ShiftLeft Scan with GitHub's code scanning feature -# ShiftLeft Scan is a free open-source security tool for modern DevOps teams -# Visit https://slscan.io/en/latest/integrations/code-scan for help -name: ShiftLeft Scan - -# This section configures the trigger for the workflow. Feel free to customize depending on your convention -on: push - -jobs: - Scan-Build: - # Scan runs on ubuntu, mac and windows - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - # Instructions - # 1. Setup JDK, Node.js, Python etc depending on your project type - # 2. Compile or build the project before invoking scan - # Example: mvn compile, or npm install or pip install goes here - # 3. Invoke ShiftLeft Scan with the github token. Leave the workspace empty to use relative url - - - name: Perform ShiftLeft Scan - uses: ShiftLeftSecurity/scan-action@master - env: - WORKSPACE: "" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SCAN_AUTO_BUILD: true - with: - output: reports - # Scan auto-detects the languages in your project. To override uncomment the below variable and set the type - # type: credscan,java - # type: python - - - name: Upload report - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: reports From 1e420492462370fceee4c8cbe05196f4dbfa116e Mon Sep 17 00:00:00 2001 From: Nathaniel Dsouza Date: Thu, 17 Dec 2020 20:34:07 -0500 Subject: [PATCH 28/28] Update package version for release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9fea6af..1f6414e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@meteorrn/core", - "version": "2.1.0-rc1", + "version": "2.1.0", "description": "Full Meteor Client for React Native", "main": "src/index.js", "repository": {