How to use the @stencil/core.Build.isDev function in @stencil/core

To help you get started, we’ve selected a few @stencil/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / ionic / packages / core / src / components / router / router.tsx View on Github external
componentDidLoad() {
    const tree = readRoutes(this.el);
    this.routes = flattenRouterTree(tree);
    this.redirects = readRedirects(this.el);

    if (Build.isDev) {
      console.debug('%c[@ionic/core]', 'font-weight: bold', `ion-router registered ${this.routes.length} routes`);
      for (const chain of this.routes) {
        const path: string[] = [];
        chain.forEach(r => path.push(...r.path));
        const ids = chain.map(r => r.id);
        console.debug(`%c ${generatePath(path)}`, 'font-weight: bold; padding-left: 20px', '=>\t', `(${ids.join(', ')})`);
      }
    }

    // perform first write
    this.dom.raf(() => {
      console.debug('[OUT] page load -> write nav state');
      this.onPopState();
    });
  }
github arquivo / pwa-technologies / PwaArchive-access / projects / nutchwax / nutchwax-webapp / src / main / webapp / @ionic / core / dist / collection / components / menu-controller / menu-controller.js View on Github external
async get(menu) {
        if (Build.isDev) {
            if (menu === 'left') {
                console.error('menu.side=left is deprecated, use "start" instead');
                return undefined;
            }
            if (menu === 'right') {
                console.error('menu.side=right is deprecated, use "end" instead');
                return undefined;
            }
        }
        await this.waitUntilReady();
        if (menu === 'start' || menu === 'end') {
            // there could be more than one menu on the same side
            // so first try to get the enabled one
            const menuRef = this.find(m => m.side === menu && !m.disabled);
            if (menuRef) {
                return menuRef;
github ionic-team / ionic / core / src / components / modal-controller / modal-controller.tsx View on Github external
constructor() {
    if (Build.isDev) {
      console.warn(`[DEPRECATED][ion-modal-controller] Use the modalController export from @ionic/core:
  import { modalController } from '@ionic/core';
  const modal = await modalController.create({...});`);
    }
  }
github ionic-team / ionic / core / src / components / alert-controller / alert-controller.tsx View on Github external
constructor() {
    if (Build.isDev) {
      console.warn(`[DEPRECATED][ion-alert-controller] Use the alertController export from @ionic/core:
  import { alertController } from '@ionic/core';
  const alert = await alertController.create({...});`);
    }
  }
github ionic-team / ionic / core / src / components / nav / nav.tsx View on Github external
rootChanged() {
    const isDev = Build.isDev;
    if (this.root !== undefined) {
      if (!this.useRouter) {
        this.setRoot(this.root, this.rootParams);
      } else if (isDev) {
        console.warn(
          ' does not support a root attribute when using ion-router.'
        );
      }
    }
  }
github ionic-team / ionic / packages / core / src / components / tab / tab.tsx View on Github external
componentWillLoad() {
    if (Build.isDev) {
      if (this.component && this.el.childElementCount > 0) {
        console.error('You can not use a lazy-loaded component in a tab and inlineed content at the same time.' +
      `- Remove the component attribute in: ` +
      ` or` +
      `- Remove the embeded content inside the ion-tab: `);
      }
    }
  }
  @Method()
github ionic-team / ionic / core / src / components / menu-controller / menu-controller.ts View on Github external
constructor() {
    if (Build.isDev) {
      console.warn(`[DEPRECATED][ion-menu-controller] Use the menuController export from @ionic/core:
  import { menuController } from '@ionic/core';`);
    }
  }
github arquivo / pwa-technologies / PwaArchive-access / projects / nutchwax / nutchwax-webapp / src / main / webapp / @ionic / core / dist / collection / components / nav / nav.js View on Github external
rootChanged() {
        const isDev = Build.isDev;
        if (this.root !== undefined) {
            if (!this.useRouter) {
                this.setRoot(this.root, this.rootParams);
            }
            else if (isDev) {
                console.warn(' does not support a root attribute when using ion-router.');
            }
        }
    }
    componentWillLoad() {
github ionic-team / ionic / core / src / components / popover-controller / popover-controller.tsx View on Github external
constructor() {
    if (Build.isDev) {
      console.warn(`[DEPRECATED][ion-popover-controller] Use the popoverController export from @ionic/core:
  import { popoverController } from '@ionic/core';
  const popover = await popoverController.create({...});`);
    }
  }
github ionic-team / ionic / core / src / components / tab / tab.tsx View on Github external
componentWillLoad() {
    if (Build.isDev) {
      if (this.component !== undefined && this.el.childElementCount > 0) {
        console.error('You can not use a lazy-loaded component in a tab and inlined content at the same time.' +
      `- Remove the component attribute in: ` +
      ` or` +
      `- Remove the embedded content inside the ion-tab: `);
      }
    }
  }