Skip to content

Commit

Permalink
Disable preprocessing of JavaScript from React component libraries
Browse files Browse the repository at this point in the history
Preprocessing means that the files will be aggregated if enabled.
Aggregation disables sourcemaps which makes JavaScript errors
significantly harder to debug.

We could toggle this through configuration but we do not want to 
disable aggregation for other JavaScript files.

This may degrade performance because multiple files will have to be
downloaded. On the other hand features like HTTP/2 should make this
less of a problem in practice. Not using aggregation should also enable
browsers to cache the files once downloaded as they will not change
across pages.
  • Loading branch information
kasperg committed Sep 18, 2023
1 parent a6ccf31 commit a1e7a52
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions web/modules/custom/dpl_react/dpl_react.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ hello-world:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/hello-world.js: {}
/libraries/dpl-react/hello-world.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -17,7 +17,7 @@ search-header:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/search-header.js: {}
/libraries/dpl-react/search-header.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -29,7 +29,7 @@ search-result:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/search-result.js: {}
/libraries/dpl-react/search-result.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -41,7 +41,7 @@ patron-page:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/PatronPage.js: {}
/libraries/dpl-react/PatronPage.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -53,7 +53,7 @@ create-patron:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/CreatePatron.js: {}
/libraries/dpl-react/CreatePatron.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -65,7 +65,7 @@ material:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/material.js: {}
/libraries/dpl-react/material.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -77,7 +77,7 @@ loan-list:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/loan-list.js: {}
/libraries/dpl-react/loan-list.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -89,7 +89,7 @@ recommender:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/Recommender.js: {}
/libraries/dpl-react/Recommender.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -101,7 +101,7 @@ something-similar:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/SomethingSimilar.js: {}
/libraries/dpl-react/SomethingSimilar.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -113,7 +113,7 @@ fee-list:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/FeeList.js: {}
/libraries/dpl-react/FeeList.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -125,7 +125,7 @@ favorites-list-material-component:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/FavoritesListMaterialComponent.js: {}
/libraries/dpl-react/FavoritesListMaterialComponent.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -137,7 +137,7 @@ reservation-list:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/reservation-list.js: {}
/libraries/dpl-react/reservation-list.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -149,7 +149,7 @@ DashBoard:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/dashboard.js: {}
/libraries/dpl-react/dashboard.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -161,7 +161,7 @@ favorites-list:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/FavoritesList.js: {}
/libraries/dpl-react/FavoritesList.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -173,7 +173,7 @@ menu:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/menu.js: {}
/libraries/dpl-react/menu.js: { preprocess: false }
dependencies:
- dpl_react/base
- dpl_react/handler
Expand All @@ -185,9 +185,9 @@ base:
url: https://github.com/danskernesdigitalebibliotek/dpl-react/blob/master/LICENSE
gpl-compatible: true
js:
/libraries/dpl-react/runtime.js: { weight: -19 }
/libraries/dpl-react/bundle.js: { weight: -18 }
/libraries/dpl-react/mount.js: { weight: -16 }
/libraries/dpl-react/runtime.js: { preprocess: false, weight: -19 }
/libraries/dpl-react/bundle.js: { preprocess: false, weight: -18 }
/libraries/dpl-react/mount.js: { preprocess: false, weight: -16 }
css:
theme:
/libraries/dpl-react/components.css: {}
Expand Down

0 comments on commit a1e7a52

Please sign in to comment.