Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for distribution #2556

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# React Native Calendars 🗓️ 📆

## Distribution of Phorest fork

Run the command `yarn dist` to create a distribution. Make sure the img folders are copied over from the src to the dist.
This has to happen manually as no automation is in place given we do this every year or less.

## A declarative cross-platform React Native calendar component for iOS and Android.

[![Version](https://img.shields.io/npm/v/react-native-calendars.svg)](https://www.npmjs.com/package/react-native-calendars)
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.calendarsexample">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
22 changes: 22 additions & 0 deletions dist/Profiler.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { ProfilerProps as RProfilerProps, PropsWithChildren } from 'react';
export declare type ProfilerProps = Pick<RProfilerProps, 'id'>;
export default class Profiler extends React.Component<PropsWithChildren<ProfilerProps>> {
onRender: (...profileData: any[]) => void;
render(): React.JSX.Element;
}
export declare const getProfileData: ([id, phase, actualDuration, baseDuration, startTime, commitTime, interactions]: [any, any, any, any, any, any, any]) => {
id: any;
interactions: any;
phase: any;
actualDuration: number;
baseDuration: number;
commitTime: number;
cumulativeDuration: string;
startTime: number;
};
export declare const logProfileData: ({ id, actualDuration, cumulativeDuration, phase }: {
id: any;
actualDuration: any;
cumulativeDuration: any;
phase: any;
}) => void;
55 changes: 55 additions & 0 deletions dist/Profiler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// @ts-nocheck
// Taken from
// https://medium.com/life-at-paperless/how-to-use-the-react-profiler-component-to-measure-performance-improvements-from-hooks-d43b7092d7a8
// Profiler callback
// https://reactjs.org/docs/profiler.html#onrender-callback
import React, { Profiler as RProfiler } from 'react';
// The entire render time since execution of this file (likely on page load)
const cumulativeDuration = {};
export default class Profiler extends React.Component {
constructor() {
super(...arguments);
this.onRender = (...profileData) => {
logProfileData(getProfileData(profileData));
};
}
render() {
const { children, id } = this.props;
return (<RProfiler id={id} onRender={this.onRender}>
{children}
</RProfiler>);
}
}
// TODO: fix typescript...
export const getProfileData = ([id, // the "id" prop of the Profiler tree that has just committed
phase, // either "mount" (if the tree just mounted) or "update" (if it re-rendered)
actualDuration, // time spent rendering the committed update
baseDuration, // estimated time to render the entire subtree without memoization
startTime, // when React began rendering this update
commitTime, // when React committed this update
interactions // the Set of interactions belonging to this update
]) => {
var _a;
cumulativeDuration[id] = Number((((_a = cumulativeDuration[id]) !== null && _a !== void 0 ? _a : 0) + actualDuration).toFixed(2));
return {
id,
interactions,
phase,
actualDuration: Number(actualDuration.toFixed(2)),
baseDuration: Number(baseDuration.toFixed(2)),
commitTime: Number(commitTime.toFixed(2)),
cumulativeDuration: cumulativeDuration[id],
startTime: Number(startTime.toFixed(2))
};
};
export const logProfileData = ({ id, actualDuration, cumulativeDuration, phase }) => {
console.group(phase);
// table did not work for me so I used log instead
console.log(id, ':', actualDuration, cumulativeDuration);
// console.table({
// actualDuration,
// baseDuration,
// cumulativeDuration
// });
console.groupEnd();
};
Binary file added dist/agenda/img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
368 changes: 368 additions & 0 deletions dist/agenda/index.d.ts

Large diffs are not rendered by default.

Loading