Skip to content

Commit

Permalink
Leverage custom build of semantic-ui-offline to avoid google fonts calls
Browse files Browse the repository at this point in the history
  - here, we stop leveraging google fonts, instead housing and serving these assets ourselves
  - speeds up build and initial requests to app
    - at detriment of http caching of common fonts hosted by Google Fonts
  - see discussion at arthurlacoste/semantic-ui-offline#3 for need for custom build
  • Loading branch information
vanderhoop committed Jul 6, 2018
1 parent 66c15c4 commit 48c4742
Show file tree
Hide file tree
Showing 14 changed files with 1,399 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/prepare_semantic_ui_for_consumption_by_phoenix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo -e "\nPreparing Semantic UI for Consumption by Phoenix\n"

echo -e " - Copying Semantic UI assets to priv/ ..."
cp -rf node_modules/semantic-ui-css/ priv/static/css/semantic-ui/
cp -rf node_modules/semantic-ui-offline/ priv/static/css/semantic-ui/

echo -e " - Stripping Semantic UI minified css of '!important' ...\n"
sed -i -e 's/!important//g' priv/static/css/semantic-ui/semantic.min.css
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"react-transition-group": "^1.2.1",
"redux": "^3.6.0",
"redux-thunk": "^2.3.0",
"semantic-ui-css": "2.2.10",
"semantic-ui-offline": "github:vanderhoop/semantic-ui-offline",
"sinon": "^1.17.7",
"webpack": "^3.8.1",
"write-file-webpack-plugin": "^4.2.0"
Expand Down
2 changes: 1 addition & 1 deletion priv/static/css/semantic-ui/semantic.min.css

Large diffs are not rendered by default.

Binary file not shown.
1,008 changes: 1,008 additions & 0 deletions priv/static/css/semantic-ui/themes/default/assets/fonts/brand-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 22 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2655,6 +2655,14 @@ fs-extra@^0.26.4:
path-is-absolute "^1.0.0"
rimraf "^2.2.8"

fs-extra@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
universalify "^0.1.0"

fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
Expand Down Expand Up @@ -3452,6 +3460,12 @@ jsonfile@^2.1.0:
optionalDependencies:
graceful-fs "^4.1.6"

jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
optionalDependencies:
graceful-fs "^4.1.6"

jsonify@~0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
Expand Down Expand Up @@ -5412,10 +5426,11 @@ selfsigned@^1.9.1:
dependencies:
node-forge "0.6.33"

semantic-ui-[email protected]:
version "2.2.10"
resolved "https://registry.yarnpkg.com/semantic-ui-css/-/semantic-ui-css-2.2.10.tgz#f8f4470dbeffca0f0f3ff4fb71a35c71e88ad89c"
"semantic-ui-offline@github:vanderhoop/semantic-ui-offline":
version "2.2.1-3.2"
resolved "https://codeload.github.com/vanderhoop/semantic-ui-offline/tar.gz/dbf68a08531a48aa5b2bdc123b92a3c3df112515"
dependencies:
fs-extra "^4.0.2"
jquery x.*

"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@~5.4.1:
Expand Down Expand Up @@ -5997,6 +6012,10 @@ uniqs@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02"

universalify@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"

unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
Expand Down

0 comments on commit 48c4742

Please sign in to comment.