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

Add -Svelte- and- Svelte with TypeScript Support- to Laravel Breeze #396

Closed
wants to merge 7 commits into from

Conversation

HichemTab-tech
Copy link

Description:

This pull request introduces Svelte and Svelte with TypeScript as new frontend options for Laravel Breeze. Previously, Laravel Breeze supported starter kits for Inertia with React and Vue. With this update, users can now choose Svelte for their Breeze starter applications.

Key Features:

  • Added Svelte as an option in the php artisan breeze:install command.
  • Included support for Svelte with TypeScript.
  • SSR (Server-Side Rendering) support, allowing users to run SSR easily without issues.
  • Users can start the Vite dev server and Laravel server with npm run start.
  • For SSR, users can start the server with npm run start-w-ssr.

Notes:

  • Ensure you have the latest version of Laravel Breeze installed.
  • Feedback and reports on any issues encountered during the integration process are welcome.

Previously, the Inertia Breeze starter kit only supported React and Vue. This commit introduces support for Svelte, thus expanding the options available for users of the starter kit. Extensive testing has been conducted to ensure that Svelte integrates seamlessly with the existing codebase and works properly.
The Svelte stack within the Inertia console install script has been updated to handle TypeScript options. This includes an updated package.json script including the "tsc" command, copying over important .ts and .d.ts files, and handling the SSR option correctly.
Adjusted code formatting, specifically by replacing double quotes with single quotes and standardizing the use of whitespace. The changes are made in several JavaScript files in the project to maintain consistency in the codebase.
This commit mainly includes minor syntax updates for improved code readability and consistency. It ensures every object within the code has a trailing comma to maintain a consistent syntax throughout the code base. Additionally, it also provides a minor correction for better indentation.
The Svelte stack within the Inertia console install script has been updated to handle TypeScript options. This includes an updated package.json script including the "tsc" command, copying over important .ts and .d.ts files, and handling the SSR option correctly.
The style of string quotes has been updated to single quotes in the vite.config.ssr.js file for the inertia-svelt-ts stub. The changes ensure consistency and conform to the standard JavaScript style guide.
The style of string quotes has been updated to single quotes in the vite.config.ssr.js file for the inertia-svelt-ts stub. The changes ensure consistency and conform to the standard JavaScript style guide.
@YounesAmalou
Copy link

Finally someone is working on this, This will be very helpful for me along with other Svelte developers

@aliresool621
Copy link

There is https://github.com/tapan288/breeze-svelte but it is outdated

@HichemTab-tech
Copy link
Author

Any progress here?

copy(__DIR__.'/../../stubs/inertia-common/jsconfig.json', base_path('jsconfig.json'));
copy(__DIR__.'/../../stubs/inertia-svelte/resources/js/app.js', resource_path('js/app.js'));
copy(__DIR__.'/../../stubs/inertia-svelte/resources/js/route.js', resource_path('js/route.js'));

Copy link

Choose a reason for hiding this comment

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

is bootstrap.js missing here?

Copy link
Author

Choose a reason for hiding this comment

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

no, the bootstrap file is created by laravel (composer create-project laravel/laravel) isn't it ?
the React/vue builder also doesn't implement the copy of bootstrap.js either :

copy(__DIR__.'/../../stubs/inertia-common/jsconfig.json', base_path('jsconfig.json'));

Copy link

Choose a reason for hiding this comment

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

true, I guess I have somehow deleted it, while trying out this pull request, because I manually copied the files.
Is there another way to install the breeze version from your branch directly? Something like composer require ... with the git branch?

Copy link
Author

@HichemTab-tech HichemTab-tech Aug 5, 2024

Choose a reason for hiding this comment

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

yes you can, check out the brach in your local, and rename the package name in composer to for example my-laravel/breeze after that add this code to your project composer (the laravel project you want to test on) :

      ....
      "repositories": [
	    {
	        "type": "path",
	        "url": "../path-to/breeze-branch"
	    }
	],
       "require": {
          ...
      },

after that in your project you can run composer require "my-laravel/breeze @dev"
and you can continue with php artisan breeze:install.

Copy link

Choose a reason for hiding this comment

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

Thanks for the explanation and the Svelte support!

Copy link
Author

Choose a reason for hiding this comment

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

You're welcome of course 😉, there are a lot of people among the svelte community who needs breeze with svelte support, but unfortunately the PR is closed for the moment.

@taylorotwell
Copy link
Member

Let's keep this as a community maintained package for now. 👍 Helps our maintenance burden.

@HichemTab-tech
Copy link
Author

Hi @taylorotwell ,

After reflecting on the major features and updates announced at the last Laracon, I believe it might be a good time to reconsider reopening this PR. The Svelte community has been growing rapidly, and many developers, including myself, would greatly appreciate having a Svelte Breeze starter kit as part of the official Laravel ecosystem.

I understand the need to manage maintenance burdens, but with the growing demand for Svelte and TypeScript support, I believe this addition would be highly beneficial for Laravel developers.

Thank you for considering this request, and I would be happy to assist in any way to make the integration as smooth as possible!

Best regards,
@HichemTab-tech

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.

None yet

5 participants