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

x/pgksite: dev mode doesn't actually serve non-minified JS #42540

Closed
eliben opened this issue Nov 12, 2020 · 3 comments
Closed

x/pgksite: dev mode doesn't actually serve non-minified JS #42540

eliben opened this issue Nov 12, 2020 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development pkgsite

Comments

@eliben
Copy link
Member

eliben commented Nov 12, 2020

The usage of ./cmd/frontend says:

  -dev
    	enable developer mode (reload templates on each page load, serve non-minified JS/CSS, etc.)

However, from some experimentation this doesn't appear to be happening. If I modify a .js file and re-run the frontend, the modification is not applied until I compile the .js file into a minified version with ./devtools/compile_js.sh.

Perhaps I'm holding it wrong?

A quick look at the code makes me believe this indeed isn't implemented. While in devMode the server calls parsePageTemplates anew each time a template is requested, the template files directly refer to minified JS, e.g.:

  <script>
    loadScript("/static/js/playground.min.js");
  </script>
@gopherbot gopherbot added this to the Unreleased milestone Nov 12, 2020
@eliben
Copy link
Member Author

eliben commented Nov 12, 2020

Related to #40960

@cagedmantis cagedmantis changed the title x/pgksite: --dev mode doesn't actually serve non-minified JS x/pgksite: dev mode doesn't actually serve non-minified JS Nov 13, 2020
@cagedmantis cagedmantis added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite labels Nov 13, 2020
@jamalc jamalc modified the milestones: Unreleased, pkgsite/frontend Nov 16, 2020
@jamalc
Copy link

jamalc commented Nov 16, 2020

Thanks for bringing this up, we definitely want to tackle this as part of #40960. More detailed plans coming soon.

@gopherbot
Copy link

Change https://golang.org/cl/300074 mentions this issue: devtools,internal/frontend: configuration for esbuild

@golang golang locked and limited conversation to collaborators Mar 10, 2022
@hyangah hyangah added the pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development label May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development pkgsite
Projects
None yet
Development

No branches or pull requests

5 participants