Skip to content

Commit

Permalink
Support loading sharded models with bundleResourceIO (#4113)
Browse files Browse the repository at this point in the history
FEATURE
  • Loading branch information
tafsiri authored Oct 27, 2020
1 parent af6e1d6 commit 744cfdb
Show file tree
Hide file tree
Showing 12 changed files with 7,491 additions and 72 deletions.
27 changes: 26 additions & 1 deletion scripts/release_notes/release_notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const VIS_REPO: Repo = {
path: 'tfjs-vis',
};

const RN_REPO: Repo = {
name: 'tfjs-react-native',
identifier: 'tfjs-react-native',
path: 'tfjs-react-native',
};

async function askUserForVersions(validVersions: string[], packageName: string):
Promise<{startVersion: string, endVersion: string}> {
const YELLOW_TERMINAL_COLOR = '\x1b[33m%s\x1b[0m';
Expand Down Expand Up @@ -135,6 +141,23 @@ async function generateVisNotes() {
await generateNotes([VIS_REPO]);
}


async function generateReactNativeNotes() {
// Get start version and end version.
const versions = getTaggedVersions('tfjs-react-native');
const {startVersion, endVersion} =
await askUserForVersions(versions, 'tfjs-react-native');

// Get tfjs-vis start version and end version.
RN_REPO.startVersion = startVersion;
RN_REPO.endVersion = endVersion;
RN_REPO.startCommit = $(`git rev-list -n 1 ${
getTagName(RN_REPO.identifier, RN_REPO.startVersion)}`);

await generateNotes([RN_REPO]);
}


async function generateNotes(repositories: util.Repo[]) {
const repoCommits: RepoCommits[] = [];
// Clone all of the dependencies into the tmp directory.
Expand Down Expand Up @@ -217,7 +240,7 @@ parser.addArgument('--project', {
help:
'Which project to generate release notes for. One of union|vis. Defaults to union.',
defaultValue: 'union',
choices: ['union', 'vis']
choices: ['union', 'vis', 'rn']
});

const args = parser.parseArgs();
Expand All @@ -226,4 +249,6 @@ if (args.project === 'union') {
generateTfjsPackageNotes();
} else if (args.project === 'vis') {
generateVisNotes();
} else if (args.project === 'rn') {
generateReactNativeNotes();
}
6 changes: 4 additions & 2 deletions tfjs-react-native/integration_rn59/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import com.android.build.OutputFile
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
* bundleInDebug: false,/
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
Expand Down Expand Up @@ -90,7 +90,9 @@ import com.android.build.OutputFile
*/

project.ext.react = [
entryFile: "index.js"
entryFile: "index.js",
// Uncomment when using ./gradlew assembleDebug
// bundleInDebug: true,
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 744cfdb

Please sign in to comment.