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

Cleanup the bootstrapping file to make it easier to interpret #31

Merged
merged 14 commits into from
Jul 18, 2024

Conversation

mitchdav
Copy link
Contributor

This PR is largely a quality of life improvement, with the goal to make it easier for developers to interpret what is happening when a NativePHP application boots.

The real functionality of the package, which is the bootstrapping logic, has gone from over 100 lines down to just this:

  private async bootstrapApp(app: Electron.CrossProcessExports.App) {
    await app.whenReady();

    const config = await this.loadConfig();

    this.setDockIcon();
    this.setAppUserModelId(config);
    this.setDeepLinkHandler(config);
    this.startAutoUpdater(config);

    await this.startElectronApi();

    state.phpIni = await this.loadPhpIni();

    await this.startPhpApp();
    await this.startQueueWorker();
    await this.startWebsockets();
    this.startScheduler();

    await notifyLaravel("booted");
  }

I have split the changes up into separate and relatively isolated commits, to try and make it easier to follow.

I have bumped the menubar dependency, and added missing eslint dependencies that were preventing it from running.

I have removed the yarn.lock file, since it's unclear whether the package is using yarn or NPM.

If there are any changes you would like made before this could be approved, please let me know as I'm actively keen to contribute to NativePHP, and have a lot more ideas that will stem off of this PR.

mitchdav added a commit to laramates/forks-nativephp-electron-plugin that referenced this pull request Jun 28, 2024
@simonhamp
Copy link
Member

Thanks for this @mitchdav 🎉

@simonhamp simonhamp merged commit 4d105bd into NativePHP:main Jul 18, 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.

2 participants