<commit_before>import React from 'react';
import {loadViaNode} from './http-get.js';
import Page from '../components/page.js';
import GithubSearchResult from '../github-search-result.js';
import {GITHUB_URL} from '../config.js';

function _renderOnServer(err, githubJson) {
  if (err) {
    console.log(err);
  } else {
    const preRendered = React.renderToStaticMarkup(<Page kataGroups={GithubSearchResult.toKataGroups(githubJson)}/>);
    console.log(preRendered);
  }
}

//import data from '../for-offline/data.json';
//function loadFromFile(onLoaded) {
//  onLoaded(null, data);
//}

loadViaNode(GITHUB_URL, _renderOnServer);
//loadFromFile(_renderOnServer);<commit_msg>Include the react IDs when pre-rendering.<commit_after>import React from 'react';
import {loadViaNode} from './http-get.js';
import Page from '../components/page.js';
import GithubSearchResult from '../github-search-result.js';
import {GITHUB_URL} from '../config.js';

function _renderOnServer(err, githubJson) {
  if (err) {
    console.log(err);
  } else {
    const preRendered = React.renderToString(<Page kataGroups={GithubSearchResult.toKataGroups(githubJson)}/>);
    console.log(preRendered);
  }
}

//import data from '../for-offline/data.json';
//function loadFromFile(onLoaded) {
//  onLoaded(null, data);
//}

loadViaNode(GITHUB_URL, _renderOnServer);
//loadFromFile(_renderOnServer);
{'fraction_non_alphanumeric': 0.1588921282798834, 'fraction_numerical': 0.0, 'mean_word_length': 4.817796610169491, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '71177', 'n_tokens_mistral': 459, 'n_tokens_neox': 453, 'n_words': 90}