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

doc: Solid quickstart guide addition #564

Merged

Conversation

joshcirre
Copy link
Contributor

What does this PR do?

Using the existing quick starts as a guide, this PR adds a quick start for the Solid framework in the same format. Additionally, this PR adds a Solid logo to the aw-icon pack using the SVG from the Solid media assets.

Related PRs and Issues

No related PRs or Issues that I could see. 😊

Have you read the Contributing Guidelines on issues?

Yes, I have.

Vincent (Wen Yu) Ge and others added 30 commits January 18, 2024 03:00
Co-authored-by: Damodar Lohani <lohanidamodar@users.noreply.github.com>
Co-authored-by: Damodar Lohani <lohanidamodar@users.noreply.github.com>
Create The-evolution-of-team-Appwrite
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
Co-authored-by: Damodar Lohani <lohanidamodar@users.noreply.github.com>
@gewenyu99
Copy link
Contributor

I'm gonna get to this as soon as our release chaos is over <3 Thanks Josh!

Create a new file `src/lib/appwrite.js` and add the following code to it, replace `<YOUR_PROJECT_ID>` with your project ID.

```js
import { Client, Account} from 'appwrite';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { Client, Account} from 'appwrite';
import { Client, Account } from 'appwrite';

.setProject('<YOUR_PROJECT_ID>'); // Replace with your project ID

export const account = new Account(client);
export { ID } from 'appwrite';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to re-export ID, I'd say

Comment on lines +90 to +97
const [email, setEmail] = createSignal('');
const [password, setPassword] = createSignal('');
const [name, setName] = createSignal('');

async function login(email, password) {
await account.createEmailSession(email, password);
setLoggedInUser(await account.get());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use formData instead of signals? Would make code leaner overall.

setLoggedInUser(null);
}}
>
Logout
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This button should only be visible if there's a logged in user. Likewise, the form should only exist in case there's no logged in user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @TGlide

Thanks so much for these comments. I agree with them and will get working on the updates.

I didn't want to deviate too far from the React code which is why I made a lot of the decisions in the quick start, just with "Solid" syntax.

But if you're fine with adding those changes to this quick start and having it deviate a bit from the React version, I'm all for it!

Copy link
Contributor

@gewenyu99 gewenyu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take this forward! Need to add the icon to pink later :)

@gewenyu99
Copy link
Contributor

Hey @joshcirre The new conditional rendering logic is actually not reactive.

Should we do

<Show
  when={loggedIn()}
  fallback={
    // logout
}
>
    // login
</Show>

instead?

@gewenyu99 gewenyu99 changed the base branch from main to feat-solid-js March 10, 2024 17:14
@gewenyu99 gewenyu99 deleted the branch appwrite:feat-solid-js March 10, 2024 17:17
@gewenyu99 gewenyu99 closed this Mar 10, 2024
@gewenyu99 gewenyu99 reopened this Mar 10, 2024
@gewenyu99
Copy link
Contributor

Merging this into a branch to resolve merge request :)

@gewenyu99 gewenyu99 merged commit 55b416c into appwrite:feat-solid-js Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants