ionic-team / ionic-docs

https://ionicframework.com/docs
Apache License 2.0
587 stars 3.01k forks source link

add guide on how to install Ionic Core with other frameworks #2105

Open liamdebeasi opened 2 years ago

liamdebeasi commented 2 years ago

URL https://ionicframework.com/docs/intro/cdn

What is missing or inaccurate about the content on this page? Ionic Core does work with any library but may lack form/routing integrations. At the very least, we should show how to install @ionic/core, import and use components, and import any required CSS.

This guide should follow the CE build rather than lazy loaded build for optimized tree shaking. We need to cover the followings things:

  1. How to install @ionic/core
  2. How to properly import and register components
  3. How to import the required CSS
  4. How to add the ion-ce class to show the app.

We should also note in the docs that using Ionic Core with another library will not have form/routing integrations that the Angular/React/Vue integrations have.

p-baum commented 2 years ago

Still waiting for this. Please tell me how to import and use the components without a framework.

I intend to bundle with vite and use server side partials

gama410 commented 2 years ago

I agree with this issue. I ended up finding an example repo for a vanilla typescript build but it's not official. Ionic is already very good by itself and for small apps, a vanilla build is a viable (and valid) option. Also, the CLI creating only framework-bound projects makes it very hard to know if ionic should really be used by itself...

@p-baum For reference, here is the project that got me started: https://github.com/supertorpe/ionic-vanilla-ts

isabo commented 2 years ago

These instructions were very helpful: https://www.npmjs.com/package/@ionic/core#custom-elements-build-experimental

The only thing missing is that we need to execute document.documentElement.classList.add('ion-ce'); which I got from https://github.com/ionic-team/ionic-framework/issues/24252#issuecomment-976587787. Thank you @liamdebeasi !

DamianoP commented 1 year ago

Still waiting for this. Please tell me how to import and use the components without a framework.

I intend to bundle with vite and use server side partials

yea, would be very useful!