Skip to content

Always fully build Components.Server.csproj #9421

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

Merged
merged 3 commits into from
Apr 17, 2019
Merged

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Apr 16, 2019

Fixes #9402

@@ -130,6 +130,11 @@ try {
& $dotnet run -p "$repoRoot/eng/tools/BaselineGenerator/"
}

Write-Host "Re-generating blazor files"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SteveSandersonMS we're looking at a solution where the the blazor files are checked in to the source and we add a check, the same way we verify ref assemblies are up to date, to ensure these files are up to date. It is slightly ugly to check in the files, but it does make reasoning about these files a bit easier.

What do you think?

@pranavkm pranavkm force-pushed the prkrishn/embed-always branch from b2c21f0 to 8e4af56 Compare April 16, 2019 18:20
@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Apr 16, 2019
<!-- We need .Browser.JS to build first so we can embed its .js output -->
<EmbeddedResource Include="..\..\Browser.JS\src\dist\blazor.server.js" LogicalName="_framework\%(Filename)%(Extension)" />
<EmbeddedResource Include="..\..\Browser.JS\dist\$(Configuration)\blazor.server.js" LogicalName="_framework\%(Filename)%(Extension)" />
Copy link
Member

Choose a reason for hiding this comment

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

@pranavkm Is this the fix for #9402 (comment)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. See #9421 (comment) - it essentially checks in the js files and adds a check to ensure that the build isn't broken. I wanted to verify things work correctly and that the code check correctly identifies if we failed to update it before I made this non-draft.

Copy link
Contributor

Choose a reason for hiding this comment

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

I support this approach. It's also a workaround for needing to make NodeJS a prerequiste to building aspnetcore on all platforms we build. In some environments, we don't have NodeJS and it might be difficult to add as a new pre-req.

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

WRT the Mac OSX blazor.server.js fix

<!--
Temporary until we move the prerendering APIs into this assembly.
-->
<Reference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@javiercn I tried removing this and it worked. So I'm guessing this was left over from the pre-rendering work.

<!-- We need .Browser.JS to build first so we can embed its .js output -->
<EmbeddedResource Include="..\..\Browser.JS\src\dist\blazor.server.js" LogicalName="_framework\%(Filename)%(Extension)" />
<EmbeddedResource Include="..\..\Browser.JS\dist\$(Configuration)\blazor.server.js" LogicalName="_framework\%(Filename)%(Extension)" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I support this approach. It's also a workaround for needing to make NodeJS a prerequiste to building aspnetcore on all platforms we build. In some environments, we don't have NodeJS and it might be difficult to add as a new pre-req.

* Use pre-built js files instead of building on the fly
* Use a sourcemap file for Debug. .gitignore sourcemap files
* Install nodejs on CodeCheck agents
@pranavkm pranavkm force-pushed the prkrishn/embed-always branch from 87d288b to 5368bb5 Compare April 17, 2019 00:34
@@ -3,13 +3,13 @@ const webpack = require('webpack');

module.exports = (env, args) => ({
resolve: { extensions: ['.ts', '.js'] },
devtool: args.mode === 'development' ? 'inline-source-map' : 'none',
devtool: args.mode === 'development' ? 'source-map' : 'none',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

inline-source-map is problematic because I'd like to check in the Debug js too. Putting it in a separate source-map which is gitignored works reasonably well. If you happen to need it, you build Browser.JS locally and you get source maps. Does this seem reasonable @javiercn \ @SteveSandersonMS ?

@pranavkm pranavkm marked this pull request as ready for review April 17, 2019 15:45
@pranavkm pranavkm requested review from SteveSandersonMS and a team as code owners April 17, 2019 15:45
@pranavkm pranavkm merged commit 56e2080 into master Apr 17, 2019
@pranavkm pranavkm deleted the prkrishn/embed-always branch April 17, 2019 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blazor server side: dotnet run fails with InvalidOperationException on MacOS
4 participants