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

feat: support CRA-style proxy config #1674

Merged
merged 4 commits into from Apr 15, 2022
Merged

feat: support CRA-style proxy config #1674

merged 4 commits into from Apr 15, 2022

Conversation

rschristian
Copy link
Member

What kind of change does this PR introduce?

feature

Did you add tests for your changes?

Yes

Summary

Closes #1672

Some users copy/paste from CRA thinking their config will work out of the box. While that won't work everywhere, we can support simple cases like this pretty easily.

This implementation is pretty close to CRA's, though with a couple changes around the public folder and error handling.

I'm leaning towards not documenting this though, would rather people use their preact.config.js to better control this themselves. I think the defaults I've set are probably fine, but still not a "one size fits all" situation.

Does this PR introduce a breaking change?

Technically, it could be problematic if a user has a (previously) extraneous key sitting around in their package.json. Don't know if that counts and might be a bit of a reach.

@rschristian rschristian requested a review from a team as a code owner March 15, 2022 01:06
@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2022

🦋 Changeset detected

Latest commit: aa8a292

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR


return {
target,
logLevel: 'warn',
Copy link
Member Author

Choose a reason for hiding this comment

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

This will result in proxy issues appearing in the user's terminal like the following:

temp

I tend to think that's handy, but we certainly could disable it and leave those errors to the browser console too.

@rschristian rschristian changed the title Feat/proxy Feat: Support CRA-style proxy config Mar 15, 2022
@rschristian rschristian changed the title Feat: Support CRA-style proxy config feat: support CRA-style proxy config Mar 29, 2022
@ForsakenHarmony ForsakenHarmony enabled auto-merge (squash) April 12, 2022 12:30
@ForsakenHarmony ForsakenHarmony merged commit 0346549 into master Apr 15, 2022
@ForsakenHarmony ForsakenHarmony deleted the feat/proxy branch April 15, 2022 00:00
@preact-bot preact-bot mentioned this pull request Apr 15, 2022
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.

Feature: Support supplying proxy info from package.json
2 participants