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

Testing beta9, things I had trouble configuring (Better docs needed?) #615

Closed
jaredbeck opened this issue Jun 13, 2019 · 5 comments
Closed

Comments

@jaredbeck
Copy link
Contributor

jaredbeck commented Jun 13, 2019

This issue does not follow the issue template, but @schneems asked me to open it anyway:

Me: .. tested beta9 .. happy to provide some feedback of the form "I can't figure out how to configure X" (in the hopes of improving docs maybe?) ..

Schneems: Couldn’t hurt to write it up and stick it in an issue. Would love for better docs if someone wants to work on it.
https://twitter.com/schneems/status/1139255964367015938

So, I can't figure out how to configure:

  1. Non-concatenation
    • Non-concatenation works fine in sprockets 3
    • The docs say: "When using Rails and Sprockets in development mode, no assets are concatenated.", and
    • I have set config.assets.debug = true in dev env, but
    • looking at browser network tab, concatenation still occurs.
    • Maybe I'm writing the new manifest.js file incorrectly? which leads me to:
  2. manifest.js
    • The error message re: manifest.js is a good start, and
    • The per-function docs .. exist,
    • but I still have no idea if I'm writing this new file correctly.
    • Should it only contain link* calls?
    • When should I use link, vs dir, vs. tree?
    • Do I need to make any corresponding changes to application.js?
    • Ideally, the error message should tell me what to put in manifest.js, but I doubt that's practical, so maybe we just need more examples in the docs?
  3. source maps
    • I don't even know how to tell if they're working 100%, I'm getting mixed signals ..
    • Docs say: "How do you know if source maps are working correctly? Try adding a syntax error to one of your assets and use the console to debug. Does it show the correct file and source location? Or does it reference the top level application.js file?"
    • I introduced a TypeError, and
    • I get the correct file name and line number,
      • "TypeError: undefined is not a function redacted.source.js:5"
      • redacted is correct, and line 5 is correct
    • but the browser console says "application.source.js is not in the SourceMap"
    • To me, these are mixed signals
    • Maybe it doesn't make sense to even think about source maps until I fix non-concatenation.

So, in a few hours of testing beta9 these are some things I found confusing. I hope this is useful.

@dmmat
Copy link

dmmat commented Oct 29, 2019

but the browser console says "application.source.js is not in the SourceMap"

some problem in firefox with sprockets 4.0 version

@jaredbeck
Copy link
Contributor Author

but the browser console says "application.source.js is not in the SourceMap"

some problem in firefox with sprockets 4.0 version

Can confirm. Seems to work fine in Chrome 78, error in Firefox 70. I opened a question on SO:
“Error while fetching an original source” in new rails app (Sprockets 4, Firefox 70)

@andrewkendall
Copy link

@jaredbeck did you ever find a solution to the concatenation issue?

@jaredbeck
Copy link
Contributor Author

.. did you ever find a solution to the concatenation issue?

No solution. I continue to observe the following:

  • Sprockets 3: The effect of config.assets.debug matches the rails documentation: "... disables the concatenation and compression of assets"
  • Sprockets 4: The effect of config.assets.debug does not match the rails documentation.
    • This appears to be an undocumented breaking change. For example, the word "debug" does not appear in the sprockets 4 changelog.
    • I have been reading the code for eg. DebugAssetTest to learn what it actually does, in hopes of improving the sprockets documentation.

@jaredbeck
Copy link
Contributor Author

I haven't used sprockets for a while now (I use webpacker for everything) so I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants