Revert shim mode#297
Revert shim mode#297JordanMartinez wants to merge 1 commit intopurescript:masterfrom JordanMartinez:jam/revert-shim-mode
Conversation
|
Issues are very likely depending on browser and version. So, would be good to add that information. I'll have a look tomorrow and compare browsers in combination with |
|
Issue is on Firefox 103.0.1 on a Linux OS. I haven't checked on Chrome. |
Poor man's browserstack testing 😉Browsers
Example 1module HelloReactHooks.Main where
import Prelude
import Data.Maybe (Maybe(..))
import Effect (Effect)
import Effect.Exception (throw)
import React.Basic.DOM as R
import React.Basic.DOM.Client (createRoot, renderRoot)
import React.Basic.Hooks (Component, component)
import Web.DOM.NonElementParentNode (getElementById)
import Web.HTML (window)
import Web.HTML.HTMLDocument (toNonElementParentNode)
import Web.HTML.Window (document)
main :: Effect Unit
main = do
doc <- document =<< window
root <- getElementById "root" $ toNonElementParentNode doc
case root of
Nothing -> throw "Could not find root."
Just container -> do
reactRoot <- createRoot container
app <- mkApp
renderRoot reactRoot (app {})
mkApp :: Component {}
mkApp = do
component "App" \_ -> React.do
pure (R.text "Hello!")Example 2module Main where
import Prelude
import Data.Foldable (fold)
import Effect (Effect)
import TryPureScript (h1, h2, p, text, list, indent, link, render, code)
main :: Effect Unit
main = render $ h1 $ text "a"Example 1,
|
Solution (?)Updating
|
|
Is it worth opening a bug ticket and asking for a recommendation? |
|
@natefaubion Opened an issue guybedford/es-module-shims#324 (not the best description, but I'm running out of time) 😉 |
Version 1.5.12 is currently - including the latest bug fix 1.5.15 - the best version for the project where the examples work in all tested browsers. See this comment for more details: <purescript#297 (comment)>
Version 1.5.12 is currently - including the latest bug fix 1.5.15 - the best version for the project where the examples work in all tested browsers. See these discussion for more details: <purescript#297 (comment)> <guybedford/es-module-shims#324 (comment)>
|
I suggest to go with 1.5.12 for now: #298 |
UpdateI'm pretty sure the the issues with the versions 1.5.13 - 1.5.16 are related to this code. trypurescript/client/public/js/frame.js Lines 13 to 14 in 3cdcc8f The event listeners are initialized with There is also a Demo
screencast-2022-08-16_00.21.50.mp4
|
|
Can we serve a noop import map module and always import that first, if it fixes the double load issue? |
Tried importing a library of the ones in the importmap, didn't make a difference when testing with react examples (since they also have an import on top). I assume this is what you mean with "noop import map"?
|
* es-module-shims 1.5.12 Version 1.5.12 is currently - including the latest bug fix 1.5.15 - the best version for the project where the examples work in all tested browsers. See these discussion for more details: <#297 (comment)> <guybedford/es-module-shims#324 (comment)> * Comment and changelog entry
|
Superceded by #298 |

















Description of the change
Reverts #295. See #294 (comment) and I'm still waiting for Andy to confirm.
Checklist: