8base / sdk Goto Github PK
View Code? Open in Web Editor NEW🧰 8base JavaScript SDK implements client-side libraries used by apps using 8base.
Home Page: https://docs.8base.com/development-tools/sdk
🧰 8base JavaScript SDK implements client-side libraries used by apps using 8base.
Home Page: https://docs.8base.com/development-tools/sdk
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
<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.fields.map...
<button onClick={ () => props.fields.remove(index) }>Remove</button>
should be without props
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.
Use Auth0 client
const auth = Auth.createClient({ strategy: AUTH_STRATEGIES.WEB_AUTH0 });
// and call getAuthorizedData() on any page in the application in the hash of which there is no token
auth.getAuthorizedData();
expected result - no error
related issue: auth0/jwt-decode#65 (comment)
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.
Desktop
macOS, Chrome
Additional context
More discussion here: https://community.8base.com/t/cant-get-8base-auth-to-work/861/5
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.