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: Add historyApiFallback option #930

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

drudrum
Copy link

@drudrum drudrum commented Jun 2, 2021

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

Add useful option historyApiFallback.
Ability to use React Router5
like as webpackDevServer https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback

Breaking Changes

Additional Info

@drudrum
Copy link
Author

drudrum commented Jun 2, 2021

I add new branch and write right commit message

original pull request #922

@codecov
Copy link

codecov bot commented Jun 2, 2021

Codecov Report

Patch coverage: 100.00% and project coverage change: -2.51 ⚠️

Comparison is base (de760f6) 97.34% compared to head (bf596f6) 94.84%.

❗ Current head bf596f6 differs from pull request most recent head 65bb7e2. Consider uploading reports for the commit 65bb7e2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #930      +/-   ##
==========================================
- Coverage   97.34%   94.84%   -2.51%     
==========================================
  Files           9       10       +1     
  Lines         377      291      -86     
  Branches      112      103       -9     
==========================================
- Hits          367      276      -91     
- Misses          9       13       +4     
- Partials        1        2       +1     
Impacted Files Coverage Δ
src/utils/getFilenameFromUrl.js 97.72% <100.00%> (-0.52%) ⬇️

... and 10 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

snitin315
snitin315 previously approved these changes Jun 7, 2021
Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM

test/validation-options.test.js Show resolved Hide resolved
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

One small note

snitin315
snitin315 previously approved these changes Jun 10, 2021
@drudrum
Copy link
Author

drudrum commented Jun 10, 2021

I am sorry. I was make commit via vs code.

@alexander-akait
Copy link
Member

alexander-akait commented Jun 10, 2021

Don't worry, I will squash them before merge

@drudrum
Copy link
Author

drudrum commented Jul 28, 2021

@hiroppy something wrong?

@alexander-akait
Copy link
Member

All fine, I will finish dev server stable release and will improve dev middleware, more caches, features, less build time and other

Comment on lines 98 to 103
if (
options.historyApiFallback &&
!context.outputFileSystem.existsSync(filename)
) {
filename = path.join(outputPath);
}
Copy link
Author

Choose a reason for hiding this comment

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

When pathname is empty, with this option we will also try find index.html at correct folder

Copy link
Author

Choose a reason for hiding this comment

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

@alexander-akait This PR.

@drudrum drudrum mentioned this pull request Mar 12, 2023
5 tasks
@drudrum drudrum dismissed stale reviews from snitin315 and alexander-akait via 5deca8e March 12, 2023 21:07
@alexander-akait
Copy link
Member

I still have light feeling that we do something wrong because logic historyApiFallback is more complex than this, to unstand your can you provide github repo with example of usage this feature, so I can undestand how it can be used, thank you and sorry for delay again

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.

3 participants