Comments (3)
Hi Joe,
Yes, I think the order need to be changed vice versa, e.g. bootstrap.scss need to be loaded first, and styles.scss second.
The reason for separation is to speed up hot code reload for styles. Bootstrap styles are pretty big and we wanted to separate them out, so that they don't slow down reloading times of custom styles during development.
from apollo-universal-starter-kit.
Just following up here, it looks like splitting up the files like they are now increases build speed but one of the largest benefits of Bootstrap is being able to build with their variables available so developers can stick to a convention and not have to name things on their own. Running the project requesting a very popular variable returns in an error:
// styles.scss
ERROR in ./~/css-loader!./~/sass-loader!./src/ui/styles.scss
Module build failed:
background-color: $brand-primary;
^
Undefined variable: "$brand-primary".
in /Users/jb/Sites/forks/apollo-fullstack-starter-kit/src/ui/styles.scss (line 10, column 21)
Error:
background-color: $brand-primary;
^
Undefined variable: "$brand-primary".
in /Users/jb/Sites/forks/apollo-fullstack-starter-kit/src/ui/styles.scss (line 10, column 21)
at options.error (/Users/jb/Sites/forks/apollo-fullstack-starter-kit/node_modules/node-sass/lib/index.js:291:26)
@ ./src/ui/styles.scss 2:18-127 19:6-27:8 20:18-127
webpack-for-backend Time: 82ms
Unfortunately the only way to solve this is to import the bootstrap file within styles.scss to get access to the variables that Bootstrap already defined. I think the average developer looking at this repo will probably figure that out, but maybe a note should be made about this in the README. I do understand some developers want Bootstrap basics and don't care about variable access.
For what it's worth, the style update speed is pretty fast either way. Without summoning bootstrap from style.scss it's about ~2 seconds on a 2016 Macbook Pro. Calling bootstrap from within style.scss and not having 2 files in html.jsx is about ~3 seconds.
from apollo-universal-starter-kit.
@josephdburdick Let's maybe merge styles.scss with bootstrap.scss then. Incremental build speedup time seems not worth the trouble and confusion it creates...
from apollo-universal-starter-kit.
Related Issues (20)
- Multi Config Setup HOT 2
- Can't fully install dependencies after fresh download - expo-yarn-workspace postinstall fails HOT 4
- lerna stdout maxBuffer exceeded HOT 7
- [Question] Are there any plans to shift to any other package manager since lerna is no longer properly maintained. HOT 5
- Unable to perform a full page reload on edit post page in React Client. HOT 2
- Tests fail after clean installation
- feedback
- Update dependency react-navigation HOT 1
- How can i connect it with my Hasura database?
- Plans to upgrade to webpack 5 HOT 3
- Fail to build on a clean Fedora 33 installation
- Expo Go Android will not run. Says wrong sdk version of expo HOT 1
- New @server app dependencies install error (ambiguous syntax error)
- Standalone use
- master does not work
- Upgrade expo to latest SDK HOT 6
- Setting i18n debug to true reveals several potential issues
- Router is not worked ! HOT 6
- ..
- Demo app link on the readme file not working HOT 3
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 apollo-universal-starter-kit.