<commit_before>import React, { Component } from 'react';
import { DefaultContext } from '../helpers/contexts';
import SwissController from '../classes/SwissController';

const isRN =
  typeof navigator != 'undefined' && navigator.product == 'ReactNative';

export default class SwissProvider extends Component {
  toString = () =>
    [
      '<style id="swiss-styles" type="text/css">',
      this.controller.stylesToAppend.join('\r\n'),
      '</style>',
      '<script id="swiss-hydration">',
      `window.__swissHydration = ${JSON.stringify(
        this.controller.cacheByType
      )}`,
      '</script>'
    ].join('\r\n');
  toComponents = () => (
    <>
      <style id="swiss-styles" type="text/css">
        {`${this.controller.stylesToAppend.join('\r\n')}`}
      </style>
      <script id="swiss-hydration">
        {`window.__swissHydration = ${JSON.stringify({
          cacheByType: this.controller.cacheByType
        })};`}
      </script>
    </>
  );<commit_msg>master: hydration with room for adding more<commit_after>import React, { Component } from 'react';
import { DefaultContext } from '../helpers/contexts';
import SwissController from '../classes/SwissController';

const isRN =
  typeof navigator != 'undefined' && navigator.product == 'ReactNative';

export default class SwissProvider extends Component {
  toString = () =>
    [
      '<style id="swiss-styles" type="text/css">',
      this.controller.stylesToAppend.join('\r\n'),
      '</style>',
      '<script id="swiss-hydration">',
      `window.__swissHydration = ${JSON.stringify({
        cacheByType: this.controller.cacheByType
      })}`,
      '</script>'
    ].join('\r\n');
  toComponents = () => (
    <>
      <style id="swiss-styles" type="text/css">
        {`${this.controller.stylesToAppend.join('\r\n')}`}
      </style>
      <script id="swiss-hydration">
        {`window.__swissHydration = ${JSON.stringify({
          cacheByType: this.controller.cacheByType
        })};`}
      </script>
    </>
  );
{'fraction_non_alphanumeric': 0.18000994530084535, 'fraction_numerical': 0.0, 'mean_word_length': 2.9606299212598426, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, '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': '1341068', 'n_tokens_mistral': 616, 'n_tokens_neox': 621, 'n_words': 111}