René's URL Explorer Experiment


Title: Support Webpack HMR with non-root base URLs · Issue #488 · aspnet/JavaScriptServices · GitHub

Open Graph Title: Support Webpack HMR with non-root base URLs · Issue #488 · aspnet/JavaScriptServices

X Title: Support Webpack HMR with non-root base URLs · Issue #488 · aspnet/JavaScriptServices

Description: Since Webpack dev middleware is a dev-time-only (not production) feature, this will only affect people whose development environment is set up to host their site at a non-root URL (e.g., http://localhost:port/somedir). This is a very unu...

Open Graph Description: Since Webpack dev middleware is a dev-time-only (not production) feature, this will only affect people whose development environment is set up to host their site at a non-root URL (e.g., http://loc...

X Description: Since Webpack dev middleware is a dev-time-only (not production) feature, this will only affect people whose development environment is set up to host their site at a non-root URL (e.g., http://loc...

Opengraph URL: https://github.com/aspnet/JavaScriptServices/issues/488

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support Webpack HMR with non-root base URLs","articleBody":"Since Webpack dev middleware is a dev-time-only (not production) feature, this will only affect people whose development environment is set up to host their site at a non-root URL (e.g., http://localhost:port/somedir). This is a very unusual configuration, and in fact is quite hard to set up even on its own as you most likely need some external reverse proxy (e.g., nginx) on your development machine to make that happen. Very few people will do this.\r\n\r\nNow, for people who do that, HMR won't work out-of-the-box right now, because the Webpack configuration doesn't know what directory you're hosting your app inside.\r\n\r\nThe PathBase information doesn't exist until runtime inside the context of a specific HTTP request where `PathBase` has been populated by [UsePathBaseMiddleware](https://github.com/aspnet/HttpAbstractions/blob/87cd79d6fc54bb4abf07c1e380cd7a9498a78612/src/Microsoft.AspNetCore.Http.Abstractions/Extensions/UsePathBaseMiddleware.cs). This is tricky for HMR, because the HMR's endpoint (e.g., `/__webpack_hmr`) is compiled into your `.js` bundle at build time.\r\n\r\nThe best solution I have in mind is:\r\n\r\n * Instruct developers that, if they plan to deploy to a non-root URL, then they have to configure `publicPath` values in their Webpack config accordingly. The `publicPath` values must truly reflect the URLs that browsers need to make requests to (this is the case even for regular production deployments; it's not specific to HMR).\r\n   * At dev time, having correctly-prefixed `publicPath` values (e.g., `/vdir/dist/`) will automatically configure the client-side code to fetch HMR updates (e.g., blah123123.hot-update.json) from under that URL root\r\n   * However, on its own, it would break the HMR proxying, because the current .NET-side proxying code would then start listening for requests under `/vdir/vdir/dist`.\r\n* To fix that latter problem, add a further option on WebpackDevMiddlewareOptions: `BaseUrl`. Amend the proxying code to automatically strip off that prefix from the `publicPath` values that it adds proxy listeners for.\r\n* Also, the .NET-side HMR code can add the configured `BaseUrl` value as a prefix onto the `hotModuleReplacementEndpointUrl` that it passes to the Node code. Then the client will correctly attempt to connect to (e.g.) `/vdir/__webpack_hmr` instead of just `/__webpack_hmr`.\r\n\r\nSo, it's not going to make things automatic for developers, but:\r\n\r\n * It's inevitable that they have to tweak `publicPath` values in Webpack config manually, because that's a compile-time item, and must actually reflect real URLs so that things like images/CSS/etc can actually be loaded from their true complete URLs in production\r\n * It's (almost) inevitable that some specific `BaseUrl` must also be configured, because otherwise there wouldn't necessarily be a single specific one we can use when controlling the HMR endpoint location. The only way to avoid this would be if we delayed WebpackDevMiddleware compilation until requests actually started, and then obtained the `PathBase` from the incoming requests.","author":{"url":"https://github.com/SteveSandersonMS","@type":"Person","name":"SteveSandersonMS"},"datePublished":"2016-12-05T16:45:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/488/JavaScriptServices/issues/488"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:221096cb-71d4-59e6-f3a3-38e3414db46c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9CE4:1A6433:3798E91:49963DE:69745DDD
html-safe-noncee607f5f23b91f25807db5db9b5e9662f88d5a3bca915e654f24bb9232c25fd65
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0U0OjFBNjQzMzozNzk4RTkxOjQ5OTYzREU6Njk3NDVEREQiLCJ2aXNpdG9yX2lkIjoiOTE5ODAwOTAxNTQ5NTU4MTE0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1e0dd66645a7bc05997d30925ece5f8bb9d1d91b597c12aa02e3bc3aa0437106
hovercard-subject-tagissue:193549301
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/aspnet/JavaScriptServices/488/issue_layout
twitter:imagehttps://opengraph.githubassets.com/952d46ddf5954b2f80f10acca236496f8ed394a8a3a8e6ebc3d3156bf517a233/aspnet/JavaScriptServices/issues/488
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/952d46ddf5954b2f80f10acca236496f8ed394a8a3a8e6ebc3d3156bf517a233/aspnet/JavaScriptServices/issues/488
og:image:altSince Webpack dev middleware is a dev-time-only (not production) feature, this will only affect people whose development environment is set up to host their site at a non-root URL (e.g., http://loc...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSteveSandersonMS
hostnamegithub.com
expected-hostnamegithub.com
Nonee0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c
turbo-cache-controlno-preview
go-importgithub.com/aspnet/JavaScriptServices git https://github.com/aspnet/JavaScriptServices.git
octolytics-dimension-user_id6476660
octolytics-dimension-user_loginaspnet
octolytics-dimension-repository_id45365298
octolytics-dimension-repository_nwoaspnet/JavaScriptServices
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id45365298
octolytics-dimension-repository_network_root_nwoaspnet/JavaScriptServices
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release56fe7e2e8de6e57740bca50402351ea656f7a4bf
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/aspnet/JavaScriptServices/issues/488#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Faspnet%2FJavaScriptServices%2Fissues%2F488
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Faspnet%2FJavaScriptServices%2Fissues%2F488
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=aspnet%2FJavaScriptServices
Reloadhttps://github.com/aspnet/JavaScriptServices/issues/488
Reloadhttps://github.com/aspnet/JavaScriptServices/issues/488
Reloadhttps://github.com/aspnet/JavaScriptServices/issues/488
aspnet https://github.com/aspnet
JavaScriptServiceshttps://github.com/aspnet/JavaScriptServices
Notifications https://github.com/login?return_to=%2Faspnet%2FJavaScriptServices
Fork 517 https://github.com/login?return_to=%2Faspnet%2FJavaScriptServices
Star 3k https://github.com/login?return_to=%2Faspnet%2FJavaScriptServices
Code https://github.com/aspnet/JavaScriptServices
Issues 0 https://github.com/aspnet/JavaScriptServices/issues
Pull requests 0 https://github.com/aspnet/JavaScriptServices/pulls
Projects 0 https://github.com/aspnet/JavaScriptServices/projects
Wiki https://github.com/aspnet/JavaScriptServices/wiki
Security 0 https://github.com/aspnet/JavaScriptServices/security
Insights https://github.com/aspnet/JavaScriptServices/pulse
Code https://github.com/aspnet/JavaScriptServices
Issues https://github.com/aspnet/JavaScriptServices/issues
Pull requests https://github.com/aspnet/JavaScriptServices/pulls
Projects https://github.com/aspnet/JavaScriptServices/projects
Wiki https://github.com/aspnet/JavaScriptServices/wiki
Security https://github.com/aspnet/JavaScriptServices/security
Insights https://github.com/aspnet/JavaScriptServices/pulse
Support Webpack HMR with non-root base URLshttps://github.com/aspnet/JavaScriptServices/issues/488#top
https://github.com/SteveSandersonMS
https://github.com/SteveSandersonMS
SteveSandersonMShttps://github.com/SteveSandersonMS
on Dec 5, 2016https://github.com/aspnet/JavaScriptServices/issues/488#issue-193549301
http://localhost:port/somedirhttp://localhost:port/somedir
UsePathBaseMiddlewarehttps://github.com/aspnet/HttpAbstractions/blob/87cd79d6fc54bb4abf07c1e380cd7a9498a78612/src/Microsoft.AspNetCore.Http.Abstractions/Extensions/UsePathBaseMiddleware.cs
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.