A common trend and demand when creating Fragments is to have the possibility of using React or other frameworks to compose them. In its current state, neither the Fragments Toolkit nor the default Fragments Server capabilities support this option in an ergonomic way.
The goal of this epic is to add support for React fragments inside the Fragments Toolkit as an initial step towards a more general solution.
- React Fragments can be generated from the Fragments Toolkit
- Generated React fragments share the same React instance used in Liferay DXP
- Currently, fragments assume 1 JS file per fragment. This means no additional dependencies can be provided unless they're already present and being served through some other module.
- Providing any type of build-step will make the toolkit and UI fall out of sync. It won't be possible to easily edit fragments through the UI, as they'll be likely seeing transpiled code
- An understandable expectation of this is that any npm package and framework can be used to generate a fragment, and not just React or not just DXP modules. This might not be technically possible at the moment unless we use some alpha version of our tooling or drop the Acceptance Criteria about "reusing React" among fragments.