Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New extension: Supabase save state #1069

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

Description

This extension adds support to save the game state to Supabase.

How to use the extension

Use the login or signup actions to log in the user. When the user is logged in, you can use the Get data and Save data actions.

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Community (Unreviewed)

Example file

game.zip

Extension file

SupabaseSaveState.zip

@github-actions github-actions bot requested a review from a team as a code owner October 26, 2023 10:09
@github-actions github-actions bot added the ✨ New extension A new extension label Oct 26, 2023
@github-actions github-actions bot mentioned this pull request Oct 26, 2023
3 tasks
@romw314
Copy link

romw314 commented Oct 26, 2023

The tests failed because I use GDJS.__SupabaseSaveState. I need to store the Supabase client somewhere. This extension is still experimental, but Supabase is the best Firebase alternative. Since I'm creating this extension for me and for my family, I'm happy to share it with the community.

@romw314
Copy link

romw314 commented Oct 26, 2023

#1070 needs to be merged before merging this.

@VegeTato VegeTato added the 👨‍👩‍👧‍👦 Community extension An extension submission to be merged ASAP with a lightweight review. label Dec 1, 2023
@romw314
Copy link

romw314 commented Jan 4, 2024

#1070 is ready

@D8H
Copy link
Contributor

D8H commented Jan 4, 2024

Thank you for submitting an extension.

Can you use a version of the library that is not minified? Because, otherwise, reviewers can't check the code for ill intents.

@romw314
Copy link

romw314 commented Jan 4, 2024

!update SupabaseSaveState.zip

Copy link
Contributor Author

github-actions bot commented Jan 4, 2024

Can't update the extension, as it doesn't pass automatic tests:


❌ 1 Error found in extension 'SupabaseSaveState':

  ⟶ ❌ [JavaScript disallowed properties]: Found disallowed properties in extension 'SupabaseSaveState':
{
  allowedProperties: [
    'makeUuid',           'rgbToHex',
    'rgbOrHexToRGBColor', 'rgbToHexNumber',
    'hexNumberToRGB',     'hexToRGBColor',
    'copyArray',          'staticArray',
    'staticArray2',       'staticObject',
    'toDegrees',          'toRad',
    'random',             'randomFloat',
    'randomFloatInRange', 'randomInRange',
    'randomWithStep',     'evtTools',
    'Variable',           'RuntimeObject',
    'Logger'
  ],
  disallowedProperty: '__SupabaseSaveState',
  objectName: 'gdjs'
}
{
  allowedProperties: [
    'keys',
    'create',
    'assign',
    'is',
    'values',
    'entries',
    'fromEntries',
    'defineProperty',
    'getOwnPropertyNames',
    'getOwnPropertyDescriptor',
    'defineProperties',
    'prototype'
  ],
  disallowedProperty: 'getOwnPropertySymbols',
  objectName: 'Object'
}
{
  allowedProperties: [
    'keys',
    'create',
    'assign',
    'is',
    'values',
    'entries',
    'fromEntries',
    'defineProperty',
    'getOwnPropertyNames',
    'getOwnPropertyDescriptor',
    'defineProperties',
    'prototype'
  ],
  disallowedProperty: 'getPrototypeOf',
  objectName: 'Object'
}


❌ 1 Error found in extensions - please fix it before generating the registry.

@romw314
Copy link

romw314 commented Jan 4, 2024

Hi, @D8H, as you can see, in the comment from GitHub Actions, I need you to merge #1070 before updating the extension. Then, I'll retry to update it.

@github-actions github-actions bot requested a review from a team as a code owner January 4, 2024 14:55
@romw314
Copy link

romw314 commented Jan 4, 2024

!update SupabaseSaveState.zip

Copy link
Contributor Author

github-actions bot commented Jan 4, 2024

✅ Successfully updated the extension.

@romw314
Copy link

romw314 commented Jan 4, 2024

Added with the client library that is not minified.

This PR is ready to merge after you review it.

@romw314
Copy link

romw314 commented Jan 11, 2024

Any news about this? It's in review or it's awaiting review? It's the Extension Review project OK? There are no extensions marked as In Review.

@D8H
Copy link
Contributor

D8H commented Jan 13, 2024

The example project seems not to be up to date. Please attach a new one with the latest version.

@romw314
Copy link

romw314 commented May 24, 2024

Updated example:
Click, Click!.zip

@D8H, Supabase's free tier pauses project after one week so if the Supabase project is down, tell me and I'll activate it.

@tristanbob
Copy link
Contributor

tristanbob commented May 24, 2024

@romw314 Thanks for this contribution! I am a Supabase user and would be interested in trying this in my games. I have a few questions:

  1. What version of the Supabase SDK is included? (Perhaps document this in the extension somewhere)

  2. Would anonymous logins be useful in games? This is a relatively new feature for Supabase. Most players don't like setting up accounts, so this could make a frictionless cloud save (with the risk that they will lose access if they change browsers or delete browser cache)
    https://supabase.com/docs/guides/auth/auth-anonymous

@D8H
Copy link
Contributor

D8H commented May 26, 2024

Thank you for submitting an extension.

I have a few suggestions:

  • Supabase is not dedicated to game saves. As there will only be 1 extension for Supabase, it should be rephrased in a more general manner.
  • The extension should not make any pop-up. Errors should be given back to extension users to let them handle the errors as they want.

@romw314
Copy link

romw314 commented May 29, 2024

@tristanbob, @D8H, I'll try to meet your needs with my extension.

Supabase is not dedicated to game saves. As there will only be 1 extension for Supabase, it should be rephrased in a more general manner.

I can rename the extension to "Supabase" only, but it seems very hard for me to rephrase it in a more general manner.

The extension should not make any pop-up. Errors should be given back to extension users to let them handle the errors as they want.

I'll try to fix this.

@EyadMahm0ud
Copy link

Hello @romw314, sorry for pinging.
I have tried to use the extension early. It signs in properly but this pops up when I save data and nothing gets saved...
image

@romw314
Copy link

romw314 commented Aug 11, 2024

Maybe you have not set up your database properly, @EyadMahm0ud

@EyadMahm0ud
Copy link

@romw314
I read the help page for the extension and it turns out that I need to apply a specific configuration.
I might add some functions (like filtering and OTP authentication) with some flexibility so that there is no need for configuration.
I might fulfill D8H demands and upload the extension here too.

@romw314
Copy link

romw314 commented Sep 10, 2024

So do it, please, @EyadMahm0ud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👨‍👩‍👧‍👦 Community extension An extension submission to be merged ASAP with a lightweight review. ✨ New extension A new extension
Projects
Status: Needs changes
Development

Successfully merging this pull request may close these issues.

5 participants