-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat: Use unversioned frontend asset paths #25994
Conversation
0c995d0
to
a638e7c
Compare
a638e7c
to
8863267
Compare
8863267
to
cef276d
Compare
cef276d
to
d5707c7
Compare
d5707c7
to
7219708
Compare
7219708
to
0acf716
Compare
5b54806
to
294b927
Compare
ee4f9d9
to
7bafdaa
Compare
264974c
to
8419b55
Compare
@@ -130,7 +130,6 @@ | |||
"u2f-api": "1.0.10", | |||
"webpack": "5.40.0", | |||
"webpack-cli": "4.7.2", | |||
"webpack-manifest-plugin": "^3.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great
Tested this for on-prem using 2 images (one normal and one with an update to the background color as a test) -- the frontend assets loaded as expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
e270bae
to
9bd822d
Compare
This inverts the relationship between inline scripts in templates and our main js app bundle. Previously, the templates assume that certain bundles are loaded synchronously. We also expose certain components in the app bundle via globals (`SentryApp`). This would no longer work if (when) we make our bundles loaded async. Instead of exposing components through globals, allow templates to queue up predefined tasks (there are some future optimizations here as I do not believe these other django templates that extend from `layout.html` need the main app bundle). After we render the SPA to the DOM, we will iterate through `__onSentryInit` and perform the necessary initializations.
…ut it being loaded async
9bd822d
to
12799d3
Compare
This reverts commit 3228492. This builds on top of #25744 where we refactored our JS entry points to be lightweight and to use dynamic imports (via webpack) to load the rest of the JS application. This PR will now remove the need for the backend to be updated in order to release a new frontend. This will allow us to have frontend-only deploys which should complete much faster than a full deploy. We accomplish this by removing the webpack manifest plugin introduced in #25234, where we previously were versioning by a release string in the asset path. These unversioned asset files will be served using a [`Cache-Control: no-cache`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#cacheability) header which tells clients that they need to check against the origin server to see if the asset has changed, if it has not, they can use their cached copy. These unversioned files will end up changing quite frequently with every release, but they should be relatively small. They contain the webpack runtime that allows us to load the rest of our application bundles, which are versioned by a hash of their contents. These versioned chunks will have a long-term `max-age` for caching as the hash in the file name will serve to cache bust. Note: this was reverted in #25994 as it broke production due to our CDN having cached an old asset due to a cache misconfiguration during development. This was also not caught in staging because we needed to change the asset paths for staging deploys to avoid clobbering production assets.
This reverts commit 3228492. This builds on top of #25744 where we refactored our JS entry points to be lightweight and to use dynamic imports (via webpack) to load the rest of the JS application. This PR will now remove the need for the backend to be updated in order to release a new frontend. This will allow us to have frontend-only deploys which should complete much faster than a full deploy. We accomplish this by removing the webpack manifest plugin introduced in #25234, where we previously were versioning by a release string in the asset path. These unversioned asset files will be served using a [`Cache-Control: no-cache`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#cacheability) header which tells clients that they need to check against the origin server to see if the asset has changed, if it has not, they can use their cached copy. These unversioned files will end up changing quite frequently with every release, but they should be relatively small. They contain the webpack runtime that allows us to load the rest of our application bundles, which are versioned by a hash of their contents. These versioned chunks will have a long-term `max-age` for caching as the hash in the file name will serve to cache bust. Note: this was reverted in #25994 as it broke production due to our CDN having cached an old asset due to a cache misconfiguration during development. This was also not caught in staging because we needed to change the asset paths for staging deploys to avoid clobbering production assets.
This reverts commit 388edc8. This builds on top of #25744 where we refactored our JS entry points to be lightweight and to use dynamic imports (via webpack) to load the rest of the JS application. This PR will now remove the need for the backend to be updated in order to release a new frontend. This will allow us to have frontend-only deploys which should complete much faster than a full deploy. We accomplish this by removing the webpack manifest plugin introduced in #25234, where we previously were versioning b y a release string in the asset path. These unversioned asset files will be served using a [`Cache-Control: no-cache`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache -Control#cacheability) header which tells clients that they need to check against the origi n server to see if the asset has changed, if it has not, they can use their cached copy. Th ese unversioned files will end up changing quite frequently with every release, but they sh ould be relatively small. They contain the webpack runtime that allows us to load the rest of our application bundles, which are versioned by a hash of their contents. These versione d chunks will have a long-term `max-age` for caching as the hash in the file name will serv e to cache bust. Note: this was reverted in #25994 as it broke p roduction due to our CDN having cached an old asset due to a cache misconfiguration during development. This was also not caught in staging because we needed to change the asset path s for staging deploys to avoid clobbering production assets, and the staging path was not p reviously cached. Requires #26987
This builds on top of #25744 where we refactored our JS entry points to be lightweight and to use dynamic imports (via webpack) to load the rest of the JS application.
This PR will now remove the need for the backend to be updated in order to release a new frontend. This will allow us to have frontend-only deploys which should complete much faster than a full deploy. We accomplish this by removing the webpack manifest plugin introduced in #25234, where we previously were versioning by a release string in the asset path. These unversioned asset files will be served using a
Cache-Control: no-cache
header which tells clients that they need to check against the origin server to see if the asset has changed, if it has not, they can use their cached copy. These unversioned files will end up changing quite frequently with every release, but they should be relatively small. They contain the webpack runtime that allows us to load the rest of our application bundles, which are versioned by a hash of their contents. These versioned chunks will have a long-termmax-age
for caching as the hash in the file name will serve to cache bust.