Comments (7)
@eoinkelly I think probably the application pack should be the deferred one. Perhaps we could have another pack named something like "boot"
that is non-deferred. This would encourage code to be placed in deferred scripts unless it had to be in the startup pack.
from rails-template.
That's a good idea @joshmcarthur
from rails-template.
Some evidence for defer
by default being good: I have recently changed a few of our apps to defer application JS and it mostly just works. The only change I had to make was in an older app but it was an easy refactor.
from rails-template.
Re @joshmcarthur suggestion about a second pack. I was initially in favour of that but I'm not so sure now because I think it would end up being an empty file and a useless HTTP request in production on most apps.
I now think the right approach is:
- load the main pack with
defer
- Put a big comment at the top of the main pack explaining what that means and how to create a "boot" (non deferred) pack if you need it for some reason
Thoughts?
from rails-template.
from rails-template.
Reading https://docs.sentry.io/platforms/javascript/
It’s possible to include defer in your script tag, but keep in mind that any errors which occur in scripts that execute before the browser SDK script executes won’t be caught (because the SDK won’t be initialized yet). We strongly recommend that if you use defer, you a) place the script tag for the browser SDK first, and b) mark it, and all of your other scripts, defer (but not async), thereby guaranteeing that it’s executed before any of the others.
I think we should be OK provided we init Sentry before we load any other JS.
from rails-template.
resolved by #141
from rails-template.
Related Issues (20)
- Upgrade aws-actions/configure-aws-credentials to latest version
- Move from SASS `@import` to `@use`
- Let's add `erblint`
- Disable Rails/SquishedSQLHeredocs rubocop by default
- Remove before_fork, on_worker_boot callbacks from puma config if they are no longer required
- Support Rails 7.1 HOT 2
- Consider using msgpack serialiser
- Rails 7.1 generates Dockerfile by default - integrate it into our Dockerfile HOT 1
- Consider replacing sprockets with propshaft HOT 2
- Discuss adopting Rails 7.1+ config.application_controller.raise_on_missing_callback_actions HOT 2
- Support "documents" as assets out of the box HOT 1
- Use `always` for `SelfClosingTag` in erb-lint HOT 2
- Consider adding TestProf
- Check our parameter sanitisation and filtering for logging & sentry HOT 1
- Move off `axe-matchers`
- Can we make the session cookie SameSite=Strict (currently defaulting to SameSite=Lax)? HOT 1
- Do we want ci to copy example.env instead of having its own list of env vars HOT 1
- Devise variant is consistently failing lighthouse accessibility audit
- Consider setting `action_on_unpermitted_parameters` to `:raise` in development and/or test HOT 1
- Explore moving from devise to Rails 8 authentication generator
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails-template.