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

Use minified .js files from submodule in source-build #56864

Merged
merged 15 commits into from
Jul 22, 2024
Merged

Conversation

wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Jul 17, 2024

Fixes #56472. CC @dotnet/distro-maintainers

The build now uploads the minified .js files as a build artifact to make updating the submodule easier

@wtgodbe wtgodbe requested review from a team as code owners July 17, 2024 21:04
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jul 17, 2024
@wtgodbe wtgodbe requested a review from javiercn July 17, 2024 21:05
Copy link
Member

@MichaelSimons MichaelSimons left a comment

Choose a reason for hiding this comment

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

How is this going to work in the product source build. I was naively expecting BuildNodeJS to be defaulted to false when DotNetBuildSourceOnly is true. Also I see there are a few places that specify the following condition which I wasn't expecting would be true anymore:

Condition="'$(BuildNodeJS)' == 'true' and '$(DotNetBuildSourceOnly)' == 'true'"

@wtgodbe
Copy link
Member Author

wtgodbe commented Jul 17, 2024

How is this going to work in the product source build. I was naively expecting BuildNodeJS to be defaulted to false when DotNetBuildSourceOnly is true. Also I see there are a few places that specify the following condition which I wasn't expecting would be true anymore:

I was assuming we'd modify the product source build script to pass --no-build-nodejs like we used to. I prefer the broader/more generic condition of "Use the submodule if we're not building nodejs" to "use the submodule in source build"

@wtgodbe
Copy link
Member Author

wtgodbe commented Jul 17, 2024

Also I see there are a few places that specify the following condition which I wasn't expecting would be true anymore:

Condition="'$(BuildNodeJS)' == 'true' and '$(DotNetBuildSourceOnly)' == 'true'"

As things currently stand we could remove that the BuildNodeJs part of that, but keeping it is more future-proof for when we eventually turn node builds back on in source build

@wtgodbe
Copy link
Member Author

wtgodbe commented Jul 17, 2024

Although I can see the argument for I was naively expecting BuildNodeJS to be defaulted to false when DotNetBuildSourceOnly is true, so that everything is controlled from within this repo. Do you prefer that?

@MichaelSimons
Copy link
Member

Also I see there are a few places that specify the following condition which I wasn't expecting would be true anymore:

Condition="'$(BuildNodeJS)' == 'true' and '$(DotNetBuildSourceOnly)' == 'true'"

As things currently stand we could remove that the BuildNodeJs part of that, but keeping it is more future-proof for when we eventually turn node builds back on in source build

That would work. I generally prefer encapsulating this within the repo as then it just needs to be defined in one place as to what the source-build behavior is. Without this you are duplicating this in your source-build CI legs as well as the product source-build. Ideally build.sh -sb at the repo level would behave the same or as close to as possible to the product source-build.

@MichaelSimons
Copy link
Member

MichaelSimons commented Jul 17, 2024

Although I can see the argument for I was naively expecting BuildNodeJS to be defaulted to false when DotNetBuildSourceOnly is true, so that everything is controlled from within this repo. Do you prefer that?

Yes - I think our posts overlapped :)

@MichaelSimons
Copy link
Member

Also I see there are a few places that specify the following condition which I wasn't expecting would be true anymore:

Condition="'$(BuildNodeJS)' == 'true' and '$(DotNetBuildSourceOnly)' == 'true'"

As things currently stand we could remove that the BuildNodeJs part of that, but keeping it is more future-proof for when we eventually turn node builds back on in source build

I get your viewpoint. IMO it makes the current source confusing though as this condition would/should never happen.

@wtgodbe
Copy link
Member Author

wtgodbe commented Jul 17, 2024

Updated to set BuildNodeJs based off of DotNetBuildSourceOnly. I prefer keeping the redundant condition to make it less likely we'll forget/mess something up when we come back to this in 10

@omajid
Copy link
Member

omajid commented Jul 18, 2024

Do you plan to drop the Node-Externals submodule from aspnetcore once this is merged in? Or is that useful for non-source-build development/releases?

@wtgodbe
Copy link
Member Author

wtgodbe commented Jul 18, 2024

Do you plan to drop the Node-Externals submodule from aspnetcore once this is merged in? Or is that useful for non-source-build development/releases?

I'll defer to @javiercn on that one - I'd be fine going back to an online restore for the non-source build case, if there isn't a strong reason to keep Node-Externals

@javiercn
Copy link
Member

Do you plan to drop the Node-Externals submodule from aspnetcore once this is merged in? Or is that useful for non-source-build development/releases?

I'll defer to @javiercn on that one - I'd be fine going back to an online restore for the non-source build case, if there isn't a strong reason to keep Node-Externals

We can remove the cache submodule; it'll simplify things if we don't need it.

@wtgodbe wtgodbe merged commit bfe5471 into main Jul 22, 2024
26 checks passed
@wtgodbe wtgodbe deleted the wtgodbe/NPMSubmodule branch July 22, 2024 16:32
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-preview7 milestone Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Push minified .js files to submodule
4 participants