Git Product home page Git Product logo

sdk's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdk's Issues

Incorrect examples of @8base/forms

Describe the bug
There are issues in the code of "Form with FieldArray" example.

To Reproduce

render(
  <Form type="CREATE" tableSchema={TABLE_SCHEMA} onSubmit={onSubmit}>
    {
      ({ handleSubmit }) => (
        <form onSubmit={ handleSubmit }>
          <Field name="firstName" component="input" />
          <Field name="lastName" component="input" />
          <Field name="age" component="input" />
          <FieldArray name="fieldArray">
            {
              ({ fields }) => (
                <React.Fragment>
                  fields.map((name, index) => (
                    <React.Fragment>
                      <Field key={ name } name={ name } component="input" />
                      <button onClick={ () => props.fields.remove(index) }>Remove</button>
                    </React.Fragment>
                  ))
                  <button onClick={ fields.push('New Field Array Item') }>Add</button>
                </React.Fragment>
              )
            }
          </FieldArray>
          <button type="submit">Create Client</button>
        </form>
      )
    }
  </Form>
, document.getElementById('root'));

Expected behavior

  • Key should be on <React.Fragment />
  • <button onClick={ fields.push('New Field Array Item') }>Add</button> should be <button onClick={ () => fields.push('New Field Array Item') }>Add</button>. Otherwise there will be an infinite loop.
  • mising curly braces ({}) around fields.map...
  • <button onClick={ () => props.fields.remove(index) }>Remove</button> should be without props

Ability to use EightBaseProvide with API token

Is your feature request related to a problem? Please describe.
We should add the ability to use EightBaseAppProvider with an API token instead of Auth0

Describe the solution you'd like
In a similar fashion as Auth0WebAuthClient we can create APITokenClient that will allow to authenticate via a token.

Module breaks on Rollup/Vite

Describe the bug
When using the auth module on Nuxt 3, which runs on Rollup and Vite, the following error will come up:

Uncaught (in promise) TypeError: (0 , import_defineToJSON.default) is not a function
    at node_modules/graphql/language/parser.mjs (@8base_auth.js:17154:37)
    at __init (chunk-6DBBYCL5.js:16:56)
    at node_modules/graphql-prettier/lib/index.js (@8base_auth.js:17728:20)
    at __require2 (chunk-6DBBYCL5.js:19:50)
    at node_modules/@8base/utils/dist/queryGenerators/queryGenerators.js (@8base_auth.js:18088:46)
    at __require2 (chunk-6DBBYCL5.js:19:50)
    at node_modules/@8base/utils/dist/queryGenerators/index.js (@8base_auth.js:18370:18)
    at __require2 (chunk-6DBBYCL5.js:19:50)
    at node_modules/@8base/utils/dist/index.js (@8base_auth.js:18517:18)
    at __require2 (chunk-6DBBYCL5.js:19:50)

To Reproduce
Clone this repo, install dependencies and run npm run dev: https://github.com/jerryjappinen/8base-auth-parser

The dev server build will break, and app will not mount (empty screen).

Expected behavior
App should build without errors and print a list of authentication strategies imported from the module.

Screenshots
image

Desktop
macOS, Chrome

Additional context
More discussion here: https://community.8base.com/t/cant-get-8base-auth-to-work/861/5

Remove Auth configuration from EightBaseAppProvider and inject Auth manually instead

Is your feature request related to a problem? Please describe.
Currently EightBaseAppProvider encapsulates specific Auth implementation making it impossible to switch to a different authentication method. For example, to not use Auth0 or use Auth0 for react-native.

Describe the solution you'd like
Instead, we should configure Auth separately and inject it into EightBaseAppProvider through props. Similar to how Apollo injects client into AppProvider.

Additional context
Auth should provide a common interface for an authentication provider, such that it is possible to implement different providers such as a custom one or react-native version of Auth0.

Add Hooks API

Is your feature request related to a problem? Please describe.
I would prefer to use hooks vs HoC, can you offer hook based APIs?

Describe the solution you'd like
The availability of hooks for auth, etc.

Describe alternatives you've considered
I've written a small implementation for myself using hooks locally, but I think more people would benefit if this library was updated.

Additional context
n/a

Allow using EightBaseAppProvider without auth

Describe the bug
It is impossible to run EightBaseAppProvider in unauthenticated mode without passing authClient

To Reproduce
Initialize EightBaseAppClient without passing authClient

Expected behavior
It should be possible to run EightBaseAppProvider without passing the authClient. This is useful for cases where authentication is not required.

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.