<commit_before>import {
  createPlatformFactory, PlatformRef, Injectable, Inject, Injector, Provider,
  InjectionToken, ClassType, ComponentFactory, ApplicationRef, RendererFactory,
  CORE_PROVIDERS, ComponentResolver, ReflectiveInjector, ComponentFactoryResolver
} from 'mojiito-core';
import { unimplemented } from './facade/error';
import { ListWrapper } from './facade/collection';
import { DOCUMENT } from './tokens';
import { Compiler } from './compiler/compiler';
import { DomTraverser } from './dom_traverser';
import { DomRendererFactory } from './dom_renderer';
import { ExpressionParser } from './expression/expression';
import { BindingParser } from './binding_parser';

@Injectable()
export class BrowserPlatformRef extends PlatformRef {
  private _destroyed = false;
  private _destroyListeners: Function[] = [];

  constructor(private _injector: Injector, private _resolver: ComponentResolver,
    private _compiler: Compiler) {
    super();
  }

  get injector(): Injector { return this._injector; }
  get destroyed(): boolean { return this._destroyed; }

  bootstrapComponent<C>(component: ClassType<C>): void {
    this._compiler.compileComponents([component]);
    const appInjector = ReflectiveInjector.resolveAndCreate([
      {
        provide: ComponentFactoryResolver,
        useFactory: () => this._compiler.createComponentFactoryResolver()
      },
      ApplicationRef,
    ], this._injector);

    const app = appInjector.get(ApplicationRef) as ApplicationRef;
    app.bootstrap(component);
  }

  onDestroy(callback: () => void): void {
    this._destroyListeners.push(callback);
  }

  destroy(): void {
    if (this._destroyed) {
      throw new Error('The platform has already been destroyed!');
    }
    // TODO: destroy all se stuff
    this._destroyListeners.forEach(listener => listener());
    this._destroyed = true;
  }
}

function factoryResolver(compiler: Compiler) {
  return compiler.componentFactoryResolver;
}

export const PLATFORM_PROVIDERS = [
  { provide: PlatformRef, useClass: BrowserPlatformRef },
  { provide: DOCUMENT, useValue: document },
  { provide: RendererFactory, useClass: DomRendererFactory},
  Compiler,
  ExpressionParser,
  BindingParser
];

export const platformBrowser = createPlatformFactory([PLATFORM_PROVIDERS, CORE_PROVIDERS]);
<commit_msg>fixed build issue with platform<commit_after>import {
  createPlatformFactory, PlatformRef, Injectable, Inject, Injector, Provider,
  InjectionToken, ClassType, ComponentFactory, ApplicationRef, RendererFactory,
  CORE_PROVIDERS, ComponentResolver, ReflectiveInjector, ComponentFactoryResolver
} from 'mojiito-core';
import { unimplemented } from './facade/error';
import { ListWrapper } from './facade/collection';
import { DOCUMENT } from './tokens';
import { Compiler } from './compiler/compiler';
import { DomTraverser } from './dom_traverser';
import { DomRendererFactory } from './dom_renderer';
import { ExpressionParser } from './expression/expression';
import { BindingParser } from './binding_parser';

@Injectable()
export class BrowserPlatformRef extends PlatformRef {
  private _destroyed = false;
  private _destroyListeners: Function[] = [];

  constructor(private _injector: Injector, private _resolver: ComponentResolver,
    private _compiler: Compiler) {
    super();
  }

  get injector(): Injector { return this._injector; }
  get destroyed(): boolean { return this._destroyed; }

  bootstrapComponent<C>(component: ClassType<C>): void {
    this._compiler.compileComponents([component]);
    const appInjector = ReflectiveInjector.resolveAndCreate([
      {
        provide: ComponentFactoryResolver,
        useFactory: () => this._compiler.createComponentFactoryResolver()
      },
      ApplicationRef,
    ], this._injector);

    const app = appInjector.get(ApplicationRef) as ApplicationRef;
    app.bootstrap(component);
  }

  onDestroy(callback: () => void): void {
    this._destroyListeners.push(callback);
  }

  destroy(): void {
    if (this._destroyed) {
      throw new Error('The platform has already been destroyed!');
    }
    // TODO: destroy all se stuff
    this._destroyListeners.forEach(listener => listener());
    this._destroyed = true;
  }
}

export const PLATFORM_PROVIDERS = [
  { provide: PlatformRef, useClass: BrowserPlatformRef },
  { provide: DOCUMENT, useValue: document },
  { provide: RendererFactory, useClass: DomRendererFactory},
  Compiler,
  ExpressionParser,
  BindingParser
];

export const platformBrowser = createPlatformFactory([PLATFORM_PROVIDERS, CORE_PROVIDERS]);

{'fraction_non_alphanumeric': 0.11137961335676626, 'fraction_numerical': 0.0, 'mean_word_length': 4.734256926952141, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '3306836', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1243, 'n_words': 307}