Fork me on GitHub
#fulcro
<
2018-06-25
>
tony.kay16:06:00

@baptiste-from-paris just remember that the iframe rendering in React is not the same as normal…the js lives in the main page, and it uses iframe like a canvas…so you’re not isolated with comm issues like in normal js apps.

baptiste-from-paris16:06:57

Ok thanks, it should be okay, I just want to use it for design purpose right now

wilkerlucio16:06:54

@baptiste-from-paris if you can use React 16, the portal support there might be easier/better

tony.kay18:06:22

portal doesn’t get you the css isolation, though..it’s just to mount to something in the DOM outside of your tree, right?

tony.kay18:06:51

I think your options are shadow-dom and iframe…and shadow-dom works well only in Chrome I think

wilkerlucio18:06:14

yeah, I'm just saying that before 16 the "portal way" is kinda hacky, the idea was portal + iframes

exit220:06:42

Probably a bit of an obscure question, but I’m trying to test some things and want to print out the headers that the server receives. I’m using the easy-server (make-fulcro-server). Any tips?

currentoor21:06:30

@njj a ring handler should be able to log the headers (and any other part of a request) right?

currentoor22:06:15

(defn log-stuff [handler]
  (fn [{:keys [header body] :as request}]
    (log headers body request)
    (handler request)))

(defrecord Logger [handler]
  component/Lifecycle
  (start [this]
    (let [old-pre-hook (fulcro.easy-server/get-pre-hook handler)
          new-hook     log-stuff]
          (fulcro.easy-server/set-pre-hook! handler new-hook))
      this)
    (stop [this] this))


(defn build-server
  [{:keys [config] :or {config "config/dev.edn"}}]
  (make-fulcro-server
    :parser-injections #{:config}
    :components {:logger (component/using (map->Logger {}) [:handler])}
    :config-path config
    :extra-routes {:routes   routes
                   :handlers handlers}))

👍 4