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

refactor(server): move publicPath configuration from CLI to API #2098

Closed

Conversation

knagaitsev
Copy link
Collaborator

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Not yet

Motivation / Use-Case

This is part of the effort to move configuration changes out of the CLI and into the API. The goal here is to set the publicPath option in the API if it is not already set.

Breaking Changes

No breaking changes on CLI.

On API, if a user was not specifying a publicPath in the past, it would not be set. Now, it will be set based on compiler.options.output.publicPath, if it exists. Should this PR be on next for this reason?

Additional Info

@knagaitsev knagaitsev changed the title refactor(server): move public path changing out of cli refactor(server): move publicPath configuration from CLI to API Jul 4, 2019
@codecov
Copy link

codecov bot commented Jul 4, 2019

Codecov Report

Merging #2098 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2098      +/-   ##
==========================================
+ Coverage   94.46%   94.49%   +0.03%     
==========================================
  Files          32       33       +1     
  Lines        1210     1218       +8     
  Branches      334      337       +3     
==========================================
+ Hits         1143     1151       +8     
  Misses         65       65              
  Partials        2        2
Impacted Files Coverage Δ
lib/utils/createConfig.js 90.56% <ø> (-0.59%) ⬇️
lib/Server.js 96.94% <100%> (+0.01%) ⬆️
lib/utils/setPublicPath.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa31d87...a1c044d. Read the comment docs.

@@ -58,6 +59,8 @@ class Server {
this.compiler = compiler;
this.options = options;

setPublicPath(compiler, options);
Copy link
Member

Choose a reason for hiding this comment

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

Let's move this in updateCompiler

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@evilebottnawi this is not altering the compiler at all though, only using the compiler's option data to set devServer.publicPath. But if you still think it should be there I have no strong opinion.

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.

I am afraid what is breaking change

/cc @hiroppy

@hiroppy
Copy link
Member

hiroppy commented Jul 4, 2019

This pr should be changed to the next.

@knagaitsev knagaitsev changed the base branch from master to next July 4, 2019 18:35
@knagaitsev knagaitsev changed the base branch from next to master July 4, 2019 18:37
@knagaitsev
Copy link
Collaborator Author

I think I will just open new PR on next

@knagaitsev
Copy link
Collaborator Author

Closing in favor of #2099

@knagaitsev knagaitsev closed this Jul 4, 2019
@knagaitsev knagaitsev added the gsoc Google Summer of Code label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc Google Summer of Code need tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants