Skip to content

Commit

Permalink
Merge pull request #154 from shoutem/release/7.0.0
Browse files Browse the repository at this point in the history
Release/7.0.0
  • Loading branch information
majaklajic authored Jun 14, 2022
2 parents c375c32 + 9f9c957 commit 31f36d1
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 45 deletions.
11 changes: 9 additions & 2 deletions core/AppBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function createApplication(appContext) {
super(props);

this.store = null;
this.state = { appReady: false };
}

getChildContext() {
Expand Down Expand Up @@ -113,7 +114,7 @@ function createApplication(appContext) {
this,
appContext.extensions,
'appWillMount',
);
).then(() => this.setState({ appReady: true }));
}

componentDidMount() {
Expand All @@ -135,6 +136,12 @@ function createApplication(appContext) {
}

render() {
const { appReady } = this.state;

if (!appReady) {
return null;
}

const { extensions } = appContext;
const mainContent = renderMainContent(this, extensions);
const renderedContent = renderProviders(extensions, mainContent);
Expand Down Expand Up @@ -182,7 +189,7 @@ export class AppBuilder {
*
* @param {Function} renderFunction Navigation bar render function
*/
setRenderNavigationBar(renderFunction = () => {}) {
setRenderNavigationBar(renderFunction = () => { }) {
this[APP_CONTEXT].renderNavigationBar = renderFunction;
return this;
}
Expand Down
3 changes: 2 additions & 1 deletion core/services/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ export function createAppContextConsumer(extensions) {
res({
...value,
...contextValue,
})}
})
}
</Context.Consumer>
);
},
Expand Down
30 changes: 12 additions & 18 deletions core/services/lifecycle.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { extractFlattenedNamedExports } from './exports';
import { prioritizeItems } from './priority';

Expand All @@ -11,24 +12,17 @@ import { prioritizeItems } from './priority';
* @returns {Promise} that will be resolved at the end of all lifecycle functions
*/
export function callLifecycleFunction(app, extensions, functionName) {
const promises = [];
const lifecycleFunctions = extractFlattenedNamedExports(extensions, functionName);
const lifecycleFunctions = extractFlattenedNamedExports(
extensions,
functionName,
);
const prioritizedLifecycleFunctions = prioritizeItems(lifecycleFunctions);

prioritizedLifecycleFunctions.forEach((lifecycleFunction) => {
if (typeof lifecycleFunction === 'function') {
const result = lifecycleFunction(app);

if (result instanceof Promise) {
const wrappedPromise = new Promise(resolve =>
result
.then(() => resolve())
.catch(() => resolve())
);
promises.push(wrappedPromise);
}
}
});

return Promise.all(promises);
return _.reduce(
prioritizedLifecycleFunctions,
(result, lifeCycle) => {
return result.then(() => lifeCycle(app));
},
Promise.resolve(),
);
}
1 change: 1 addition & 0 deletions core/services/priority.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const priorities = Object.freeze({
NAVIGATION: 200,
AUTH: 300,
REDUX: 500,
FIREBASE: 700,
NETWORKING: 900,
DEFAULT: 5000,
LAST: Number(Infinity),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoutem/platform",
"version": "6.0.1",
"version": "7.0.0",
"scripts": {
"android": "react-native run-android",
"build": "node scripts/build",
Expand Down
2 changes: 1 addition & 1 deletion package.template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoutem/platform",
"version": "6.0.1",
"version": "7.0.0",
"scripts": {
"android": "react-native run-android",
"build": "node scripts/build",
Expand Down
21 changes: 21 additions & 0 deletions patches/react-native+0.66.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,24 @@ index c498ba6..0765f28 100755
set -e

# Support Homebrew on M1
diff --git a/node_modules/react-native/React/Views/RCTModalHostView.m b/node_modules/react-native/React/Views/RCTModalHostView.m
index bea9e08..68d80d8 100644
--- a/node_modules/react-native/React/Views/RCTModalHostView.m
+++ b/node_modules/react-native/React/Views/RCTModalHostView.m
@@ -116,10 +116,12 @@ - (void)didUpdateReactSubviews

- (void)dismissModalViewController
{
- if (_isPresented) {
- [_delegate dismissModalHostView:self withViewController:_modalViewController animated:[self hasAnimationType]];
- _isPresented = NO;
- }
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (self->_isPresented) {
+ [self->_delegate dismissModalHostView:self withViewController:self->_modalViewController animated:[self hasAnimationType]];
+ self->_isPresented = NO;
+ }
+ });
}

- (void)didMoveToWindow
44 changes: 22 additions & 22 deletions platform/platform.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "6.0.1",
"mobileAppVersion": "6.0.1",
"releaseNotes": "* Reworked RSS feed resolution resulting in more optimised feed fetching and parsing",
"version": "7.0.0",
"mobileAppVersion": "7.0.0",
"releaseNotes": "* Improved prioritization of lifecycle functions execution\n* Improved preview build caching mechanism.",
"settings": {
"DEV-appetizeKey": "e4jq4nuwkw6z6ejfp62zu2q8ur",
"QA-appetizeKey": "b6p3zptqr2j28wb4qymhnbn3dr",
Expand All @@ -23,24 +23,24 @@
"dependencies": {
"shoutem.about": "~6.0.0",
"shoutem.analytics": "~4.0.2",
"shoutem.application": "~4.1.1",
"shoutem.application": "~4.1.2",
"shoutem.audio": "~4.0.2",
"shoutem.auth": "~5.0.2",
"shoutem.auth": "~5.1.0",
"shoutem.camera": "~5.0.0",
"shoutem.cms": "~5.0.1",
"shoutem.cms": "~6.0.0",
"shoutem.code-push": "~4.1.1",
"shoutem.deals": "~6.0.1",
"shoutem.events": "~5.0.0",
"shoutem.favorites": "~5.0.0",
"shoutem.firebase": "~4.1.1",
"shoutem.favorites": "~6.0.0",
"shoutem.firebase": "~4.1.2",
"shoutem.flurry-analytics": "~4.0.2",
"shoutem.i18n": "~4.0.4",
"shoutem.i18n": "~4.0.5",
"shoutem.ical-events": "~5.0.0",
"shoutem.layouts": "~7.0.0",
"shoutem.loyalty": "~5.0.1",
"shoutem.navigation": "~5.0.1",
"shoutem.loyalty": "~6.0.0",
"shoutem.navigation": "~5.0.4",
"shoutem.news": "~6.0.0",
"shoutem.notification-center": "~5.0.1",
"shoutem.notification-center": "~7.0.0",
"shoutem.page": "~5.0.0",
"shoutem.people": "~5.0.0",
"shoutem.permissions": "~4.0.3",
Expand All @@ -49,22 +49,22 @@
"shoutem.places": "~6.0.0",
"shoutem.preview": "~4.0.2",
"shoutem.products": "~5.0.0",
"shoutem.push-notifications": "~4.0.2",
"shoutem.redux": "~4.1.2",
"shoutem.rss": "~5.0.0",
"shoutem.rss-monitoring": "~4.1.0",
"shoutem.push-notifications": "~4.0.3",
"shoutem.redux": "~4.1.3",
"shoutem.rss": "~5.0.1",
"shoutem.rss-monitoring": "~4.1.1",
"shoutem.rss-news": "~5.1.0",
"shoutem.rss-photos": "~5.1.0",
"shoutem.rss-videos": "~5.1.0",
"shoutem.rubicon-theme": "~5.0.0",
"shoutem.social": "~7.0.1",
"shoutem.rubicon-theme": "~5.0.1",
"shoutem.social": "~8.0.0",
"shoutem.sub-navigation": "~4.0.2",
"shoutem.theme": "~5.0.0",
"shoutem.user-profile": "~3.0.0",
"shoutem.theme": "~5.0.1",
"shoutem.user-profile": "~4.0.0",
"shoutem.video": "~7.0.0",
"shoutem.vimeo": "~5.1.0",
"shoutem.web-view": "~5.0.0",
"shoutem.web-view": "~5.0.1",
"shoutem.wordpress": "~5.0.0",
"shoutem.youtube": "~5.0.1"
"shoutem.youtube": "~5.0.2"
}
}

0 comments on commit 31f36d1

Please sign in to comment.