Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • May 11 2019 09:03

    janbiedermann on master

    update config for example and t… (compare)

  • May 11 2019 08:43

    janbiedermann on master

    further readme split up (compare)

  • May 11 2019 08:24

    janbiedermann on master

    fix travis config (compare)

  • May 11 2019 08:21

    janbiedermann on master

    fix links (compare)

  • May 11 2019 08:19

    janbiedermann on master

    exclude specs in fixtures clean up a bit corrections in readme and 8 more (compare)

  • May 11 2019 06:09

    janbiedermann on master

    update branch for compilation t… add es6_modules_string branch t… (compare)

  • May 10 2019 20:11

    janbiedermann on master

    let var be let (compare)

  • May 10 2019 18:42

    janbiedermann on master

    add test to execute ruby with c… (compare)

  • May 10 2019 17:18

    janbiedermann on master

    update doc for branches and PRs (compare)

  • May 10 2019 13:00

    janbiedermann on master

    keep test_apps folder for tests (compare)

  • May 10 2019 12:21

    janbiedermann on master

    simplify a bit spec add owl to dependencies test for 'public/assets' add te… and 2 more (compare)

  • May 09 2019 21:53
    francescoagati closed #2
  • May 09 2019 21:53
    francescoagati commented #2
  • May 09 2019 21:47
    janbiedermann commented #2
  • May 09 2019 16:02
    francescoagati opened #2
  • May 09 2019 16:01
    francescoagati starred isomorfeus/opal-webpack-loader
  • May 04 2019 02:19

    janbiedermann on master

    document file tree more accurat… (compare)

  • May 03 2019 16:30
  • May 03 2019 15:42

    janbiedermann on 0.7.3


  • May 03 2019 15:41

    janbiedermann on 0.7.3


Isomorfeus Robot
[slack] <janbiedermann> no key
Isomorfeus Robot
[slack] <Diego> cool, that works too
[slack] <janbiedermann> 👍
[slack] <Diego> finally found the method definition 🙂
Isomorfeus Robot

[slack] <frédéric ZINGG> @janbiedermann I'm trying to introduce the GSAP animation ibrary (https://greensock.com/) into the isomorfeus-website
On their Helloworls youtube video (https://www.youtube.com/watch?v=znVi89_gazE) they talk about : "React useEffect Hook"

I guess it is easy to transpose that sor of REACT useEffect hook with :isomorfeus: ?

Isomorfeus Robot

[slack] <janbiedermann> Sure it easy with :isomorfeus: , you will have to use a Func component, then you can use hooks. For the website, that would be LucidMaterial::Func. See also the extensive documentation here https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/lucid_func_component.md .
useEffect is a default React Hook and like any other React Hook you can just call it like:

some conversion of args is done, but i am not sure, ymmv, just complain if something does not work and i fix

Isomorfeus Robot
[slack] <frédéric ZINGG> @janbiedermann Just to understand and if you have time to answer:
I read this article about "React suspense" (fetching asynchronous data)
It looks to me all that sort of things is provided by default with :isomorfeus: , right, or I miss something ?
[slack] <janbiedermann> right
Isomorfeus Robot
[slack] <janbiedermann> it is still a experimental feature in react, so :isomorfeus: does not yet support it directly
But maybe, the implementation of preload in :isomorfeus: will depend on suspense or so. I better wait for the final release.
[slack] <frédéric ZINGG> ok, I read more about "React suspense" to understand what it does exaclty. tx.
[slack] <janbiedermann> its just a nice way to do asynchronous things together with render
Isomorfeus Robot
[slack] <frédéric ZINGG> I'm not sure, in this REACT pice of code (with useEffect hook.
The header const, is a props ?: https://files.slack.com/files-pri/THYSYJT0F-F011BFS0HV3/download/image.png
[slack] <janbiedermann> yeah that works a bit different for function components

[slack] <janbiedermann> usually you pass the ref prop and it will be filled with the ref, here the ref is created beforehand and then passed as props

so that ref provides access to h1

[slack] <janbiedermann> so first:
create ref
pass ref to useEffect
pass ref to h1

during render:
h1 will fill ref with value
useEffect will be called, can access h1 via ref

[slack] <janbiedermann> useEffect is a bit like componentDidMount
[slack] <frédéric ZINGG> ok, got it tx.
So do I also have to use something like `
to create the ref initial value ?
Isomorfeus Robot
[slack] <janbiedermann> yes, that should just work: React.create_ref
[slack] <janbiedermann> in ruby
[slack] <janbiedermann> you get however a ruby ref
[slack] <janbiedermann> so if you pass that on to h1 you need to use to_n
[slack] <janbiedermann> not sure, ymmv, maybe we need to work on that a bit
[slack] <janbiedermann> i see, just looked at the code, i intended the conversion to be automatic, but that may not be the case actually
[slack] <janbiedermann> you will see, i will fix then
Isomorfeus Robot
[slack] <frédéric ZINGG> @janbiedermann with useEffect , one thing I'm not sure to understand (must be because i'm not familiar with JS syntax):
in isomoerfeus_react source code I can see:
def use_effect(&block) `Opal.global.React.useEffect(function() { #{block.call} })` end
but in the REACT example we pass that (1 block + 1 array of ref):
[slack] <frédéric ZINGG> -------------------------
For now, my translation into ruby loos like that:
[slack] <frédéric ZINGG> but I got error:
react_devtools_backend.js:6 undefined method `props' for GsapRunAnimation
[slack] <janbiedermann> oh, i see, that looks like a bug in :isomorfeus: then, it should accept additional args
[slack] <janbiedermann> > Accepts a function that contains imperative, possibly effectful code.
Thats what react docs say, so thats how i implemented it.
[slack] <janbiedermann> Seems like there is more to the story
[slack] <frédéric ZINGG> should be something like that ?
def use_effect(*deps, &block) `Opal.global.React.useEffect(function() { #{block.call} }, deps)` end
Isomorfeus Robot
[slack] <janbiedermann> but the *deps also need to go somewhere, where?
[slack] <janbiedermann> oh, there
[slack] <janbiedermann> ok, right+

[slack] <frédéric ZINGG> ok, don't worry for now, I will play a bit in others way.

I will also clone and install the whole isomorfeus-react project, run test and everything, to be also able to update the code in the future.

Do you have an idea why I got :
react_devtools_backend.js:6 undefined method `props' for GsapRunAnimation

[slack] <janbiedermann> oh, you must use use_effect within render
Isomorfeus Robot
[slack] <janbiedermann> @frédéric ZINGG you can try i-react from master, use_effect allowing additional args
[slack] <janbiedermann> The hooks and render things and so on must all appear in or be called from one context, for :isomorfeus: thats the render block, in js its the function (= function component).
[slack] <frédéric ZINGG> ho, that was a quick update 👍
Will try, tx
[slack] <janbiedermann> no wait, wrong fix
[slack] <janbiedermann> misunderstanding
[slack] <janbiedermann> found it in the docs further down how it is supposed to be
[slack] <janbiedermann> now
Isomorfeus Robot
[slack] <frédéric ZINGG> @janbiedermann Hi,
If I want to use a local version of the isomorfeus-react repo, I declare this in my Gemfile:
gem 'isomorfeus-react', path: '/home/fcooker/rails/isomorfeus-projects/isomorfeus-react/ruby'
But how to declare allothers isomorfeus-* , one by one ?
[slack] <janbiedermann> Yes, clone the i-project repo, one by one add i-project/ruby/i-whatever.
Isomorfeus Robot
[slack] <frédéric ZINGG> in guru-isomorfeus @Tomasz Lemkowski declared that in the Gemfile:
gem 'isomorfeus-data', path: '/Users/leming/code/isomorfeus-project/ruby/isomorfeus-data' gem 'isomorfeus', '~> 1.0.0.zeta24'
Can I do that in my gemfile ? :
gem 'isomorfeus-react', path: '/home/fcooker/rails/isomorfeus-projects/isomorfeus-react/ruby' gem 'isomorfeus', '~> 1.0.0.zeta25'
or the isomorfeus-react in gem isomorfeus will be taken instead of my local version ?
[slack] <janbiedermann> nono, the gem isomorfeus just requires the ruby files. Now the order of the appearance of the gems in the gemfile determines the resolution of the ruby files. Even you have 'gem isomorfeus' in the gemfile, if you above that line, add a gem line for a specific isomorfeus gem, that one is taken, as it is resolved first.
[slack] <janbiedermann> So it does not matter where the Gem is located, but instead it is important the order of appearance in the gemfile.