<commit_before>import React from 'react';
import ExampleStyle from './ExampleStyle';
import Extras from './Extras';
import Scripts from './Scripts';
import Styles from './Styles';

const VanillaTemplate = ({ appLocation, options, scriptFiles, styleFiles, indexFragment }) => {
    const agGridVersion = '24.1.0';
    const communityScriptPath = `https://unpkg.com/@ag-grid-community/all-modules@${agGridVersion}/dist/ag-grid-community.min.js`;
    const enterpriseScriptPath = `https://unpkg.com/@ag-grid-enterprise/all-modules@${agGridVersion}/dist/ag-grid-enterprise.min.js`;

    return <html lang="en">
        <head>
            <ExampleStyle />
            <Styles files={styleFiles} />
            <Extras options={options} />
        </head>
        <body>
            <div style={{ height: '100%', boxSizing: 'border-box' }} dangerouslySetInnerHTML={{ __html: indexFragment }}></div>

            <script dangerouslySetInnerHTML={{ __html: `var __basePath = '${appLocation}';` }}></script>
            <script src={options.enterprise ? enterpriseScriptPath : communityScriptPath}></script>
            <Scripts files={scriptFiles} />
        </body>
    </html>;
};

export default VanillaTemplate;<commit_msg>AG-4634 - removed unwanted wrapper around fragment in vanilla examples<commit_after>import React from 'react';
import ReactDOMServer from 'react-dom/server';
import ExampleStyle from './ExampleStyle';
import Extras from './Extras';
import Scripts from './Scripts';
import Styles from './Styles';

const VanillaTemplate = ({ appLocation, options, scriptFiles, styleFiles, indexFragment }) =>
    <html lang="en">
        <head>
            <ExampleStyle />
            <Styles files={styleFiles} />
            <Extras options={options} />
        </head>
        <Body appLocation={appLocation} options={options} scriptFiles={scriptFiles} indexFragment={indexFragment} />
    </html>;

// we have to use this function to avoid a wrapping div around the fragment
const Body = ({ appLocation, options, scriptFiles, indexFragment }) => {
    const agGridVersion = '24.1.0';
    const communityScriptPath = `https://unpkg.com/@ag-grid-community/all-modules@${agGridVersion}/dist/ag-grid-community.min.js`;
    const enterpriseScriptPath = `https://unpkg.com/@ag-grid-enterprise/all-modules@${agGridVersion}/dist/ag-grid-enterprise.min.js`;

    const bodySuffix = ReactDOMServer.renderToStaticMarkup(
        <>
            <script dangerouslySetInnerHTML={{ __html: `var __basePath = '${appLocation}';` }}></script>
            <script src={options.enterprise ? enterpriseScriptPath : communityScriptPath}></script>
            <Scripts files={scriptFiles} />
        </>
    );

    return <body dangerouslySetInnerHTML={{ __html: `${indexFragment}\n${bodySuffix}` }}></body>;
};

export default VanillaTemplate;
{'fraction_non_alphanumeric': 0.1474019088016967, 'fraction_numerical': 0.005302226935312832, 'mean_word_length': 3.5425361155698236, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 39, 'https://': 4, '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': '2564920', 'n_tokens_mistral': 806, 'n_tokens_neox': 793, 'n_words': 182}