From 4b6312a22d9fb377ad7f32357957baff38cdfb76 Mon Sep 17 00:00:00 2001 From: klazbaba Date: Tue, 29 Jun 2021 16:03:24 +0100 Subject: [PATCH 01/13] fixed issue with dateutils export --- src/agenda/index.js | 22 +++++++++++---------- src/agenda/reservation-list/index.js | 8 ++++---- src/agenda/reservation-list/reservation.js | 4 ++-- src/calendar-list/index.js | 6 +++--- src/calendar/day/index.js | 4 ++-- src/calendar/index.js | 8 ++++---- src/dateutils.js | 2 +- src/expandableCalendar/Context/Presenter.js | 4 ++-- src/expandableCalendar/agendaList.js | 4 ++-- src/expandableCalendar/index.js | 6 +++--- src/expandableCalendar/week.js | 6 +++--- 11 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/agenda/index.js b/src/agenda/index.js index d0347350d9..6bb4e6cf59 100644 --- a/src/agenda/index.js +++ b/src/agenda/index.js @@ -8,7 +8,7 @@ import {Text, View, Dimensions, Animated} from 'react-native'; import {extractComponentProps} from '../component-updater'; import {parseDate, xdateToData, toMarkingFormat} from '../interface'; -import dateutils from '../dateutils'; +import {weekDayNames, sameDate, sameMonth} from '../dateutils'; import {AGENDA_CALENDAR_KNOB} from '../testIDs'; import {VelocityTracker} from '../input'; import styleConstructor from './style'; @@ -93,7 +93,7 @@ export default class AgendaView extends Component { } componentDidUpdate(prevProps) { - if (this.props.selected && !dateutils.sameDate(parseDate(this.props.selected), parseDate(prevProps.selected))) { + if (this.props.selected && !sameDate(parseDate(this.props.selected), parseDate(prevProps.selected))) { this.setState({selectedDay: parseDate(this.props.selected)}); } else if (!prevProps.items) { this.loadReservations(this.props); @@ -276,7 +276,7 @@ export default class AgendaView extends Component { onDayChange = day => { const newDate = parseDate(day); - const withAnimation = dateutils.sameMonth(newDate, this.state.selectedDay); + const withAnimation = sameMonth(newDate, this.state.selectedDay); this.calendar.scrollToDay(day, this.calendarOffset(), withAnimation); this.setState({ @@ -329,11 +329,12 @@ export default class AgendaView extends Component { if (!hideKnob) { const knobView = renderKnob ? renderKnob() : ; - knob = !this.state.calendarScrollable || showClosingKnob ? ( - - (this.knob = c)}>{knobView} - - ) : null; + knob = + !this.state.calendarScrollable || showClosingKnob ? ( + + (this.knob = c)}>{knobView} + + ) : null; } return knob; } @@ -352,7 +353,7 @@ export default class AgendaView extends Component { render() { const {firstDay, hideKnob, style, testID} = this.props; - const weekDaysNames = dateutils.weekDayNames(firstDay); + const weekDaysNames = weekDayNames(firstDay); const agendaHeight = this.initialScrollPadPosition(); const weekdaysStyle = [ this.style.weekdays, @@ -398,7 +399,8 @@ export default class AgendaView extends Component { weekdaysStyle.push({height: HEADER_HEIGHT}); } - const openCalendarScrollPadPosition = !hideKnob && this.state.calendarScrollable && this.props.showClosingKnob ? agendaHeight + HEADER_HEIGHT : 0; + const openCalendarScrollPadPosition = + !hideKnob && this.state.calendarScrollable && this.props.showClosingKnob ? agendaHeight + HEADER_HEIGHT : 0; const shouldAllowDragging = !hideKnob && !this.state.calendarScrollable; const scrollPadPosition = (shouldAllowDragging ? HEADER_HEIGHT : openCalendarScrollPadPosition) - KNOB_HEIGHT; const scrollPadStyle = { diff --git a/src/agenda/reservation-list/index.js b/src/agenda/reservation-list/index.js index 253c69f904..cc1b55652f 100644 --- a/src/agenda/reservation-list/index.js +++ b/src/agenda/reservation-list/index.js @@ -6,7 +6,7 @@ import React, {Component} from 'react'; import {FlatList, ActivityIndicator, View} from 'react-native'; import {extractComponentProps} from '../../component-updater'; -import dateutils from '../../dateutils'; +import {sameDate} from '../../dateutils'; import {toMarkingFormat} from '../../interface'; import styleConstructor from './style'; import Reservation from './reservation'; @@ -72,7 +72,7 @@ class ReservationList extends Component { componentDidUpdate(prevProps) { if (prevProps !== this.props) { - if (!dateutils.sameDate(prevProps.topDay, this.props.topDay)) { + if (!sameDate(prevProps.topDay, this.props.topDay)) { this.setState( { reservations: [] @@ -94,7 +94,7 @@ class ReservationList extends Component { updateReservations(props) { const {selectedDay} = props; const reservations = this.getReservations(props); - if (this.list && !dateutils.sameDate(selectedDay, this.selectedDay)) { + if (this.list && !sameDate(selectedDay, this.selectedDay)) { let scrollPosition = 0; for (let i = 0; i < reservations.scrollPosition; i++) { scrollPosition += this.heights[i] || 0; @@ -191,7 +191,7 @@ class ReservationList extends Component { if (!row) return; const day = row.day; - const sameDate = dateutils.sameDate(day, this.selectedDay); + const sameDate = sameDate(day, this.selectedDay); if (!sameDate && this.scrollOver) { this.selectedDay = day.clone(); _.invoke(this.props, 'onDayChange', day.clone()); diff --git a/src/agenda/reservation-list/reservation.js b/src/agenda/reservation-list/reservation.js index b817794494..408141c01d 100644 --- a/src/agenda/reservation-list/reservation.js +++ b/src/agenda/reservation-list/reservation.js @@ -4,7 +4,7 @@ import XDate from 'xdate'; import React, {Component} from 'react'; import {View, Text} from 'react-native'; import {xdateToData} from '../../interface'; -import dateutils from '../../dateutils'; +import {isToday} from '../../dateutils'; import {RESERVATION_DATE} from '../../testIDs'; import styleConstructor from './style'; @@ -59,7 +59,7 @@ class Reservation extends Component { return this.props.renderDay(date ? xdateToData(date) : undefined, item); } - const today = dateutils.isToday(date) ? this.style.today : undefined; + const today = isToday(date) ? this.style.today : undefined; if (date) { return ( diff --git a/src/calendar-list/index.js b/src/calendar-list/index.js index 48fcc35a79..f0273144f6 100644 --- a/src/calendar-list/index.js +++ b/src/calendar-list/index.js @@ -7,7 +7,7 @@ import {FlatList, Platform, Dimensions, View} from 'react-native'; import {extractComponentProps} from '../component-updater'; import {xdateToData, parseDate} from '../interface'; -import dateutils from '../dateutils'; +import {page, sameDate} from '../dateutils'; import {STATIC_HEADER} from '../testIDs'; import styleConstructor from './style'; import Calendar from '../calendar'; @@ -147,10 +147,10 @@ class CalendarList extends Component { if (!horizontal) { let week = 0; - const days = dateutils.page(day, firstDay); + const days = page(day, firstDay); for (let i = 0; i < days.length; i++) { week = Math.floor(i / 7); - if (dateutils.sameDate(days[i], day)) { + if (sameDate(days[i], day)) { scrollAmount += 46 * week; break; } diff --git a/src/calendar/day/index.js b/src/calendar/day/index.js index bdb6019eca..824e79d4be 100644 --- a/src/calendar/day/index.js +++ b/src/calendar/day/index.js @@ -6,7 +6,7 @@ import memoize from 'memoize-one'; import React, {Component} from 'react'; import {shouldUpdate} from '../../component-updater'; -import dateutils from '../../dateutils'; +import {isToday as dateutils_isToday} from '../../dateutils'; import {xdateToData} from '../../interface'; import {SELECT_DATE_SLOT} from '../../testIDs'; import BasicDay from './basic'; @@ -91,7 +91,7 @@ export default class Day extends Component { render() { const {day, marking} = this.props; const date = xdateToData(day); - const isToday = dateutils.isToday(day); + const isToday = dateutils_isToday(day); const Component = this.getDayComponent(); const dayProps = _.omit(this.props, 'day'); const accessibilityLabel = this.getAccessibilityLabel(day, marking, isToday); diff --git a/src/calendar/index.js b/src/calendar/index.js index ee2501f7a1..b0ea3f246a 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -7,7 +7,7 @@ import React, {Component} from 'react'; import {View} from 'react-native'; import GestureRecognizer, {swipeDirections} from 'react-native-swipe-gestures'; -import dateutils from '../dateutils'; +import {page, isGTE, isLTE, sameMonth} from '../dateutils'; import {xdateToData, parseDate, toMarkingFormat} from '../interface'; import {getState} from '../day-state-manager'; // import shouldComponentUpdate from './updater'; @@ -111,7 +111,7 @@ class Calendar extends Component { const minDate = parseDate(this.props.minDate); const maxDate = parseDate(this.props.maxDate); - if (!(minDate && !dateutils.isGTE(day, minDate)) && !(maxDate && !dateutils.isLTE(day, maxDate))) { + if (!(minDate && !isGTE(day, minDate)) && !(maxDate && !isLTE(day, maxDate))) { const shouldUpdateMonth = disableMonthChange === undefined || !disableMonthChange; if (shouldUpdateMonth) { @@ -177,7 +177,7 @@ class Calendar extends Component { const {hideExtraDays, markedDates} = this.props; const dayProps = extractComponentProps(Day, this.props); - if (!dateutils.sameMonth(day, this.state.currentMonth) && hideExtraDays) { + if (!sameMonth(day, this.state.currentMonth) && hideExtraDays) { return ; } @@ -217,7 +217,7 @@ class Calendar extends Component { const {currentMonth} = this.state; const {firstDay, showSixWeeks, hideExtraDays} = this.props; const shouldShowSixWeeks = showSixWeeks && !hideExtraDays; - const days = dateutils.page(currentMonth, firstDay, shouldShowSixWeeks); + const days = page(currentMonth, firstDay, shouldShowSixWeeks); const weeks = []; while (days.length) { diff --git a/src/dateutils.js b/src/dateutils.js index 245534745b..19893dd103 100644 --- a/src/dateutils.js +++ b/src/dateutils.js @@ -142,7 +142,7 @@ function getWeekDates(date, firstDay, format) { } } -module.exports = { +export { weekDayNames, sameMonth, sameWeek, diff --git a/src/expandableCalendar/Context/Presenter.js b/src/expandableCalendar/Context/Presenter.js index e293e8a488..2a09f0977b 100644 --- a/src/expandableCalendar/Context/Presenter.js +++ b/src/expandableCalendar/Context/Presenter.js @@ -1,6 +1,6 @@ import _ from 'lodash'; import XDate from 'xdate'; -import dateutils from '../../dateutils'; +import {sameMonth as dateutils_sameMonth} from '../../dateutils'; import {xdateToData, toMarkingFormat} from '../../interface'; const commons = require('../commons'); @@ -44,7 +44,7 @@ class Presenter { }; setDate = (props, date, newDate, updateState, updateSource) => { - const sameMonth = dateutils.sameMonth(XDate(date), XDate(newDate)); + const sameMonth = dateutils_sameMonth(XDate(date), XDate(newDate)); const buttonIcon = this.getButtonIcon(date, props.showTodayButton); updateState(buttonIcon); diff --git a/src/expandableCalendar/agendaList.js b/src/expandableCalendar/agendaList.js index e80de7698a..e554e8d68d 100644 --- a/src/expandableCalendar/agendaList.js +++ b/src/expandableCalendar/agendaList.js @@ -3,7 +3,7 @@ import React, {Component} from 'react'; import {SectionList, Text} from 'react-native'; import PropTypes from 'prop-types'; import XDate from 'xdate'; -import dateutils from '../dateutils'; +import {isToday as dateutils_isToday} from '../dateutils'; import styleConstructor from './style'; import asCalendarConsumer from './asCalendarConsumer'; import {getMoment} from '../momentResolver'; @@ -109,7 +109,7 @@ class AgendaList extends Component { if (markToday) { const todayString = XDate.locales[XDate.defaultLocale].today || commons.todayString; - const isToday = dateutils.isToday(XDate(title)); + const isToday = dateutils_isToday(XDate(title)); sectionTitle = isToday ? `${todayString}, ${sectionTitle}` : sectionTitle; } diff --git a/src/expandableCalendar/index.js b/src/expandableCalendar/index.js index 54f53e2a59..328a3859d0 100644 --- a/src/expandableCalendar/index.js +++ b/src/expandableCalendar/index.js @@ -7,7 +7,7 @@ import React, {Component} from 'react'; import {AccessibilityInfo, PanResponder, Animated, View, Text, Image} from 'react-native'; import {CALENDAR_KNOB} from '../testIDs'; -import dateutils from '../dateutils'; +import {page, weekDayNames} from '../dateutils'; import {parseDate, toMarkingFormat} from '../interface'; import styleConstructor, {HEADER_HEIGHT} from './style'; import CalendarList from '../calendar-list'; @@ -207,7 +207,7 @@ class ExpandableCalendar extends Component { } getNumberOfWeeksInMonth(month) { - const days = dateutils.page(month, this.props.firstDay); + const days = page(month, this.props.firstDay); return days.length / 7; } @@ -406,7 +406,7 @@ class ExpandableCalendar extends Component { renderHeader() { const monthYear = XDate(this.props.context.date).toString('MMMM yyyy'); - const weekDaysNames = dateutils.weekDayNames(this.props.firstDay); + const weekDaysNames = weekDayNames(this.props.firstDay); return ( ; } } From b2c2275183bc0239ef4e1e11be053129e7d7da51 Mon Sep 17 00:00:00 2001 From: klazbaba Date: Wed, 30 Jun 2021 10:35:02 +0100 Subject: [PATCH 02/13] switched to using esmodule export in day-state-manager.js --- src/day-state-manager.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/day-state-manager.js b/src/day-state-manager.js index 97df58f3ab..9fb7abb581 100644 --- a/src/day-state-manager.js +++ b/src/day-state-manager.js @@ -23,6 +23,4 @@ function getState(day, current, props) { return state; } -module.exports = { - getState -}; +export {getState}; From 02ae5d30102e0a7181382ddcb083dbd7c5649fd9 Mon Sep 17 00:00:00 2001 From: klazbaba Date: Tue, 13 Jul 2021 20:37:42 +0100 Subject: [PATCH 03/13] merged in master --- .eslintrc.js | 4 +- package.json | 4 + src/calendar-list/{index.js => index.tsx} | 124 ++++++++++---- src/calendar-list/{item.js => item.tsx} | 35 ++-- src/calendar-list/{style.js => style.ts} | 3 +- src/calendar/day/basic/index.tsx | 9 +- src/calendar/day/dot/{index.js => index.tsx} | 25 ++- src/calendar/day/dot/{style.js => style.ts} | 3 +- src/calendar/day/marking/index.js | 153 ------------------ src/calendar/day/marking/index.tsx | 140 ++++++++++++++++ .../day/marking/{style.js => style.ts} | 3 +- .../day/period/{index.js => index.tsx} | 35 ++-- .../day/period/{style.js => style.ts} | 3 +- src/dateutils.js | 2 +- src/day-state-manager.js | 4 +- 15 files changed, 313 insertions(+), 234 deletions(-) rename src/calendar-list/{index.js => index.tsx} (73%) rename src/calendar-list/{item.js => item.tsx} (80%) rename src/calendar-list/{style.js => style.ts} (92%) rename src/calendar/day/dot/{index.js => index.tsx} (61%) rename src/calendar/day/dot/{style.js => style.ts} (90%) delete mode 100644 src/calendar/day/marking/index.js create mode 100644 src/calendar/day/marking/index.tsx rename src/calendar/day/marking/{style.js => style.ts} (89%) rename src/calendar/day/period/{index.js => index.tsx} (88%) rename src/calendar/day/period/{style.js => style.ts} (95%) diff --git a/.eslintrc.js b/.eslintrc.js index 846d63f500..120c656787 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,7 +10,7 @@ module.exports = { describe: true }, extends: ['eslint:recommended'], - parser: 'babel-eslint', + parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { experimentalObjectRestSpread: true, @@ -18,7 +18,7 @@ module.exports = { }, sourceType: 'module' }, - plugins: ['react', 'react-native', 'jest'], + plugins: ['react', 'react-native', 'jest', '@typescript-eslint'], rules: { 'react-native/no-inline-styles': 1, 'linebreak-style': ['error', 'unix'], diff --git a/package.json b/package.json index 3d115e3093..7d2f300e7e 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "build": "xcodebuild -project ios/CalendarsExample.xcodeproj build", "build:ts": "tsc", + "build:dev": "tsc --noEmit", "e2e": "node ./scripts/test-e2e.js --release", "test": "npm run lint && npm run unit && npm run e2e", "unit": "jest", @@ -42,7 +43,10 @@ "@babel/runtime": "^7.12.5", "@types/lodash": "^4.14.170", "@types/react-native": "^0.63.52", + "@types/xdate": "^0.8.32", "@welldone-software/why-did-you-render": "^6.0.3", + "@typescript-eslint/eslint-plugin": "^2.13.0", + "@typescript-eslint/parser": "^2.13.0", "babel-eslint": "^10.1.0", "babel-jest": "^26.6.3", "detox": "^18.0.0", diff --git a/src/calendar-list/index.js b/src/calendar-list/index.tsx similarity index 73% rename from src/calendar-list/index.js rename to src/calendar-list/index.tsx index f0273144f6..88c027df9f 100644 --- a/src/calendar-list/index.js +++ b/src/calendar-list/index.tsx @@ -1,21 +1,69 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import XDate from 'xdate'; +import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {FlatList, Platform, Dimensions, View} from 'react-native'; - +// @ts-expect-error import {extractComponentProps} from '../component-updater'; +// @ts-expect-error import {xdateToData, parseDate} from '../interface'; import {page, sameDate} from '../dateutils'; import {STATIC_HEADER} from '../testIDs'; import styleConstructor from './style'; -import Calendar from '../calendar'; + +// @ts-expect-error +import Calendar, {CalendarProps} from '../calendar'; import CalendarListItem from './item'; +// @ts-expect-error import CalendarHeader from '../calendar/header/index'; const {width} = Dimensions.get('window'); +export type CalendarListProps = CalendarProps & { + /** Max amount of months allowed to scroll to the past. Default = 50 */ + pastScrollRange?: number; + /** Max amount of months allowed to scroll to the future. Default = 50 */ + futureScrollRange?: number; + /** Used when calendar scroll is horizontal, default is device width, pagination should be disabled */ + calendarWidth?: number; + /** Dynamic calendar height */ + calendarHeight?: number; + /** Style for the List item (the calendar) */ + calendarStyle?: number | Array | Object; + /** Whether to use static header that will not scroll with the list (horizontal only) */ + staticHeader?: boolean; + /** Enable or disable vertical / horizontal scroll indicator. Default = false */ + showScrollIndicator?: boolean; + /** Whether to animate the auto month scroll */ + animateScroll?: boolean; + /** Enable or disable scrolling of calendar list */ + scrollEnabled?: boolean; + /** When true, the calendar list scrolls to top when the status bar is tapped. Default = true */ + scrollsToTop?: boolean; + /** Enable or disable paging on scroll */ + pagingEnabled?: boolean; + /** Whether the scroll is horizontal */ + horizontal?: boolean; + /** Should Keyboard persist taps */ + keyboardShouldPersistTaps?: 'never' | 'always' | 'handled'; + /** A custom key extractor for the generated calendar months */ + keyExtractor?: (item: any, index: number) => string; + /** How far from the end to trigger the onEndReached callback */ + onEndReachedThreshold?: number; + /** Called once when the scroll position gets within onEndReachedThreshold */ + onEndReached?: () => void; +}; + +type XDateAndBump = XDate & {propBump?: number}; + +type CalendarListState = { + rows: Array; + texts: Array; + openDate: XDate; + currentMonth: XDate; +}; + /** * @description: Calendar List component for both vertical and horizontal calendars * @extends: Calendar @@ -23,7 +71,7 @@ const {width} = Dimensions.get('window'); * @example: https://github.com/wix/react-native-calendars/blob/master/example/src/screens/calendarsList.js * @gif: https://github.com/wix/react-native-calendars/blob/master/demo/calendar-list.gif */ -class CalendarList extends Component { +class CalendarList extends Component { static displayName = 'CalendarList'; static propTypes = { @@ -72,21 +120,23 @@ class CalendarList extends Component { scrollsToTop: false, scrollEnabled: true, removeClippedSubviews: Platform.OS === 'android', - keyExtractor: (item, index) => String(index) + keyExtractor: (_: any, index: number) => String(index) + }; + + style: any; + listView: FlatList | undefined | null; + viewabilityConfig = { + itemVisiblePercentThreshold: 20 }; - constructor(props) { + constructor(props: CalendarListProps) { super(props); this.style = styleConstructor(props.theme); - this.viewabilityConfig = { - itemVisiblePercentThreshold: 20 - }; - const rows = []; const texts = []; - const date = parseDate(props.current) || XDate(); + const date = parseDate(props.current) || new XDate(); for (let i = 0; i <= props.pastScrollRange + props.futureScrollRange; i++) { const rangeDate = date.clone().addMonths(i - props.pastScrollRange, true); @@ -114,7 +164,7 @@ class CalendarList extends Component { }; } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps: CalendarListProps) { const prevCurrent = parseDate(prevProps.current); const current = parseDate(this.props.current); @@ -123,22 +173,24 @@ class CalendarList extends Component { } } - static getDerivedStateFromProps(nextProps, prevState) { - const rowclone = prevState.rows; - const newrows = []; - - for (let i = 0; i < rowclone.length; i++) { - let val = prevState.texts[i]; - if (rowclone[i].getTime) { - val = rowclone[i].clone(); - val.propbump = rowclone[i].propbump ? rowclone[i].propbump + 1 : 1; + static getDerivedStateFromProps(_: CalendarListProps, prevState: CalendarListState) { + const rowClone = prevState.rows; + const newRows = []; + + for (let i = 0; i < rowClone.length; i++) { + let val: XDate | string = prevState.texts[i]; + // @ts-ignore + if (rowClone[i].getTime) { + val = rowClone[i].clone(); + // @ts-ignore + val.propBump = rowClone[i].propBump ? rowClone[i].propBump + 1 : 1; } - newrows.push(val); + newRows.push(val); } - return {rows: newrows}; + return {rows: newRows}; } - scrollToDay(d, offset, animated) { + scrollToDay(d: XDate, offset: number, animated: boolean) { const {horizontal, calendarHeight, calendarWidth, pastScrollRange, firstDay} = this.props; const day = parseDate(d); const diffMonths = Math.round(this.state.openDate.clone().setDate(1).diffMonths(day.clone().setDate(1))); @@ -156,10 +208,10 @@ class CalendarList extends Component { } } } - this.listView.scrollToOffset({offset: scrollAmount, animated}); + this.listView?.scrollToOffset({offset: scrollAmount, animated}); } - scrollToMonth = m => { + scrollToMonth = (m: XDate) => { const {horizontal, calendarHeight, calendarWidth, pastScrollRange, animateScroll = false} = this.props; const month = parseDate(m); const scrollTo = month || this.state.openDate; @@ -167,10 +219,10 @@ class CalendarList extends Component { const size = horizontal ? calendarWidth : calendarHeight; const scrollAmount = size * pastScrollRange + diffMonths * size; - this.listView.scrollToOffset({offset: scrollAmount, animated: animateScroll}); + this.listView?.scrollToOffset({offset: scrollAmount, animated: animateScroll}); }; - getItemLayout = (data, index) => { + getItemLayout = (_: Array | undefined | null, index: number) => { const {horizontal, calendarHeight, calendarWidth} = this.props; return { @@ -180,16 +232,16 @@ class CalendarList extends Component { }; }; - getMonthIndex(month) { + getMonthIndex(month: XDate) { let diffMonths = this.state.openDate.diffMonths(month) + this.props.pastScrollRange; return diffMonths; } - addMonth = count => { + addMonth = (count: number) => { this.updateMonth(this.state.currentMonth.clone().addMonths(count, true)); }; - updateMonth(day, doNotTriggerListeners) { + updateMonth(day: XDate, doNotTriggerListeners = false) { if (day.toString('yyyy MM') === this.state.currentMonth.toString('yyyy MM')) { return; } @@ -206,8 +258,8 @@ class CalendarList extends Component { }); } - onViewableItemsChanged = ({viewableItems}) => { - function rowIsCloseToViewable(index, distance) { + onViewableItemsChanged = ({viewableItems}: any) => { + function rowIsCloseToViewable(index: number, distance: number) { for (let i = 0; i < viewableItems.length; i++) { if (Math.abs(index - parseInt(viewableItems[i].index)) <= distance) { return true; @@ -221,7 +273,7 @@ class CalendarList extends Component { const visibleMonths = []; for (let i = 0; i < rowclone.length; i++) { - let val = rowclone[i]; + let val: XDate | string = rowclone[i]; const rowShouldBeRendered = rowIsCloseToViewable(i, 1); if (rowShouldBeRendered && !rowclone[i].getTime) { @@ -238,12 +290,13 @@ class CalendarList extends Component { _.invoke(this.props, 'onVisibleMonthsChange', visibleMonths); this.setState({ + // @ts-ignore rows: newrows, currentMonth: parseDate(visibleMonths[0]) }); }; - renderItem = ({item}) => { + renderItem = ({item}: any) => { const {calendarStyle, horizontal, calendarWidth, testID, ...others} = this.props; return ( @@ -287,6 +340,7 @@ class CalendarList extends Component { (this.listView = c)} style={[this.style.container, style]} + // @ts-ignore initialListSize={pastScrollRange + futureScrollRange + 1} // ListView deprecated data={this.state.rows} renderItem={this.renderItem} diff --git a/src/calendar-list/item.js b/src/calendar-list/item.tsx similarity index 80% rename from src/calendar-list/item.js rename to src/calendar-list/item.tsx index 61781bf90f..f40da40ffe 100644 --- a/src/calendar-list/item.js +++ b/src/calendar-list/item.tsx @@ -1,14 +1,29 @@ -import PropTypes from 'prop-types'; import memoize from 'memoize-one'; - import React, {Component} from 'react'; import {Text, View} from 'react-native'; +import PropTypes from 'prop-types'; +// @ts-expect-error import {extractComponentProps} from '../component-updater'; -import Calendar from '../calendar'; + +// @ts-expect-error +import Calendar, {CalendarProps} from '../calendar'; import styleConstructor from './style'; -class CalendarListItem extends Component { +export type CalendarListItemProps = CalendarProps & { + item: any; + calendarWidth?: number; + calendarHeight?: number; + horizontal?: boolean; + theme?: any; +} + +type CalendarListItemState = { + hideArrows: boolean; + hideExtraDays: boolean; +} + +class CalendarListItem extends Component { static displayName = 'IGNORE'; static propTypes = { @@ -24,20 +39,22 @@ class CalendarListItem extends Component { hideExtraDays: true }; - constructor(props) { + style: any; + + constructor(props: CalendarListItemProps) { super(props); this.style = styleConstructor(props.theme); } - shouldComponentUpdate(nextProps) { + shouldComponentUpdate(nextProps: CalendarListItemProps) { const r1 = this.props.item; const r2 = nextProps.item; - return r1.toString('yyyy MM') !== r2.toString('yyyy MM') || !!(r2.propbump && r2.propbump !== r1.propbump); + return r1.toString('yyyy MM') !== r2.toString('yyyy MM') || !!(r2.propBump && r2.propBump !== r1.propBump); } - onPressArrowLeft = (_, month) => { + onPressArrowLeft = (_: any, month: any) => { const {onPressArrowLeft, scrollToMonth} = this.props; const monthClone = month.clone(); @@ -56,7 +73,7 @@ class CalendarListItem extends Component { } }; - onPressArrowRight = (_, month) => { + onPressArrowRight = (_: any, month: any) => { const {onPressArrowRight, scrollToMonth} = this.props; const monthClone = month.clone(); diff --git a/src/calendar-list/style.js b/src/calendar-list/style.ts similarity index 92% rename from src/calendar-list/style.js rename to src/calendar-list/style.ts index 2fce57bb3f..a0b354c949 100644 --- a/src/calendar-list/style.js +++ b/src/calendar-list/style.ts @@ -1,9 +1,10 @@ import {Platform, StyleSheet} from 'react-native'; +// @ts-expect-error import * as defaultStyle from '../style'; const STYLESHEET_ID = 'stylesheet.calendar-list.main'; -export default function getStyle(theme = {}) { +export default function getStyle(theme: any = {}) { const appStyle = {...defaultStyle, ...theme}; return StyleSheet.create({ flatListContainer: { diff --git a/src/calendar/day/basic/index.tsx b/src/calendar/day/basic/index.tsx index d68875f0a9..68f2a7955e 100644 --- a/src/calendar/day/basic/index.tsx +++ b/src/calendar/day/basic/index.tsx @@ -6,8 +6,7 @@ import {TouchableOpacity, Text, View} from 'react-native'; // @ts-expect-error import {shouldUpdate} from '../../../component-updater'; import styleConstructor from './style'; -// @ts-expect-error -import Marking from '../marking'; +import Marking, {MarkingTypes} from '../marking'; interface BasicDayProps { state?: 'selected' | 'disabled' | 'today'; @@ -110,15 +109,15 @@ export default class BasicDay extends Component { } isMultiDot() { - return this.props.markingType === Marking.markingTypes.multiDot; + return this.props.markingType === Marking.markingTypes.MULTI_DOT; } isMultiPeriod() { - return this.props.markingType === Marking.markingTypes.multiPeriod; + return this.props.markingType === Marking.markingTypes.MULTI_PERIOD; } isCustom() { - return this.props.markingType === Marking.markingTypes.custom; + return this.props.markingType === Marking.markingTypes.CUSTOM; } getContainerStyle() { diff --git a/src/calendar/day/dot/index.js b/src/calendar/day/dot/index.tsx similarity index 61% rename from src/calendar/day/dot/index.js rename to src/calendar/day/dot/index.tsx index 627db933a2..d9909b6e48 100644 --- a/src/calendar/day/dot/index.js +++ b/src/calendar/day/dot/index.tsx @@ -1,9 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {View} from 'react-native'; import styleConstructor from './style'; -const Dot = ({theme, marked, disabled, color, today, selected}) => { +export interface DotProps { + theme?: Object; + color?: String; + marked?: Boolean; + selected?: Boolean; + disabled?: Boolean; + today?: Boolean; +} + +const Dot = ({theme, marked, disabled, color, today, selected}: DotProps) => { const style = styleConstructor(theme); const dotStyle = [style.dot]; @@ -26,17 +34,8 @@ const Dot = ({theme, marked, disabled, color, today, selected}) => { dotStyle.push({backgroundColor: color}); } } - - return ; + + return ; }; export default Dot; - -Dot.propTypes = { - theme: PropTypes.object, - color: PropTypes.string, - marked: PropTypes.bool, - selected: PropTypes.bool, - disabled: PropTypes.bool, - today: PropTypes.bool -}; diff --git a/src/calendar/day/dot/style.js b/src/calendar/day/dot/style.ts similarity index 90% rename from src/calendar/day/dot/style.js rename to src/calendar/day/dot/style.ts index b9d833e3ef..c763926eef 100644 --- a/src/calendar/day/dot/style.js +++ b/src/calendar/day/dot/style.ts @@ -1,9 +1,10 @@ import {StyleSheet} from 'react-native'; +// @ts-expect-error import * as defaultStyle from '../../../style'; const STYLESHEET_ID = 'stylesheet.dot'; -export default function styleConstructor(theme = {}) { +export default function styleConstructor(theme: any = {}) { const appStyle = {...defaultStyle, ...theme}; return StyleSheet.create({ dot: { diff --git a/src/calendar/day/marking/index.js b/src/calendar/day/marking/index.js deleted file mode 100644 index 3aaf87436e..0000000000 --- a/src/calendar/day/marking/index.js +++ /dev/null @@ -1,153 +0,0 @@ -import PropTypes from 'prop-types'; -import React, {Component} from 'react'; -import {View} from 'react-native'; -import {shouldUpdate, extractComponentProps} from '../../../component-updater'; -import styleConstructor from './style'; -import Dot from '../dot'; - - -const MARKING_TYPES = { - dot: 'dot', - multiDot: 'multi-dot', - period: 'period', - multiPeriod: 'multi-period', - custom: 'custom' -}; - -const DOT = { - key: PropTypes.string, - color: PropTypes.string, - selectedDotColor: PropTypes.string -}; - -const PERIOD = { - startingDay: PropTypes.bool, - endingDay: PropTypes.bool, - color: PropTypes.string -}; - - -export default class Marking extends Component { - static displayName = 'IGNORE'; - - static propTypes = { - ...Dot.propTypes, - type: PropTypes.oneOf(Object.values(MARKING_TYPES)), - theme: PropTypes.object, - selected: PropTypes.bool, - marked: PropTypes.bool, - today: PropTypes.bool, - disabled: PropTypes.bool, - disableTouchEvent: PropTypes.bool, - activeOpacity: PropTypes.number, - selectedColor: PropTypes.string, - selectedTextColor: PropTypes.string, - dotColor: PropTypes.string, - //multi-dot - dots: PropTypes.arrayOf(PropTypes.shape(DOT)), - //multi-period - periods: PropTypes.arrayOf(PropTypes.shape(PERIOD)) - }; - - static markingTypes = MARKING_TYPES; - - constructor(props) { - super(props); - - this.style = styleConstructor(props.theme); - } - - shouldComponentUpdate(nextProps) { - return shouldUpdate(this.props, nextProps, [ - 'type', - 'selected', - 'marked', - 'today', - 'disabled', - 'disableTouchEvent', - 'activeOpacity', - 'selectedColor', - 'selectedTextColor', - 'dotColor', - 'dots', - 'periods' - ]); - } - - getItems(items) { - const {type} = this.props; - - if (items && Array.isArray(items) && items.length > 0) { - // Filter out items so that we process only those which have color property - const validItems = items.filter(d => d && d.color); - - return validItems.map((item, index) => { - return type === MARKING_TYPES.multiDot ? this.renderDot(index, item) : this.renderPeriod(index, item); - }); - } - } - - renderMarkingByType() { - const {type, dots, periods} = this.props; - - switch (type) { - case MARKING_TYPES.multiDot: - return this.renderMultiMarkings(this.style.dots, dots); - case MARKING_TYPES.multiPeriod: - return this.renderMultiMarkings(this.style.periods, periods); - default: - return this.renderDot(); - } - } - - renderMultiMarkings(containerStyle, items) { - return ( - - {this.getItems(items)} - - ); - } - - renderPeriod(index, item) { - const {color, startingDay, endingDay} = item; - const style = [ - this.style.period, - { - backgroundColor: color - } - ]; - if (startingDay) { - style.push(this.style.startingDay); - } - if (endingDay) { - style.push(this.style.endingDay); - } - return ; - } - - renderDot(index, item) { - const {selected, dotColor} = this.props; - const dotProps = extractComponentProps(Dot, this.props); - let key = index; - let color = dotColor; - - if (item) { - if (item.key) { - key = item.key; - } - color = selected && item.selectedDotColor ? item.selectedDotColor : item.color; - } - - return ( - - ); - } - - render() { - return this.renderMarkingByType(); - } -} diff --git a/src/calendar/day/marking/index.tsx b/src/calendar/day/marking/index.tsx new file mode 100644 index 0000000000..34a98c022e --- /dev/null +++ b/src/calendar/day/marking/index.tsx @@ -0,0 +1,140 @@ +import React, {Component} from 'react'; +import {View} from 'react-native'; +// @ts-expect-error +import {shouldUpdate, extractComponentProps} from '../../../component-updater'; +import styleConstructor from './style'; +import Dot, {DotProps} from '../dot'; + +export enum MarkingTypes { + DOT = 'dot', + MULTI_DOT = 'multi-dot', + PERIOD = 'period', + MULTI_PERIOD = 'multi-period', + CUSTOM = 'custom' +} + +type DOT = { + key?: string; + color?: string; + selectedDotColor?: string; +}; + +type PERIOD = { + startingDay?: boolean; + endingDay?: boolean; + color?: string; +}; + +interface MarkingProps extends DotProps { + type?: MarkingTypes; + theme?: Object; + selected?: boolean; + marked?: boolean; + today?: boolean; + disabled?: boolean; + disableTouchEvent?: boolean; + activeOpacity?: number; + selectedColor?: string; + selectedTextColor?: string; + dotColor?: string; + //multi-dot + dots?: DOT; + //multi-period + periods?: PERIOD; +} + +export default class Marking extends Component { + static displayName = 'IGNORE'; + + static markingTypes = MarkingTypes; + style: any; + + constructor(props: MarkingProps) { + super(props); + + this.style = styleConstructor(props.theme); + } + + shouldComponentUpdate(nextProps: MarkingProps) { + return shouldUpdate(this.props, nextProps, [ + 'type', + 'selected', + 'marked', + 'today', + 'disabled', + 'disableTouchEvent', + 'activeOpacity', + 'selectedColor', + 'selectedTextColor', + 'dotColor', + 'dots', + 'periods' + ]); + } + + getItems(items: DOT | PERIOD) { + const {type} = this.props; + + if (items && Array.isArray(items) && items.length > 0) { + // Filter out items so that we process only those which have color property + const validItems = items.filter(d => d && d.color); + + return validItems.map((item, index) => { + return type === MarkingTypes.MULTI_DOT ? this.renderDot(index, item) : this.renderPeriod(index, item); + }); + } + } + + renderMarkingByType() { + const {type, dots, periods} = this.props; + switch (type) { + case MarkingTypes.MULTI_DOT: + return this.renderMultiMarkings(this.style.dots, dots); + case MarkingTypes.MULTI_PERIOD: + return this.renderMultiMarkings(this.style.periods, periods); + default: + return this.renderDot(); + } + } + + renderMultiMarkings(containerStyle: Object, items: any) { + return {this.getItems(items)}; + } + + renderPeriod(index: number, item: any) { + const {color, startingDay, endingDay} = item; + const style = [ + this.style.period, + { + backgroundColor: color + } + ]; + if (startingDay) { + style.push(this.style.startingDay); + } + if (endingDay) { + style.push(this.style.endingDay); + } + return ; + } + + renderDot(index?: number, item?: any) { + const {selected, dotColor} = this.props; + const dotProps = extractComponentProps(Dot, this.props); + let key = index; + let color = dotColor; + + if (item) { + if (item.key) { + key = item.key; + } + color = selected && item.selectedDotColor ? item.selectedDotColor : item.color; + } + + return ; + } + + render() { + return this.renderMarkingByType(); + } +} diff --git a/src/calendar/day/marking/style.js b/src/calendar/day/marking/style.ts similarity index 89% rename from src/calendar/day/marking/style.js rename to src/calendar/day/marking/style.ts index 61cbb0e70e..cac220d462 100644 --- a/src/calendar/day/marking/style.js +++ b/src/calendar/day/marking/style.ts @@ -1,9 +1,10 @@ import {StyleSheet} from 'react-native'; +// @ts-expect-error import * as defaultStyle from '../../style'; const STYLESHEET_ID = 'stylesheet.marking'; -export default function styleConstructor(theme = {}) { +export default function styleConstructor(theme: any = {}) { const appStyle = {...defaultStyle, ...theme}; return StyleSheet.create({ dots: { diff --git a/src/calendar/day/period/index.js b/src/calendar/day/period/index.tsx similarity index 88% rename from src/calendar/day/period/index.js rename to src/calendar/day/period/index.tsx index ac7cd4b09c..75c9958799 100644 --- a/src/calendar/day/period/index.js +++ b/src/calendar/day/period/index.tsx @@ -3,13 +3,25 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {TouchableWithoutFeedback, Text, View} from 'react-native'; - +// @ts-expect-error import {shouldUpdate} from '../../../component-updater'; +// @ts-expect-error import * as defaultStyle from '../../../style'; import styleConstructor from './style'; import Dot from '../dot'; -export default class PeriodDay extends Component { +interface PeriodDayProps { + state?: 'selected' | 'disabled' | 'today' | ''; + marking?: any; + theme?: Object; + onPress?: (date?: Object) => void; + onLongPress?: (date?: Object) => void; + date?: Object; + accessibilityLabel?: string; + testID?: string; +} + +export default class PeriodDay extends Component{ static displayName = 'IGNORE'; static propTypes = { @@ -20,8 +32,11 @@ export default class PeriodDay extends Component { onLongPress: PropTypes.func, date: PropTypes.object }; + theme: any; + style: any; + markingStyle: any; - constructor(props) { + constructor(props: PeriodDayProps) { super(props); this.theme = {...defaultStyle, ...(props.theme || {})}; @@ -31,14 +46,14 @@ export default class PeriodDay extends Component { } onPress = () => { - this.props.onPress(this.props.date); + this.props.onPress?.(this.props.date); }; onLongPress = () => { - this.props.onLongPress(this.props.date); + this.props.onLongPress?.(this.props.date); }; - shouldComponentUpdate(nextProps) { + shouldComponentUpdate(nextProps: PeriodDayProps) { const newMarkingStyle = this.getDrawingStyle(nextProps.marking); if (!_.isEqual(this.markingStyle, newMarkingStyle)) { this.markingStyle = newMarkingStyle; @@ -48,8 +63,8 @@ export default class PeriodDay extends Component { return shouldUpdate(this.props, nextProps, ['children', 'state', 'marking', 'onPress', 'onLongPress', 'date']); } - getDrawingStyle(marking) { - const defaultStyle = {textStyle: {}, containerStyle: {}}; + getDrawingStyle(marking: any) { + const defaultStyle = {textStyle: {color: undefined}, containerStyle: {}}; if (!marking) { return defaultStyle; @@ -115,8 +130,8 @@ export default class PeriodDay extends Component { const {state, marking} = this.props; const containerStyle = [this.style.base]; const textStyle = [this.style.text]; - let leftFillerStyle = {}; - let rightFillerStyle = {}; + let leftFillerStyle = {backgroundColor: undefined}; + let rightFillerStyle = {backgroundColor: undefined}; let fillerStyle = {}; let fillers; diff --git a/src/calendar/day/period/style.js b/src/calendar/day/period/style.ts similarity index 95% rename from src/calendar/day/period/style.js rename to src/calendar/day/period/style.ts index d62a9b2a55..1597c91328 100644 --- a/src/calendar/day/period/style.js +++ b/src/calendar/day/period/style.ts @@ -1,11 +1,12 @@ import {StyleSheet} from 'react-native'; +// @ts-expect-error import * as defaultStyle from '../../../style'; const STYLESHEET_ID = 'stylesheet.day.period'; const FILLER_HEIGHT = 34; -export default function styleConstructor(theme={}) { +export default function styleConstructor(theme: any = {}) { const appStyle = {...defaultStyle, ...theme}; return StyleSheet.create({ wrapper: { diff --git a/src/dateutils.js b/src/dateutils.js index 19893dd103..8cf847a352 100644 --- a/src/dateutils.js +++ b/src/dateutils.js @@ -1,5 +1,5 @@ const XDate = require('xdate'); -import {parseDate} from './interface'; +const {parseDate} = require('./interface'); function sameMonth(a, b) { return ( diff --git a/src/day-state-manager.js b/src/day-state-manager.js index 9fb7abb581..8994d976df 100644 --- a/src/day-state-manager.js +++ b/src/day-state-manager.js @@ -1,5 +1,5 @@ -import {isToday, isDateNotInTheRange, sameMonth} from './dateutils'; -import {parseDate, toMarkingFormat} from './interface'; +const {isToday, isDateNotInTheRange, sameMonth} = require('./dateutils'); +const {parseDate, toMarkingFormat} = require('./interface'); function getState(day, current, props) { const {minDate, maxDate, disabledByDefault, context} = props; From cc431175bc1a925a25d29d20779ccbb029b95e1a Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Wed, 4 Aug 2021 15:25:47 +0300 Subject: [PATCH 04/13] rn 0.64.2 upgrade --- _editorconfig | 3 + android/app/build.gradle | 6 +- android/app/src/debug/AndroidManifest.xml | 7 +- android/app/src/main/AndroidManifest.xml | 2 - android/app/src/main/res/values/styles.xml | 2 +- android/build.gradle | 7 +- android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/gradlew | 2 + android/gradlew.bat | 19 +- ios/CalendarsExample-tvOS/Info.plist | 54 -- ios/CalendarsExample-tvOSTests/Info.plist | 24 - .../xcschemes/CalendarsExample-tvOS.xcscheme | 125 ----- .../xcschemes/CalendarsExample.xcscheme | 2 +- ios/CalendarsExample/LaunchScreen.storyboard | 13 +- ios/Podfile | 15 +- ios/Podfile.lock | 462 ++++++++++-------- package.json | 6 +- 18 files changed, 285 insertions(+), 469 deletions(-) create mode 100644 _editorconfig delete mode 100644 ios/CalendarsExample-tvOS/Info.plist delete mode 100644 ios/CalendarsExample-tvOSTests/Info.plist delete mode 100644 ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample-tvOS.xcscheme diff --git a/_editorconfig b/_editorconfig new file mode 100644 index 0000000000..7c286132fe --- /dev/null +++ b/_editorconfig @@ -0,0 +1,3 @@ +# Windows files +[*.bat] +end_of_line = crlf diff --git a/android/app/build.gradle b/android/app/build.gradle index 38b2caa588..dabbb7af8b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -16,9 +16,12 @@ def jscFlavor = 'org.webkit:android-jsc:+' def enableHermes = project.ext.react.get("enableHermes", false) android { + ndkVersion rootProject.ext.ndkVersion + compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -65,11 +68,12 @@ android { variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html + // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode + defaultConfig.versionCode * 1000 + versionCodes.get(abi) } } } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index fa26aa56e1..b2f3ad9fce 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -4,5 +4,10 @@ - + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9f42d5c461..a5510c469a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -21,7 +21,5 @@ - - diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index 62fe59fa48..9fab0be743 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ - diff --git a/android/build.gradle b/android/build.gradle index f7c9df5bcb..86a1d881dc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,10 +2,11 @@ buildscript { ext { - buildToolsVersion = "29.0.2" - minSdkVersion = 19 + buildToolsVersion = "29.0.3" + minSdkVersion = 21 compileSdkVersion = 29 targetSdkVersion = 29 + ndkVersion = "20.1.5948944" supportLibVersion = "29.0.0" RNNKotlinVersion = "1.3.72" } @@ -16,7 +17,7 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:3.5.3") + classpath("com.android.tools.build:gradle:4.1.0") classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/android/gradle.properties b/android/gradle.properties index 8b3ac93251..afe59c01dc 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -20,3 +20,6 @@ android.useDeprecatedNdk=true android.useAndroidX=true android.enableJetifier=true + +# Version of flipper SDK to use with React Native +FLIPPER_VERSION=0.75.1 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 7c18f286d6..f014ae30aa 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Mar 27 10:33:44 IST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew index 77c906c272..305a24954a 100755 --- a/android/gradlew +++ b/android/gradlew @@ -83,6 +83,7 @@ cd "$SAVED" >&- CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -130,6 +131,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` diff --git a/android/gradlew.bat b/android/gradlew.bat index 4cea078860..b9dd3fc046 100644 --- a/android/gradlew.bat +++ b/android/gradlew.bat @@ -43,7 +43,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -57,7 +57,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -67,21 +67,9 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windowz variants -if not "%OS%" == "Windows_NT" goto win9xME_args if "%@eval[2+2]" == "4" goto 4NT_args -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* goto execute :4NT_args @@ -93,8 +81,9 @@ set CMD_LINE_ARGS=%$ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/ios/CalendarsExample-tvOS/Info.plist b/ios/CalendarsExample-tvOS/Info.plist deleted file mode 100644 index 2fb6a11c2c..0000000000 --- a/ios/CalendarsExample-tvOS/Info.plist +++ /dev/null @@ -1,54 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - NSLocationWhenInUseUsageDescription - - NSAppTransportSecurity - - - NSExceptionDomains - - localhost - - NSExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/ios/CalendarsExample-tvOSTests/Info.plist b/ios/CalendarsExample-tvOSTests/Info.plist deleted file mode 100644 index ba72822e87..0000000000 --- a/ios/CalendarsExample-tvOSTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample-tvOS.xcscheme b/ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample-tvOS.xcscheme deleted file mode 100644 index 1297a5aaa4..0000000000 --- a/ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample-tvOS.xcscheme +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample.xcscheme b/ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample.xcscheme index 101d038791..f267e62bf5 100644 --- a/ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample.xcscheme +++ b/ios/CalendarsExample.xcodeproj/xcshareddata/xcschemes/CalendarsExample.xcscheme @@ -1,6 +1,6 @@ - - + - - - diff --git a/ios/Podfile b/ios/Podfile index b798280e16..dd26543a26 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -6,19 +6,14 @@ platform :ios, '10.0' target 'CalendarsExample' do config = use_native_modules! - use_react_native!(:path => config["reactNativePath"]) + use_react_native!( + :path => config[:reactNativePath], + # to enable hermes on iOS, change `false` to `true` and then install pods + :hermes_enabled => false + ) target 'CalendarsExampleTests' do inherit! :search_paths # Pods for testing end end - -target 'CalendarsExample-tvOS' do - # Pods for CalendarsExample-tvOS - - target 'CalendarsExample-tvOSTests' do - inherit! :search_paths - # Pods for testing - end -end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 25bb957722..8947ebb7d9 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,250 +1,272 @@ PODS: - boost-for-react-native (1.63.0) - DoubleConversion (1.1.6) - - FBLazyVector (0.63.4) - - FBReactNativeSpec (0.63.4): - - Folly (= 2020.01.13.00) - - RCTRequired (= 0.63.4) - - RCTTypeSafety (= 0.63.4) - - React-Core (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - Folly (2020.01.13.00): + - FBLazyVector (0.64.2) + - FBReactNativeSpec (0.64.2): + - RCT-Folly (= 2020.01.13.00) + - RCTRequired (= 0.64.2) + - RCTTypeSafety (= 0.64.2) + - React-Core (= 0.64.2) + - React-jsi (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - glog (0.3.5) + - RCT-Folly (2020.01.13.00): - boost-for-react-native - DoubleConversion - - Folly/Default (= 2020.01.13.00) - glog - - Folly/Default (2020.01.13.00): + - RCT-Folly/Default (= 2020.01.13.00) + - RCT-Folly/Default (2020.01.13.00): - boost-for-react-native - DoubleConversion - glog - - glog (0.3.5) - - RCTRequired (0.63.4) - - RCTTypeSafety (0.63.4): - - FBLazyVector (= 0.63.4) - - Folly (= 2020.01.13.00) - - RCTRequired (= 0.63.4) - - React-Core (= 0.63.4) - - React (0.63.4): - - React-Core (= 0.63.4) - - React-Core/DevSupport (= 0.63.4) - - React-Core/RCTWebSocket (= 0.63.4) - - React-RCTActionSheet (= 0.63.4) - - React-RCTAnimation (= 0.63.4) - - React-RCTBlob (= 0.63.4) - - React-RCTImage (= 0.63.4) - - React-RCTLinking (= 0.63.4) - - React-RCTNetwork (= 0.63.4) - - React-RCTSettings (= 0.63.4) - - React-RCTText (= 0.63.4) - - React-RCTVibration (= 0.63.4) - - React-callinvoker (0.63.4) - - React-Core (0.63.4): - - Folly (= 2020.01.13.00) + - RCTRequired (0.64.2) + - RCTTypeSafety (0.64.2): + - FBLazyVector (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - RCTRequired (= 0.64.2) + - React-Core (= 0.64.2) + - React (0.64.2): + - React-Core (= 0.64.2) + - React-Core/DevSupport (= 0.64.2) + - React-Core/RCTWebSocket (= 0.64.2) + - React-RCTActionSheet (= 0.64.2) + - React-RCTAnimation (= 0.64.2) + - React-RCTBlob (= 0.64.2) + - React-RCTImage (= 0.64.2) + - React-RCTLinking (= 0.64.2) + - React-RCTNetwork (= 0.64.2) + - React-RCTSettings (= 0.64.2) + - React-RCTText (= 0.64.2) + - React-RCTVibration (= 0.64.2) + - React-callinvoker (0.64.2) + - React-Core (0.64.2): - glog - - React-Core/Default (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - RCT-Folly (= 2020.01.13.00) + - React-Core/Default (= 0.64.2) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/CoreModulesHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/CoreModulesHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/Default (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/Default (0.64.2): - glog - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - RCT-Folly (= 2020.01.13.00) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/DevSupport (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/DevSupport (0.64.2): - glog - - React-Core/Default (= 0.63.4) - - React-Core/RCTWebSocket (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) - - React-jsinspector (= 0.63.4) + - RCT-Folly (= 2020.01.13.00) + - React-Core/Default (= 0.64.2) + - React-Core/RCTWebSocket (= 0.64.2) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-jsinspector (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTActionSheetHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTActionSheetHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTAnimationHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTAnimationHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTBlobHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTBlobHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTImageHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTImageHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTLinkingHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTLinkingHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTNetworkHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTNetworkHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTSettingsHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTSettingsHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTTextHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTTextHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTVibrationHeaders (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTVibrationHeaders (0.64.2): - glog + - RCT-Folly (= 2020.01.13.00) - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-Core/RCTWebSocket (0.63.4): - - Folly (= 2020.01.13.00) + - React-Core/RCTWebSocket (0.64.2): - glog - - React-Core/Default (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - RCT-Folly (= 2020.01.13.00) + - React-Core/Default (= 0.64.2) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsiexecutor (= 0.64.2) + - React-perflogger (= 0.64.2) - Yoga - - React-CoreModules (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/CoreModulesHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - React-RCTImage (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-cxxreact (0.63.4): + - React-CoreModules (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.64.2) + - React-Core/CoreModulesHeaders (= 0.64.2) + - React-jsi (= 0.64.2) + - React-RCTImage (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-cxxreact (0.64.2): - boost-for-react-native (= 1.63.0) - DoubleConversion - - Folly (= 2020.01.13.00) - glog - - React-callinvoker (= 0.63.4) - - React-jsinspector (= 0.63.4) - - React-jsi (0.63.4): + - RCT-Folly (= 2020.01.13.00) + - React-callinvoker (= 0.64.2) + - React-jsi (= 0.64.2) + - React-jsinspector (= 0.64.2) + - React-perflogger (= 0.64.2) + - React-runtimeexecutor (= 0.64.2) + - React-jsi (0.64.2): - boost-for-react-native (= 1.63.0) - DoubleConversion - - Folly (= 2020.01.13.00) - glog - - React-jsi/Default (= 0.63.4) - - React-jsi/Default (0.63.4): + - RCT-Folly (= 2020.01.13.00) + - React-jsi/Default (= 0.64.2) + - React-jsi/Default (0.64.2): - boost-for-react-native (= 1.63.0) - DoubleConversion - - Folly (= 2020.01.13.00) - glog - - React-jsiexecutor (0.63.4): + - RCT-Folly (= 2020.01.13.00) + - React-jsiexecutor (0.64.2): - DoubleConversion - - Folly (= 2020.01.13.00) - glog - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsinspector (0.63.4) - - React-RCTActionSheet (0.63.4): - - React-Core/RCTActionSheetHeaders (= 0.63.4) - - React-RCTAnimation (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTAnimationHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTBlob (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - Folly (= 2020.01.13.00) - - React-Core/RCTBlobHeaders (= 0.63.4) - - React-Core/RCTWebSocket (= 0.63.4) - - React-jsi (= 0.63.4) - - React-RCTNetwork (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTImage (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTImageHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - React-RCTNetwork (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTLinking (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - React-Core/RCTLinkingHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTNetwork (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTNetworkHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTSettings (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTSettingsHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTText (0.63.4): - - React-Core/RCTTextHeaders (= 0.63.4) - - React-RCTVibration (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - Folly (= 2020.01.13.00) - - React-Core/RCTVibrationHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - ReactCommon/turbomodule/core (0.63.4): + - RCT-Folly (= 2020.01.13.00) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-perflogger (= 0.64.2) + - React-jsinspector (0.64.2) + - React-perflogger (0.64.2) + - React-RCTActionSheet (0.64.2): + - React-Core/RCTActionSheetHeaders (= 0.64.2) + - React-RCTAnimation (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.64.2) + - React-Core/RCTAnimationHeaders (= 0.64.2) + - React-jsi (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-RCTBlob (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - React-Core/RCTBlobHeaders (= 0.64.2) + - React-Core/RCTWebSocket (= 0.64.2) + - React-jsi (= 0.64.2) + - React-RCTNetwork (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-RCTImage (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.64.2) + - React-Core/RCTImageHeaders (= 0.64.2) + - React-jsi (= 0.64.2) + - React-RCTNetwork (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-RCTLinking (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - React-Core/RCTLinkingHeaders (= 0.64.2) + - React-jsi (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-RCTNetwork (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.64.2) + - React-Core/RCTNetworkHeaders (= 0.64.2) + - React-jsi (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-RCTSettings (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - RCTTypeSafety (= 0.64.2) + - React-Core/RCTSettingsHeaders (= 0.64.2) + - React-jsi (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-RCTText (0.64.2): + - React-Core/RCTTextHeaders (= 0.64.2) + - React-RCTVibration (0.64.2): + - FBReactNativeSpec (= 0.64.2) + - RCT-Folly (= 2020.01.13.00) + - React-Core/RCTVibrationHeaders (= 0.64.2) + - React-jsi (= 0.64.2) + - ReactCommon/turbomodule/core (= 0.64.2) + - React-runtimeexecutor (0.64.2): + - React-jsi (= 0.64.2) + - ReactCommon/turbomodule/core (0.64.2): - DoubleConversion - - Folly (= 2020.01.13.00) - glog - - React-callinvoker (= 0.63.4) - - React-Core (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) + - RCT-Folly (= 2020.01.13.00) + - React-callinvoker (= 0.64.2) + - React-Core (= 0.64.2) + - React-cxxreact (= 0.64.2) + - React-jsi (= 0.64.2) + - React-perflogger (= 0.64.2) - ReactNativeNavigation (6.12.2): - React - React-RCTImage @@ -259,9 +281,9 @@ PODS: DEPENDENCIES: - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) - - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) + - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) + - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - React (from `../node_modules/react-native/`) @@ -274,6 +296,7 @@ DEPENDENCIES: - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) + - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) @@ -283,6 +306,7 @@ DEPENDENCIES: - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) - React-RCTText (from `../node_modules/react-native/Libraries/Text`) - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) + - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - ReactNativeNavigation (from `../node_modules/react-native-navigation`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) @@ -297,11 +321,11 @@ EXTERNAL SOURCES: FBLazyVector: :path: "../node_modules/react-native/Libraries/FBLazyVector" FBReactNativeSpec: - :path: "../node_modules/react-native/Libraries/FBReactNativeSpec" - Folly: - :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" + :path: "../node_modules/react-native/React/FBReactNativeSpec" glog: :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" + RCT-Folly: + :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" RCTRequired: :path: "../node_modules/react-native/Libraries/RCTRequired" RCTTypeSafety: @@ -322,6 +346,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/jsiexecutor" React-jsinspector: :path: "../node_modules/react-native/ReactCommon/jsinspector" + React-perflogger: + :path: "../node_modules/react-native/ReactCommon/reactperflogger" React-RCTActionSheet: :path: "../node_modules/react-native/Libraries/ActionSheetIOS" React-RCTAnimation: @@ -340,6 +366,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/Libraries/Text" React-RCTVibration: :path: "../node_modules/react-native/Libraries/Vibration" + React-runtimeexecutor: + :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" ReactCommon: :path: "../node_modules/react-native/ReactCommon" ReactNativeNavigation: @@ -350,32 +378,34 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c DoubleConversion: cde416483dac037923206447da6e1454df403714 - FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e - FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e - Folly: b73c3869541e86821df3c387eb0af5f65addfab4 + FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b + FBReactNativeSpec: 92869e54fbef651850edc0f8ad2e5e53421f5fbe glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 - RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e - RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b - React: b0a957a2c44da4113b0c4c9853d8387f8e64e615 - React-callinvoker: c3f44dd3cb195b6aa46621fff95ded79d59043fe - React-Core: d3b2a1ac9a2c13c3bcde712d9281fc1c8a5b315b - React-CoreModules: 0581ff36cb797da0943d424f69e7098e43e9be60 - React-cxxreact: c1480d4fda5720086c90df537ee7d285d4c57ac3 - React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31 - React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949 - React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a - React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336 - React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b - React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0 - React-RCTImage: c1b1f2d3f43a4a528c8946d6092384b5c880d2f0 - React-RCTLinking: 35ae4ab9dc0410d1fcbdce4d7623194a27214fb2 - React-RCTNetwork: 29ec2696f8d8cfff7331fac83d3e893c95ef43ae - React-RCTSettings: 60f0691bba2074ef394f95d4c2265ec284e0a46a - React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c - React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d - ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b + RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c + RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728 + RCTTypeSafety: c1f31d19349c6b53085766359caac425926fafaa + React: bda6b6d7ae912de97d7a61aa5c160db24aa2ad69 + React-callinvoker: 9840ea7e8e88ed73d438edb725574820b29b5baa + React-Core: b5e385da7ce5f16a220fc60fd0749eae2c6120f0 + React-CoreModules: 17071a4e2c5239b01585f4aa8070141168ab298f + React-cxxreact: 9be7b6340ed9f7c53e53deca7779f07cd66525ba + React-jsi: 67747b9722f6dab2ffe15b011bcf6b3f2c3f1427 + React-jsiexecutor: 80c46bd381fd06e418e0d4f53672dc1d1945c4c3 + React-jsinspector: cc614ec18a9ca96fd275100c16d74d62ee11f0ae + React-perflogger: 25373e382fed75ce768a443822f07098a15ab737 + React-RCTActionSheet: af7796ba49ffe4ca92e7277a5d992d37203f7da5 + React-RCTAnimation: 6a2e76ab50c6f25b428d81b76a5a45351c4d77aa + React-RCTBlob: 02a2887023e0eed99391b6445b2e23a2a6f9226d + React-RCTImage: ce5bf8e7438f2286d9b646a05d6ab11f38b0323d + React-RCTLinking: ccd20742de14e020cb5f99d5c7e0bf0383aefbd9 + React-RCTNetwork: dfb9d089ab0753e5e5f55fc4b1210858f7245647 + React-RCTSettings: b14aef2d83699e48b410fb7c3ba5b66cd3291ae2 + React-RCTText: 41a2e952dd9adc5caf6fb68ed46b275194d5da5f + React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3 + React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9 + ReactCommon: 149906e01aa51142707a10665185db879898e966 ReactNativeNavigation: aefc8debafb4a374575adafb44a3352b9d5b618a - Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6 + Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac PODFILE CHECKSUM: a49123e8ee98a70297a33fb5ca1c3b1b1b871165 diff --git a/package.json b/package.json index 7d2f300e7e..81be25aab1 100644 --- a/package.json +++ b/package.json @@ -44,9 +44,9 @@ "@types/lodash": "^4.14.170", "@types/react-native": "^0.63.52", "@types/xdate": "^0.8.32", - "@welldone-software/why-did-you-render": "^6.0.3", "@typescript-eslint/eslint-plugin": "^2.13.0", "@typescript-eslint/parser": "^2.13.0", + "@welldone-software/why-did-you-render": "^6.0.3", "babel-eslint": "^10.1.0", "babel-jest": "^26.6.3", "detox": "^18.0.0", @@ -62,9 +62,9 @@ "metro-react-native-babel-preset": "^0.64.0", "mocha": "^7.1.0", "prettier": "^2.0.5", - "react": "16.13.1", + "react": "17.0.1", "react-component-driver": "^0.10.0", - "react-native": "0.63.4", + "react-native": "0.64.2", "react-native-navigation": "^6.7.1", "react-test-renderer": "^17.0.1", "semver": "5.x.x", From d68ef2b0f1d9644ba13cbe90d683136348b0570e Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Wed, 4 Aug 2021 15:41:36 +0300 Subject: [PATCH 05/13] jest config - adding 'transformIgnorePatterns' --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 81be25aab1..6180042ceb 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,9 @@ ], "testMatch": [ "/src/**/?(*.)(spec|test).{js,jsx}" + ], + "transformIgnorePatterns": [ + "node_modules/(?!(@react-native|react-native|react-native-swipe-gestures)/)" ] }, "husky": { From 05fb20f665e88e8a121f01e44b5b808b480a70db Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Wed, 4 Aug 2021 16:18:00 +0300 Subject: [PATCH 06/13] example project files --- example/.gitattributes | 4 +++- example/metro.config.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/.gitattributes b/example/.gitattributes index d42ff18354..45a3dcb2a2 100644 --- a/example/.gitattributes +++ b/example/.gitattributes @@ -1 +1,3 @@ -*.pbxproj -text +# Windows files should use crlf line endings +# https://help.github.com/articles/dealing-with-line-endings/ +*.bat text eol=crlf diff --git a/example/metro.config.js b/example/metro.config.js index dd4674dc0f..a9718e189f 100644 --- a/example/metro.config.js +++ b/example/metro.config.js @@ -10,7 +10,7 @@ module.exports = { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, - inlineRequires: false + inlineRequires: true } }) } From 171b4a6ec23a57ff072c4eda7f5cfb098c3771d5 Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Thu, 5 Aug 2021 10:50:42 +0300 Subject: [PATCH 07/13] updating .xcodeproj/project.pbxproj --- .../project.pbxproj | 66 ------------------- ios/Podfile.lock | 2 +- 2 files changed, 1 insertion(+), 67 deletions(-) diff --git a/ios/CalendarsExample.xcodeproj/project.pbxproj b/ios/CalendarsExample.xcodeproj/project.pbxproj index ef1e4f1c1b..292f015423 100644 --- a/ios/CalendarsExample.xcodeproj/project.pbxproj +++ b/ios/CalendarsExample.xcodeproj/project.pbxproj @@ -28,8 +28,6 @@ 398EEBBF225A4017004C3591 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 398EEBBE225A4017004C3591 /* JavaScriptCore.framework */; }; 39CBD92125E3A09900E725A0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 39CBD92025E3A09900E725A0 /* LaunchScreen.storyboard */; }; 487E5AF35184A2C855EE7D1C /* libPods-CalendarsExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 460013679EC6EF672EE84B6E /* libPods-CalendarsExampleTests.a */; }; - F9B5B8B4570FF18032DEFDE0 /* libPods-CalendarsExample-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E3C64726F99E7F45CCED79B2 /* libPods-CalendarsExample-tvOSTests.a */; }; - FA2BCE77335351BEE723EFCF /* libPods-CalendarsExample-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B2B1D7F212F1999E5CE3C3D /* libPods-CalendarsExample-tvOS.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -313,7 +311,6 @@ 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = CalendarsExample/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 247F69DB2483A793006A1A73 /* main.jsbundle */ = {isa = PBXFileReference; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; - 2B2B1D7F212F1999E5CE3C3D /* libPods-CalendarsExample-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CalendarsExample-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D02E47B1E0B4A5D006451C7 /* CalendarsExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CalendarsExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D02E4901E0B4A5D006451C7 /* CalendarsExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CalendarsExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 3297F784662D20D095BF1AFB /* Pods-CalendarsExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExample.debug.xcconfig"; path = "Target Support Files/Pods-CalendarsExample/Pods-CalendarsExample.debug.xcconfig"; sourceTree = ""; }; @@ -322,16 +319,11 @@ 460013679EC6EF672EE84B6E /* libPods-CalendarsExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CalendarsExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 46A23C7C177DC438E0CBB3F9 /* Pods-CalendarsExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExample.release.xcconfig"; path = "Target Support Files/Pods-CalendarsExample/Pods-CalendarsExample.release.xcconfig"; sourceTree = ""; }; 47F7CE6DB1E4FBB453CC30D5 /* libPods-CalendarsExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CalendarsExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 4D983A3CE8EEF4AF708B8019 /* Pods-CalendarsExample-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExample-tvOS.release.xcconfig"; path = "Target Support Files/Pods-CalendarsExample-tvOS/Pods-CalendarsExample-tvOS.release.xcconfig"; sourceTree = ""; }; 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; - 982391FF9FB86857A628840C /* Pods-CalendarsExample-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExample-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-CalendarsExample-tvOS/Pods-CalendarsExample-tvOS.debug.xcconfig"; sourceTree = ""; }; AC897BA667FD0C3E9D8F0D63 /* Pods-CalendarsExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-CalendarsExampleTests/Pods-CalendarsExampleTests.debug.xcconfig"; sourceTree = ""; }; - E3C64726F99E7F45CCED79B2 /* libPods-CalendarsExample-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CalendarsExample-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; EF4683684367395045561C12 /* Pods-CalendarsExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExampleTests.release.xcconfig"; path = "Target Support Files/Pods-CalendarsExampleTests/Pods-CalendarsExampleTests.release.xcconfig"; sourceTree = ""; }; - EF58906124F2602DF92D1079 /* Pods-CalendarsExample-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExample-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-CalendarsExample-tvOSTests/Pods-CalendarsExample-tvOSTests.release.xcconfig"; sourceTree = ""; }; - F437D091B67B0F0E9A569F4B /* Pods-CalendarsExample-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CalendarsExample-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-CalendarsExample-tvOSTests/Pods-CalendarsExample-tvOSTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -364,7 +356,6 @@ 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */, 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, - FA2BCE77335351BEE723EFCF /* libPods-CalendarsExample-tvOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -372,7 +363,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F9B5B8B4570FF18032DEFDE0 /* libPods-CalendarsExample-tvOSTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -500,8 +490,6 @@ children = ( 398EEBBE225A4017004C3591 /* JavaScriptCore.framework */, 47F7CE6DB1E4FBB453CC30D5 /* libPods-CalendarsExample.a */, - 2B2B1D7F212F1999E5CE3C3D /* libPods-CalendarsExample-tvOS.a */, - E3C64726F99E7F45CCED79B2 /* libPods-CalendarsExample-tvOSTests.a */, 460013679EC6EF672EE84B6E /* libPods-CalendarsExampleTests.a */, ); name = Frameworks; @@ -582,10 +570,6 @@ children = ( 3297F784662D20D095BF1AFB /* Pods-CalendarsExample.debug.xcconfig */, 46A23C7C177DC438E0CBB3F9 /* Pods-CalendarsExample.release.xcconfig */, - 982391FF9FB86857A628840C /* Pods-CalendarsExample-tvOS.debug.xcconfig */, - 4D983A3CE8EEF4AF708B8019 /* Pods-CalendarsExample-tvOS.release.xcconfig */, - F437D091B67B0F0E9A569F4B /* Pods-CalendarsExample-tvOSTests.debug.xcconfig */, - EF58906124F2602DF92D1079 /* Pods-CalendarsExample-tvOSTests.release.xcconfig */, AC897BA667FD0C3E9D8F0D63 /* Pods-CalendarsExampleTests.debug.xcconfig */, EF4683684367395045561C12 /* Pods-CalendarsExampleTests.release.xcconfig */, ); @@ -638,7 +622,6 @@ isa = PBXNativeTarget; buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "CalendarsExample-tvOS" */; buildPhases = ( - C00BF4655178EC17F49C1C9E /* [CP] Check Pods Manifest.lock */, 2D02E4771E0B4A5D006451C7 /* Sources */, 2D02E4781E0B4A5D006451C7 /* Frameworks */, 2D02E4791E0B4A5D006451C7 /* Resources */, @@ -657,7 +640,6 @@ isa = PBXNativeTarget; buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "CalendarsExample-tvOSTests" */; buildPhases = ( - FD50AB272A3660DC7105C10F /* [CP] Check Pods Manifest.lock */, 2D02E48C1E0B4A5D006451C7 /* Sources */, 2D02E48D1E0B4A5D006451C7 /* Frameworks */, 2D02E48E1E0B4A5D006451C7 /* Resources */, @@ -1142,50 +1124,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C00BF4655178EC17F49C1C9E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-CalendarsExample-tvOS-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - FD50AB272A3660DC7105C10F /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-CalendarsExample-tvOSTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1316,7 +1254,6 @@ }; 2D02E4971E0B4A5E006451C7 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 982391FF9FB86857A628840C /* Pods-CalendarsExample-tvOS.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -1340,7 +1277,6 @@ }; 2D02E4981E0B4A5E006451C7 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4D983A3CE8EEF4AF708B8019 /* Pods-CalendarsExample-tvOS.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; @@ -1364,7 +1300,6 @@ }; 2D02E4991E0B4A5E006451C7 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F437D091B67B0F0E9A569F4B /* Pods-CalendarsExample-tvOSTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; @@ -1386,7 +1321,6 @@ }; 2D02E49A1E0B4A5E006451C7 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = EF58906124F2602DF92D1079 /* Pods-CalendarsExample-tvOSTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 8947ebb7d9..9af25240bd 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -407,6 +407,6 @@ SPEC CHECKSUMS: ReactNativeNavigation: aefc8debafb4a374575adafb44a3352b9d5b618a Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac -PODFILE CHECKSUM: a49123e8ee98a70297a33fb5ca1c3b1b1b871165 +PODFILE CHECKSUM: d441a6b04db6a2cce6e0186dd6232f7e6ba9e257 COCOAPODS: 1.10.1 From 5e6a8dda18c2cb1ac6b572ccbe7f96f610a35330 Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Thu, 5 Aug 2021 13:24:06 +0300 Subject: [PATCH 08/13] RNN upgrade; ios configs --- ios/CalendarsExample.xcodeproj/project.pbxproj | 1 + ios/CalendarsExample/AppDelegate.m | 5 ++--- ios/Podfile | 10 +++++++++- ios/Podfile.lock | 18 +++++++++--------- package.json | 2 +- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ios/CalendarsExample.xcodeproj/project.pbxproj b/ios/CalendarsExample.xcodeproj/project.pbxproj index 292f015423..e5111dad12 100644 --- a/ios/CalendarsExample.xcodeproj/project.pbxproj +++ b/ios/CalendarsExample.xcodeproj/project.pbxproj @@ -1436,6 +1436,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; diff --git a/ios/CalendarsExample/AppDelegate.m b/ios/CalendarsExample/AppDelegate.m index 723855e102..f390d53972 100644 --- a/ios/CalendarsExample/AppDelegate.m +++ b/ios/CalendarsExample/AppDelegate.m @@ -8,9 +8,8 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; - [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions]; - + [ReactNativeNavigation bootstrapWithDelegate:self launchOptions:launchOptions]; + // NSURL *jsCodeLocation; //#ifdef DEBUG diff --git a/ios/Podfile b/ios/Podfile index dd26543a26..20ab797e67 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '10.0' +platform :ios, '11.0' target 'CalendarsExample' do config = use_native_modules! @@ -17,3 +17,11 @@ target 'CalendarsExample' do # Pods for testing end end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' + end + end + end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9af25240bd..0a17f53b84 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -267,13 +267,13 @@ PODS: - React-cxxreact (= 0.64.2) - React-jsi (= 0.64.2) - React-perflogger (= 0.64.2) - - ReactNativeNavigation (6.12.2): - - React + - ReactNativeNavigation (7.6.0): + - React-Core - React-RCTImage - React-RCTText - - ReactNativeNavigation/Core (= 6.12.2) - - ReactNativeNavigation/Core (6.12.2): - - React + - ReactNativeNavigation/Core (= 7.6.0) + - ReactNativeNavigation/Core (7.6.0): + - React-Core - React-RCTImage - React-RCTText - Yoga (1.14.0) @@ -377,10 +377,10 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c - DoubleConversion: cde416483dac037923206447da6e1454df403714 + DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b FBReactNativeSpec: 92869e54fbef651850edc0f8ad2e5e53421f5fbe - glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 + glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728 RCTTypeSafety: c1f31d19349c6b53085766359caac425926fafaa @@ -404,9 +404,9 @@ SPEC CHECKSUMS: React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3 React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9 ReactCommon: 149906e01aa51142707a10665185db879898e966 - ReactNativeNavigation: aefc8debafb4a374575adafb44a3352b9d5b618a + ReactNativeNavigation: 91c082139a6ee8ef7d5c04c70995fdd2e8ababc9 Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac -PODFILE CHECKSUM: d441a6b04db6a2cce6e0186dd6232f7e6ba9e257 +PODFILE CHECKSUM: 18eda97847d2efc053b18d81cc7f0abd0f57db97 COCOAPODS: 1.10.1 diff --git a/package.json b/package.json index 6180042ceb..9f2ca8d3c8 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "react": "17.0.1", "react-component-driver": "^0.10.0", "react-native": "0.64.2", - "react-native-navigation": "^6.7.1", + "react-native-navigation": "7.6.0", "react-test-renderer": "^17.0.1", "semver": "5.x.x", "shell-utils": "1.x.x", From b91682135acc9b6e9e9aff8492365c3fd9b0fa67 Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Thu, 5 Aug 2021 13:28:12 +0300 Subject: [PATCH 09/13] Revert "RNN upgrade; ios configs" This reverts commit 5e6a8dda18c2cb1ac6b572ccbe7f96f610a35330. --- ios/CalendarsExample.xcodeproj/project.pbxproj | 1 - ios/CalendarsExample/AppDelegate.m | 5 +++-- ios/Podfile | 10 +--------- ios/Podfile.lock | 18 +++++++++--------- package.json | 2 +- 5 files changed, 14 insertions(+), 22 deletions(-) diff --git a/ios/CalendarsExample.xcodeproj/project.pbxproj b/ios/CalendarsExample.xcodeproj/project.pbxproj index e5111dad12..292f015423 100644 --- a/ios/CalendarsExample.xcodeproj/project.pbxproj +++ b/ios/CalendarsExample.xcodeproj/project.pbxproj @@ -1436,7 +1436,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; - ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; diff --git a/ios/CalendarsExample/AppDelegate.m b/ios/CalendarsExample/AppDelegate.m index f390d53972..723855e102 100644 --- a/ios/CalendarsExample/AppDelegate.m +++ b/ios/CalendarsExample/AppDelegate.m @@ -8,8 +8,9 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - [ReactNativeNavigation bootstrapWithDelegate:self launchOptions:launchOptions]; - + NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; + [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions]; + // NSURL *jsCodeLocation; //#ifdef DEBUG diff --git a/ios/Podfile b/ios/Podfile index 20ab797e67..dd26543a26 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '11.0' +platform :ios, '10.0' target 'CalendarsExample' do config = use_native_modules! @@ -17,11 +17,3 @@ target 'CalendarsExample' do # Pods for testing end end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' - end - end - end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0a17f53b84..9af25240bd 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -267,13 +267,13 @@ PODS: - React-cxxreact (= 0.64.2) - React-jsi (= 0.64.2) - React-perflogger (= 0.64.2) - - ReactNativeNavigation (7.6.0): - - React-Core + - ReactNativeNavigation (6.12.2): + - React - React-RCTImage - React-RCTText - - ReactNativeNavigation/Core (= 7.6.0) - - ReactNativeNavigation/Core (7.6.0): - - React-Core + - ReactNativeNavigation/Core (= 6.12.2) + - ReactNativeNavigation/Core (6.12.2): + - React - React-RCTImage - React-RCTText - Yoga (1.14.0) @@ -377,10 +377,10 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c - DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de + DoubleConversion: cde416483dac037923206447da6e1454df403714 FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b FBReactNativeSpec: 92869e54fbef651850edc0f8ad2e5e53421f5fbe - glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 + glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c RCTRequired: 6d3e854f0e7260a648badd0d44fc364bc9da9728 RCTTypeSafety: c1f31d19349c6b53085766359caac425926fafaa @@ -404,9 +404,9 @@ SPEC CHECKSUMS: React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3 React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9 ReactCommon: 149906e01aa51142707a10665185db879898e966 - ReactNativeNavigation: 91c082139a6ee8ef7d5c04c70995fdd2e8ababc9 + ReactNativeNavigation: aefc8debafb4a374575adafb44a3352b9d5b618a Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac -PODFILE CHECKSUM: 18eda97847d2efc053b18d81cc7f0abd0f57db97 +PODFILE CHECKSUM: d441a6b04db6a2cce6e0186dd6232f7e6ba9e257 COCOAPODS: 1.10.1 diff --git a/package.json b/package.json index 9f2ca8d3c8..6180042ceb 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "react": "17.0.1", "react-component-driver": "^0.10.0", "react-native": "0.64.2", - "react-native-navigation": "7.6.0", + "react-native-navigation": "^6.7.1", "react-test-renderer": "^17.0.1", "semver": "5.x.x", "shell-utils": "1.x.x", From 1f98fd38937bc48f4bbeac2a1668c24d6d8ceb13 Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Sun, 8 Aug 2021 10:46:45 +0300 Subject: [PATCH 10/13] Adding postinstall.js to scripts - fix detox ios build on CI --- package.json | 3 +- scripts/postinstall.js | 79 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 scripts/postinstall.js diff --git a/package.json b/package.json index 6180042ceb..c593932e9d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "android": "react-native run-android", "xcode": "open ios/CalendarsExample.xcworkspace/", "clean": "rm package-lock.json && rm -rf ./node_modules && npm i", - "pod-install": "pod install --project-directory=ios" + "pod-install": "pod install --project-directory=ios", + "postinstall": "node ./scripts/postinstall.js" }, "repository": { "type": "git", diff --git a/scripts/postinstall.js b/scripts/postinstall.js new file mode 100644 index 0000000000..2dfb792257 --- /dev/null +++ b/scripts/postinstall.js @@ -0,0 +1,79 @@ +const fs = require('fs-extra'); +const path = require('path'); +const semver = require('semver'); + +const rnVersion = function() { + const rnPackageJson = require('react-native/package.json'); + return rnPackageJson.version; +}(); + +function patchHermesLocationForRN60Android() { + const HERMES_PATH_ROOT = path.join('node_modules', 'hermesvm'); + const HERMES_PATH_RN = path.join('node_modules', 'react-native', 'node_modules', 'hermesvm'); + + const hermesIsInRoot = fs.existsSync(HERMES_PATH_ROOT); + const hermesIsInRN = fs.existsSync(HERMES_PATH_RN); + + if (hermesIsInRoot && !hermesIsInRN) { + console.log(' Applying hermes-vm patch for RN .60...'); + fs.ensureDirSync(path.join(HERMES_PATH_RN, 'android')); + fs.copySync(path.join(HERMES_PATH_ROOT, 'android'), path.join(HERMES_PATH_RN, 'android')); + } else { + console.log(' Skipping hermes-vm patching (not needed):', hermesIsInRoot, hermesIsInRN); + } +} + +/** + * In RN .64, it seems that react-native-codegen - a proprietary code generation plugin, whose + * native code is only available inside react-native's monorepo, has been applied. + * This patch disables it, and that works - as long as RN is used as an .aar dep and + * not built from source. I can't account for the latter; It is likely that with .64 it may not + * be possible to do anymore. If ever needed, one approach to try out is to somehow build the + * plugin ourselves through the react-native monorepo itself (onto a .jar), and then add it as a + * direct plugin dependency into our settings.gradle (https://docs.gradle.org/current/userguide/plugins.html#sec:custom_plugin_repositories). + */ +function overrideReactAndroidGradleForRn64Android() { + const REACT_ANDROID_PATH = path.join('node_modules', 'react-native', 'ReactAndroid'); + const REACT_ANDROID_GRADLE_SCRIPT_PATH = path.join(REACT_ANDROID_PATH, 'build.gradle'); + const REACT_ANDROID_GRADLE_BAK_SCRIPT_PATH = path.join(REACT_ANDROID_PATH, 'build.gradle.bak'); + const PATCH_SCRIPT_PATH = path.join('scripts', 'ReactAndroid_rn64_build.gradle'); + + console.log(' Overriding ReactAndroid\'s build.gradle...'); + try { + fs.renameSync(REACT_ANDROID_GRADLE_SCRIPT_PATH, REACT_ANDROID_GRADLE_BAK_SCRIPT_PATH); + } catch (e) { + console.warn(' Couldn\'t create a backup to original script (skipping)', e); + } + fs.copySync(PATCH_SCRIPT_PATH, REACT_ANDROID_GRADLE_SCRIPT_PATH); +} + +function cleanFindNodeScriptFileForRn64IOS() { + const REACT_SCRIPTS_PATH = path.join('node_modules', 'react-native', 'scripts'); + const REACT_FIND_NODE_SCRIPT_PATH = path.join(REACT_SCRIPTS_PATH, 'find-node.sh'); + + console.log(' Clean content of find-node.sh file..'); + try { + fs.writeFileSync(REACT_FIND_NODE_SCRIPT_PATH, ''); + } catch (e) { + console.warn(' Couldn\'t clean content find-node.sh file', e); + } +} + +function run() { + console.log('Running Detox test-app post-install script...'); + + if (semver.minor(rnVersion) === 60) { + console.log(' Detected RN version .60! Applying necessary patches...'); + patchHermesLocationForRN60Android(); + } + + if (semver.minor(rnVersion) === 64) { + console.log(' Detected RN version .64! Applying necessary patches...'); + overrideReactAndroidGradleForRn64Android(); + cleanFindNodeScriptFileForRn64IOS(); + } + + console.log('Detox test-app post-install script completed!'); +} + +run(); \ No newline at end of file From ad2937db226b581b380c306fd4c539da9a55d2da Mon Sep 17 00:00:00 2001 From: Inbal Tish Date: Sun, 8 Aug 2021 11:02:47 +0300 Subject: [PATCH 11/13] fix postinstall script --- scripts/postinstall.js | 56 +++--------------------------------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 2dfb792257..b411fc1e27 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -7,73 +7,25 @@ const rnVersion = function() { return rnPackageJson.version; }(); -function patchHermesLocationForRN60Android() { - const HERMES_PATH_ROOT = path.join('node_modules', 'hermesvm'); - const HERMES_PATH_RN = path.join('node_modules', 'react-native', 'node_modules', 'hermesvm'); - - const hermesIsInRoot = fs.existsSync(HERMES_PATH_ROOT); - const hermesIsInRN = fs.existsSync(HERMES_PATH_RN); - - if (hermesIsInRoot && !hermesIsInRN) { - console.log(' Applying hermes-vm patch for RN .60...'); - fs.ensureDirSync(path.join(HERMES_PATH_RN, 'android')); - fs.copySync(path.join(HERMES_PATH_ROOT, 'android'), path.join(HERMES_PATH_RN, 'android')); - } else { - console.log(' Skipping hermes-vm patching (not needed):', hermesIsInRoot, hermesIsInRN); - } -} - -/** - * In RN .64, it seems that react-native-codegen - a proprietary code generation plugin, whose - * native code is only available inside react-native's monorepo, has been applied. - * This patch disables it, and that works - as long as RN is used as an .aar dep and - * not built from source. I can't account for the latter; It is likely that with .64 it may not - * be possible to do anymore. If ever needed, one approach to try out is to somehow build the - * plugin ourselves through the react-native monorepo itself (onto a .jar), and then add it as a - * direct plugin dependency into our settings.gradle (https://docs.gradle.org/current/userguide/plugins.html#sec:custom_plugin_repositories). - */ -function overrideReactAndroidGradleForRn64Android() { - const REACT_ANDROID_PATH = path.join('node_modules', 'react-native', 'ReactAndroid'); - const REACT_ANDROID_GRADLE_SCRIPT_PATH = path.join(REACT_ANDROID_PATH, 'build.gradle'); - const REACT_ANDROID_GRADLE_BAK_SCRIPT_PATH = path.join(REACT_ANDROID_PATH, 'build.gradle.bak'); - const PATCH_SCRIPT_PATH = path.join('scripts', 'ReactAndroid_rn64_build.gradle'); - - console.log(' Overriding ReactAndroid\'s build.gradle...'); - try { - fs.renameSync(REACT_ANDROID_GRADLE_SCRIPT_PATH, REACT_ANDROID_GRADLE_BAK_SCRIPT_PATH); - } catch (e) { - console.warn(' Couldn\'t create a backup to original script (skipping)', e); - } - fs.copySync(PATCH_SCRIPT_PATH, REACT_ANDROID_GRADLE_SCRIPT_PATH); -} - function cleanFindNodeScriptFileForRn64IOS() { const REACT_SCRIPTS_PATH = path.join('node_modules', 'react-native', 'scripts'); const REACT_FIND_NODE_SCRIPT_PATH = path.join(REACT_SCRIPTS_PATH, 'find-node.sh'); - console.log(' Clean content of find-node.sh file..'); + console.log('Clean content of find-node.sh file..'); try { fs.writeFileSync(REACT_FIND_NODE_SCRIPT_PATH, ''); } catch (e) { - console.warn(' Couldn\'t clean content find-node.sh file', e); + console.warn('Couldn\'t clean content find-node.sh file'); } } function run() { - console.log('Running Detox test-app post-install script...'); - - if (semver.minor(rnVersion) === 60) { - console.log(' Detected RN version .60! Applying necessary patches...'); - patchHermesLocationForRN60Android(); - } + console.log('Running post-install script...'); if (semver.minor(rnVersion) === 64) { - console.log(' Detected RN version .64! Applying necessary patches...'); - overrideReactAndroidGradleForRn64Android(); + console.log('Detected RN version .64! Applying necessary patches...'); cleanFindNodeScriptFileForRn64IOS(); } - - console.log('Detox test-app post-install script completed!'); } run(); \ No newline at end of file From dbd3882dc1789f6a8d9b74a1fcda0083523fe489 Mon Sep 17 00:00:00 2001 From: Lidor Dafna Date: Sun, 8 Aug 2021 12:14:49 +0300 Subject: [PATCH 12/13] set month only if exists --- src/expandableCalendar/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/expandableCalendar/index.js b/src/expandableCalendar/index.js index a867a7c496..9c7afe57c2 100644 --- a/src/expandableCalendar/index.js +++ b/src/expandableCalendar/index.js @@ -352,15 +352,16 @@ class ExpandableCalendar extends Component { this.bounceToPosition(this.closedHeight); } }, 0); - + if (this.props.onDayPress) { this.props.onDayPress(value); } }; onVisibleMonthsChange = value => { - if (this.visibleMonth !== _.first(value).month) { - this.visibleMonth = _.first(value).month; // equivalent to this.getMonth(value[0].dateString) + const month = _.first(value) && _.first(value).month; + if (month && this.visibleMonth !== month) { + this.visibleMonth = month; // equivalent to this.getMonth(value[0].dateString) // for horizontal scroll const {date, updateSource} = this.props.context; From 9f31a535fca352be0fb48f48cf7c901d7a9eee3c Mon Sep 17 00:00:00 2001 From: Lidor Dafna Date: Mon, 9 Aug 2021 14:10:17 +0300 Subject: [PATCH 13/13] Fix bug in marking + update weekCalendar screen name --- example/src/screens/menu.js | 2 +- src/calendar/day/marking/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/src/screens/menu.js b/example/src/screens/menu.js index a5fc1fe7b0..9069c70406 100644 --- a/example/src/screens/menu.js +++ b/example/src/screens/menu.js @@ -65,7 +65,7 @@ export default class MenuScreen extends Component { options: { topBar: { title: { - text: screen + text: props?.weekView ? 'WeekCalendar' : screen }, backButton: { accessibilityLabel: 'back', diff --git a/src/calendar/day/marking/index.tsx b/src/calendar/day/marking/index.tsx index afb55eebfb..fdfafa615b 100644 --- a/src/calendar/day/marking/index.tsx +++ b/src/calendar/day/marking/index.tsx @@ -91,7 +91,7 @@ export default class Marking extends Component { if (items && Array.isArray(items) && items.length > 0) { // Filter out items so that we process only those which have color property - const validItems = _.filter(items, function(o: DOT | PERIOD) { return !o.color; }); + const validItems = _.filter(items, function(o: DOT | PERIOD) { return o.color; }); return validItems.map((item, index) => { return type === MarkingTypes.MULTI_DOT ? this.renderDot(index, item) : this.renderPeriod(index, item);