Skip to content

Conversation

@adamdbradley
Copy link
Contributor

@ionic/core/components package will be included in the npm distribution.

@github-actions github-actions bot added package: angular @ionic/angular package package: core @ionic/core package labels Feb 3, 2021
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance you can create a dev build so we can do some tests in conference apps before we merge?

"dependencies": {
"ionicons": "^5.1.2",
"@stencil/core": "^2.4.0",
"ionicons": "^5.5.0-1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance there's a stable release of ionicons we can use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah thinking we can release 5.5.0 once we know the dev build is good to go

@liamdebeasi liamdebeasi merged commit 0de75af into master Feb 11, 2021
@liamdebeasi liamdebeasi deleted the custom-elements branch February 11, 2021 17:08
cerkiner added a commit to cerkiner/ionic that referenced this pull request Mar 2, 2021
* master: (284 commits)
  fix(label): only show placeholder with floating label when focused (ionic-team#22958)
  feat(react): add react hooks to control overlay components (ionic-team#22484)
  feat(vue): add composition API ionic lifecycle hooks (ionic-team#22970)
  chore(): run build
  5.5.5
  fix(vue): account for event name changes in vue 3.0.6+
  fix(react, vue): navigating using ion-back-button now selects correct page (ionic-team#22974)
  fix(progress-bar): use correct theme colors in dark mode (ionic-team#22965)
  fix(progress-bar): add width transition (ionic-team#22964)
  fix(vue): prevent race conditions when opening overlays (ionic-team#22883)
  fix(progress-bar): use correct theme colors in dark mode (ionic-team#22957)
  feat(searchbar): add showClearIcon property (ionic-team#22759)
  test(): update theming test with latest dark mode values (ionic-team#22956)
  chore(): update package-lock to account for npm 7.5.3 bug fix (ionic-team#22963)
  fix(header): collapsed toolbar is no longer incorrectly shown when using ion-refresher (ionic-team#22937)
  fix(react): onIonTabsWillChange and onIonTabsDidChange event handlers are now properly bound to IonTabs (ionic-team#22233)
  fix(refresher): add correct dark mode styles (ionic-team#22639)
  feat(custom-elements): add experimental custom elements build  (ionic-team#22863)
  fix(a11y): improve support for ids with special characters when getting label element (ionic-team#22680)
  chore(): update code of conduct (ionic-team#22619)
  ...
* [@ionic/angular](https://www.npmjs.com/package/@ionic/angular)


## Custom Elements Build (Experimental)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything else to do beside calling initialize() and registering the components ?

I am trying this feature of 5.6 and have a few issues:
-The body is initially hidden[1],

  • The modals, alert, ... would not render - I am using the modalController from @ionic/core/components and registering ion-modal (IonModal) + ion-backdrop,
  • I have a <ion-select> that is not rendering (supposed to be a popover)

[1] because of

html:not(.hydrated) body {
    display: none;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you file an issue with a reproduction regarding the overlays not working?

For the css, you can add the following globally for now:

html:not(.hydrated) body {
    display: block !important;
}

We did not remove that for now since it would impact non-custom element build versions of Ionic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your super fast answer.

I have added the class to my html for now.

I'll dig a little bit in the overlay issue trying to find the root cause and I'll create an issue with a repro.

@vicb
Copy link
Contributor

vicb commented Mar 9, 2021

It seems like the pb could be

const componentOnReady = (el, callback) => {
  if (el.componentOnReady) {
    el.componentOnReady().then(callback);
  }
  else {
    callback();
  }
};

which is called from createOverlay():

const createOverlay = (tagName, opts) => {
  /* tslint:disable-next-line */
  if (typeof customElements !== 'undefined') {
    return customElements.whenDefined(tagName).then(() => {
      const element = document.createElement(tagName);
      element.classList.add('overlay-hidden');
      // convert the passed in overlay options into props
      // that get passed down into the new overlay
      Object.assign(element, opts);
      // append the overlay element to the document body
      getAppRoot(document).appendChild(element);
      return new Promise(resolve => componentOnReady(element, resolve));
    });
  }
  return Promise.resolve();
};

because ionModal.componentOnReady is undefined at this point the callback gets called with no arg so await modalController.create(...) returns undefined and you can not call modal.present() (modal being undefined).

Hand picking the component and calling its present() method works fine.

Sorry for hijacking this PR, I'll put my findings together with a repro in a bug report

Edit: see bug #23029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants