wails icon indicating copy to clipboard operation
wails copied to clipboard

Change the default port for frontend vite startup

Open Soonogo opened this issue 1 year ago • 4 comments

Description

Initialize the frontend vite template using the default port 5173 so that it changes to 9245

Type of change

Please delete options that are not relevant.

  • [x] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using wails doctor.

  • [ ] Windows
  • [x] macOS
  • [ ] Linux

System

Name MacOS
Version 14.1.2
ID 23B92
Branding Sonoma
Platform darwin
Architecture arm64
Apple Silicon true
CPU Apple M1 Pro
CPU Unknown
GPU Unknown
Memory Unknown

Build Environment

Wails CLI v3.0.0-alpha.6
Go Version go1.22.5
-buildmode exe
-compiler gc
CGO_CFLAGS
CGO_CPPFLAGS
CGO_CXXFLAGS
CGO_ENABLED 1
CGO_LDFLAGS
GOARCH arm64
GOOS darwin

Test Configuration

Please paste the output of wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.

Checklist:

  • [ ] I have updated website/src/pages/changelog.mdx with details of this PR
  • [ ] My code follows the general coding style of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features
    • Introduced a configurable server port (9245) for the Vite development server across various frontend frameworks (Preact, Qwik, React, Solid, Svelte, Vue).
    • This enhancement allows developers to avoid port conflicts and customize their local development environments more effectively.

These changes improve the flexibility and configurability of the development setup for users.

Soonogo avatar Sep 18 '24 02:09 Soonogo

Walkthrough

The changes involve updating the Vite configuration files across various frontend frameworks (Preact, Qwik, React, Solid, Svelte, Vue) to include a new server property that specifies the port number as 9245. This modification allows the development server to run on a designated port, enhancing the configurability of the development environment without altering existing functionalities.

Changes

Files Change Summary
v3/internal/templates/preact-ts/frontend/vite.config.ts Added server: { port: 9245 } to the configuration object.
v3/internal/templates/preact/frontend/vite.config.js Added server: { port: 9245 } to the configuration object.
v3/internal/templates/qwik-ts/frontend/vite.config.js Added server: { port: 9245 } to the configuration object.
v3/internal/templates/qwik/frontend/vite.config.js Added server: { port: 9245 } to the configuration object.
v3/internal/templates/react-swc-ts/frontend/vite.config.ts Added server: { port: 9245 } to the configuration object.
v3/internal/templates/react-ts/frontend/vite.config.ts Added server: { port: 9245 } to the configuration object.
v3/internal/templates/react/frontend/vite.config.js Added server: { port: 9245 } to the configuration object.
v3/internal/templates/solid-ts/frontend/vite.config.ts Added server: { port: 9245 } to the configuration object.
v3/internal/templates/solid/frontend/vite.config.js Added server: { port: 9245 } to the configuration object.
v3/internal/templates/svelte-ts/frontend/vite.config.ts Added server: { port: 9245 } to the configuration object.
v3/internal/templates/svelte/frontend/vite.config.js Added server: { port: 9245 } to the configuration object.
v3/internal/templates/vue-ts/frontend/vite.config.ts Added server: { port: 9245 } to the configuration object.
v3/internal/templates/vue/frontend/vite.config.js Added server: { port: 9245 } to the configuration object.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant ViteServer

    Developer->>ViteServer: Start Development Server
    ViteServer->>ViteServer: Check Configuration
    ViteServer->>ViteServer: Set Port to 9245
    ViteServer->>Developer: Server Running on Port 9245

Poem

🐇 In the land of code where bunnies play,
A port was set to brighten the day.
With Vite now tuned, oh what a sight,
Development flows with pure delight!
Hop, skip, and jump, let the server run,
On port 9245, we’ll have our fun! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example: -- I pushed a fix in commit <commit_id>, please review it. -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples: -- @coderabbitai generate unit testing code for this file. -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: -- @coderabbitai generate interesting stats about this repository and render them as a table. -- @coderabbitai read src/utils.ts and generate unit testing code. -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Sep 18 '24 02:09 coderabbitai[bot]

why?

leaanthony avatar Sep 18 '24 11:09 leaanthony

why?

https://github.com/wailsapp/wails/blob/v3-alpha/v3/internal/commands/dev.go#L12 I saw it written here that the boot port is 9245.

Soonogo avatar Sep 18 '24 15:09 Soonogo

We had set this in the taskfile but i don't hate moving it to the typescript config file but we should remove it from the dev task if using the config file instead.

atterpac avatar Oct 20 '24 03:10 atterpac

I'm going to close this because there's a chance someone will change it in the config and this won't be reflected in the taskfile (where it's needed) and cause confusion. Thanks for raising this PR though!

leaanthony avatar Nov 17 '24 10:11 leaanthony