robbieaverill

React form fields are usually designed for the cms only. It might work, but you’d need to BYO React app and probably use injector (decoupled POC for frontend available on request) in order to make it work

gened

Has anyone here tried using any ss4 react fields like Sortable upload field on the frontend?

flamerohr

I guess the difference is like parachuting to the bottom of the cliff than free-fall

🤔 (2) 👍 (1)
flamerohr

yes, but you can have a fallback for that case 🙂 "oops, sorry, our webapp disappeared" with a different wording

alt

yes and no - if the required files doesn't exist the thing isn't going to work anyway

flamerohr

👍 that looks fine, perhaps it could use a file_exists check

alt
  1. $manifest = json_decode(
  2. file_get_contents(dirname(__FILE__, 3) . "/client/build/asset-manifest.json"),
  3. true
  4. );
  5.  
  6. foreach ($manifest as $asset) {
  7. if (preg_match('/js$/', $asset)) {
  8. Requirements::javascript("/resources/events/client/build$asset");
  9. }
  10. }
flamerohr

the main problem I had with caching was the html could be referencing to old files which have been replaced with a different name

alt

sounds promising. I might have a play. My previous solution was to have a build:prod step that renamed all the files into known ones, but yeah it's not as nice for client-side caching

flamerohr

I don't have access to that anymore, but something to consider with the asset-manifest.json is client-side caching strategies and potentially fallover or force refresh