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

fix: improve developing experience with Electron on Windows #796

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

cesaryuan
Copy link
Contributor

Description

Currently, it is very inconvenient to develop with Electron on windows:
When developers run pnpm run dev in terminal, an electron instance will be started.
Then it alerts developer to login. After logging in in the opened browser, we are required to open follow-dev://auth?token=xxx in the browser to continue.

That's the problem. A separate electron instance will be started instead of using the already running one.
For the second instance, it does not have the environment variable needed to launch (including ELECTRON_RENDERER_URL and those in .env), which is loaded by the first instance but not passed to the second instance.

The essential question we need to address is why the second instance was initiated (why requestSingleInstanceLock not work).

So that's why. The second instance is launched by the system and not having the NODE_ENV configured to "development".
And it will make the second instance's appData directory to be Follow instead of Follow (dev). Different appData directory means different instances.

So the solution is to check if the process is started with follow-dev: and set the NODE_ENV for it.

And now, we can develop with Electron on Windows very happily. 😁 (Remember set VITE_API_URL to https://api.follow.is in .env file)

Linked Issues

#672, #778

Additional context

Copy link

vercel bot commented Oct 8, 2024

@cesaryuan is attempting to deploy a commit to the RSS3 Team on Vercel.

A member of the Team first needs to authorize it.

@cesaryuan cesaryuan changed the title fix: improve experience with electron on Windows fix: improve experience with Electron on Windows Oct 8, 2024
@cesaryuan cesaryuan changed the title fix: improve experience with Electron on Windows fix: improve developing experience with Electron on Windows Oct 8, 2024
@Innei Innei merged commit 3416329 into RSSNext:dev Oct 8, 2024
3 of 4 checks passed
@zxhd863943427
Copy link

great! that's what I want! thank very much!

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.

3 participants