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

feat: Generate sharable link for code-explorer #24

Closed
wants to merge 16 commits into from

Conversation

amareshsm
Copy link
Member

@amareshsm amareshsm commented Aug 13, 2024

Prerequisites checklist

What is the purpose of this pull request?

What changes did you make? (Give an overview)

Generate a shareable link for Code Explorer, similar to how ESLint Playground generates shareable links

Note: Zustand natively offers functions to update the application state and automatically map it to the URL hash.

Related Issues

Is there anything you'd like reviewers to focus on?

The changes have been implemented on top #22 this PR. Functionality-wise, it's complete; I’m now working on reducing redundant code.

@@ -53,62 +54,65 @@ type ExplorerState = {

};

const createSetter = <T extends keyof ExplorerState>(
Copy link
Member

@harish-sethuraman harish-sethuraman Aug 14, 2024

Choose a reason for hiding this comment

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

This way is in efficient. Zustand has a better way with persist middleware to store data in localstorage. https://docs.pmnd.rs/zustand/integrations/persisting-store-data We can use that instead of manually maintaining all of these operations? my bad its already there

@amareshsm amareshsm changed the base branch from update_code_examples to main August 15, 2024 19:21
Copy link

netlify bot commented Aug 15, 2024

Deploy Preview for eslint-code-explorer ready!

Name Link
🔨 Latest commit 449d6dd
🔍 Latest deploy log https://app.netlify.com/sites/eslint-code-explorer/deploys/66c4ca23b011bd0008cffcc9
😎 Deploy Preview https://deploy-preview-24--eslint-code-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@amareshsm amareshsm marked this pull request as ready for review August 19, 2024 20:16
@amareshsm amareshsm changed the title feat: [WIP] Generate sharable link for code-explorer feat: Generate sharable link for code-explorer Aug 19, 2024
@nzakas
Copy link
Member

nzakas commented Aug 22, 2024

Should we wait until #30 is merged before reviewing this?

@amareshsm
Copy link
Member Author

Should we wait until #30 is merged before reviewing this?

No need to wait for #30 these PR changes are only related to the Zustand store.

}),
persist(
set => ({
tool: "ast",
Copy link
Member

Choose a reason for hiding this comment

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

Assuming we are going to be adding many more languages, does it make sense to group language-related settings together rather than having them all be separate, top-level settings?

(Note: I have no idea how any of this works, so I don't have a strong opinion, just curious.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we'll group the options based on the language. I'll update the PR accordingly.

Copy link
Member Author

Choose a reason for hiding this comment

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

This change has been made as part of this pr.

@amareshsm amareshsm marked this pull request as draft August 28, 2024 18:40
@amareshsm
Copy link
Member Author

Closing this in favour of #49

@amareshsm amareshsm closed this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants