<commit_before>const React = require('react')
const { renderToString, renderToStaticMarkup } = require('react-dom/server')
const App = require('./components/app')
const Page = require('./components/page')

module.exports = function ssr ({ webpackStats, content }) {
  const assets = Object.keys(webpackStats.compilation.assets)
  const js = assets.filter(a => a.match(/\.js$/))
  const css = assets.filter(a => a.match(/\.css$/))
  const body = renderToString(React.createElement(App, content))
  const pageProps = {
    js,
    css,
    body,
    content
  }
  const html = `
    <!doctype html>
    ${renderToStaticMarkup(React.createElement(Page, pageProps))}
  `
  return html
}
<commit_msg>Attach file path to page props<commit_after>const React = require('react')
const { renderToString, renderToStaticMarkup } = require('react-dom/server')
const App = require('./components/app')
const Page = require('./components/page')

module.exports = function ssr ({ webpackStats, content, path }) {
  const assets = Object.keys(webpackStats.compilation.assets)
  const js = assets.filter(a => a.match(/\.js$/))
  const css = assets.filter(a => a.match(/\.css$/))
  content.path = path
  const body = renderToString(React.createElement(App, content))
  const pageProps = {
    js,
    css,
    body,
    content
  }
  const html = `
    <!doctype html>
    ${renderToStaticMarkup(React.createElement(Page, pageProps))}
  `
  return html
}

{'fraction_non_alphanumeric': 0.14843205574912893, 'fraction_numerical': 0.0, 'mean_word_length': 3.9347079037800685, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '162379', 'n_tokens_mistral': 450, 'n_tokens_neox': 445, 'n_words': 102}