Giter VIP home page Giter VIP logo

Comments (8)

myitcv avatar myitcv commented on May 30, 2024

Thanks for raising this here @norunners - as I mentioned in the Slack channel, I will take a look when I get a minute and revert back.

from react.

norunners avatar norunners commented on May 30, 2024

Sounds good, I cut this issue for transparency in case other folks encounter the same issue.

from react.

myitcv avatar myitcv commented on May 30, 2024

This appears to be a GopherJS compiler issue... because after a cursory glance it doesn't even start running main...

from react.

myitcv avatar myitcv commented on May 30, 2024

@norunners this is actually related to gopherjs/gopherjs#414

For the two branches where you see things "failing" the code does not actually compile because of an import cycle. If you run go build in your main package you'll see something like:

import cycle not allowed
package github.com/norunners/helloreact
        imports github.com/norunners/helloreact/app
        imports github.com/norunners/helloreact/nav
        imports github.com/norunners/helloreact/app

gopherjs serve doesn't report the problem; like gopherjs build it should (but doesn't because of the linked issue).

Also, as far as updating components in different packages is concerned, I don't think there's any issues there, no least because the examples showcase does this repeatedly.

So I'd be tempted to close this issue... but will wait to hear back from you first.

from react.

norunners avatar norunners commented on May 30, 2024

Thank you for investigating this, if this is the case we can put an extra gotcha in the docs about circular dependencies.

Tonight, I'll do a quick proof of concept of putting the callback behavior interface in a third "share" Go package to verify that is the root cause.

from react.

myitcv avatar myitcv commented on May 30, 2024

Thank you for investigating this, if this is the case we can put an extra gotcha in the docs about circular dependencies.

No problem.

Sorry if I wasn't clear in my previous message. It's not a gotcha (with the React bindings); it's a bug in GopherJS that the circular dependency isn't reported to you as an error in your code.

from react.

norunners avatar norunners commented on May 30, 2024

Works as expected! As you mentioned in the related issue, this is something gopherjs serve should surface as an error. Feel free to close this issue.

from react.

myitcv avatar myitcv commented on May 30, 2024

Great. Closing this issue therefore

from react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.