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: remove builder.entireApp #18028

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: remove builder.entireApp #18028

wants to merge 1 commit into from

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Sep 4, 2024

Description

The idea I had for #16471 (comment). Feel free to let me know too if this is a bad idea

What I'm thinking is that build.entireApp currently has a different meaning:

  1. If set by the user or plugins, the CLI is able to dynamically call build() or createBuilder()
  2. But from a programmatic API pov, frameworks can't do the same as they need to decide early on which API to use. Perhaps the framework could support both depending on whether the user sets the config, but they can't emulate the behaviour like the CLI.

With this PR, I removed the build.entireApp option entirely and let frameworks manage them themselves.

  1. If they only support --app, they should call createBuilder or ensure the vite CLI is called with --app
  2. If they only support the normal build API, they should call build() (same as before, not changed)
  3. If they support both, users can choose via --app, or frameworks can expose an option to pick between both.

Copy link

stackblitz bot commented Sep 4, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev
Copy link
Member

Let's discuss about this one after we merge the PR. We can point to main after that.

Base automatically changed from v6/environment-api to main September 4, 2024 09:27
@sapphi-red
Copy link
Member

I like this.

  1. ... ensure the vite CLI is called with --app

I have one question about this one. Is it easily possible to detect whether it was called with --app?

@sapphi-red sapphi-red added the feat: environment API Vite Environment API label Oct 3, 2024
@bluwy
Copy link
Member Author

bluwy commented Oct 3, 2024

I guess you could check process.argv.includes('--app') to check that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: environment API Vite Environment API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants