GithubHelp home page GithubHelp logo

Comments (6)

rickyvetter avatar rickyvetter commented on May 29, 2024 3

Yeah agree that removing annotations in implementation is probably the easiest and most idiomatic way to do this.

from reason-apollo.

yawaramin avatar yawaramin commented on May 29, 2024 2

The issue was discussed in Discord and, as I understand it, this compile error is happening because of a ReasonReact JSX bugfix that was shipped in bs-platform 7.1.0. This was fixing an unsoundness issue (cf. @rickyvetter) and was considered important to get out the door.

The compile error pasted above comes from this piece of code:

Personally, my recommendation would be to get rid of type annotations from values and functions in implementation files. I consider this to be more idiomatic anyway. Plus it should work across both BuckleScript 7.1.0 and earlier. It would look like this:

// src/graphql-types/ReasonApolloMutation.re

[@react.component]
  let make =
      (
        ~variables=?,
        ~onError=?,
        ~onCompleted=?,
        ~children,
      ) => ...

I realize people will need type annotations–they can be put in the corresponding interface files, e.g.

// src/graphql-types/ReasonApolloMutation.rei

[@react.component]
let make:
      (
        ~variables: Js.Json.t=?, // No option needed! :-)
        ~onError: apolloError => unit=?,
        ~onCompleted: unit => unit=?,
        ~children: (apolloMutation, renderPropObj) => React.element,
      ) =>
    React.element;

And so on.

cc @sgrove @idkjs

from reason-apollo.

idkjs avatar idkjs commented on May 29, 2024

Where are we fixing this? Is on https://github.com/idkjs/reason-apollo/tree/bs_platform_7? Or master?

from reason-apollo.

yawaramin avatar yawaramin commented on May 29, 2024

@idkjs in this repo itself. See my comment above (code examples have file names).

from reason-apollo.

idkjs avatar idkjs commented on May 29, 2024

I guess master since its on bs-platform 7 already.

from reason-apollo.

yawaramin avatar yawaramin commented on May 29, 2024

Oh sorry you were asking about the branch. I would say master.

from reason-apollo.

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.