From 08e6645138efe4c79b47b25c8496175bc31a41da Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Fri, 14 Feb 2025 18:54:53 +0100 Subject: [PATCH] Modernize the A-Frame+framework answer (#5661) --- docs/introduction/faq.md | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/docs/introduction/faq.md b/docs/introduction/faq.md index dd21e1edb30..615777369a7 100644 --- a/docs/introduction/faq.md +++ b/docs/introduction/faq.md @@ -283,16 +283,34 @@ Read [*Where to Find Components*][finding] for more information. ## Does A-Frame support `X` library or framework? A-Frame is built on top of the DOM so most libraries and frameworks work -including: - -- [Vue.js](https://github.com/frederic-schwarz/aframe-vuejs-3dio) -- [Preact](https://github.com/aframevr/aframe-react#using-with-preact) -- [D3.js](http://blockbuilder.org/search#text=aframe) -- [React](https://github.com/aframevr/aframe-react) -- [Angular](https://stackoverflow.com/questions/46464103/various-errors-when-attempting-to-integrate-aframe-into-angular2-project-esp-wi) -- jQuery -- Ember.js -- Meteor +including jQuery, HTMX, React, SolidJS, Vue and Svelte. + +Some meta frameworks like TanStack Start and SolidStart hide the `index.html`, +so you may encounter issues adding additional script tags and template tags (for +Networked-Aframe). + +We advice you to use a template for your framework that still has an `index.html` +you can edit and render the UI to a specific div while keeping your `` +directly in `index.html`. That way you can easily follow A-Frame examples. +If you're creating a complex app with several routes and only specific routes +render an A-Frame scene, you'll want to add a router library and render +`` via a component in your framework. +Reactive frameworks like SolidJS and latest versions of Vue and Svelte are +well suited for this because they doesn't do unnecessary computation to check +if something needs to be updated. You can do that also in React but be sure to wrap +your Scene and UI components with React.memo and proper usage of useMemo/useCallback +or better enable the React Compiler that does this for you to avoid any performance +issues. + +The Vite build tool has templates for most of the popular frameworks. +You can follow the [Vite Guide](https://vite.dev/guide/) to create a new project +and then add the aframe `