-
Notifications
You must be signed in to change notification settings - Fork 249
Conversation
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.
Looking good so far! I like it!
@@ -33,6 +33,7 @@ | |||
"find-cache-dir": "^0.1.1", | |||
"multili": "^1.1.0", | |||
"react-hot-loader": "^3.0.0-beta.7", | |||
"react-scripts": "1.0.17", |
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.
Please use "^1.0.17"
@@ -3,22 +3,27 @@ import path from "path"; | |||
import webpack from "webpack"; | |||
import ExtractTextPlugin from "extract-text-webpack-plugin"; | |||
|
|||
const isStatic = process.env.PHENOMIC_ENV === "static"; | |||
const isProduction = process.env.NODE_ENV === "production"; |
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.
const isStatic = process.env.PHENOMIC_ENV === "static"; | ||
const isProduction = process.env.NODE_ENV === "production"; | ||
|
||
const baseConfig = require("react-scripts/config/webpack.config." + |
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.
Same as above, should be in the function.
About the unnecessary plugins, no big deal imo, we can improve that later. I think we should only remove what's really a problem. I would like to stick to CRA default as close as possible so people can just "drop" some existing code. Removing some plugin might make sense but I prefer to not do it unless necessary. |
Any reason we have to maintain a specific css loader block? Is this because of the hmr? |
@MoOx I did the changes you requested. I had an error because the template for After that, I saw that the css was written in I also had to put a weird computed property with a ternary condition in the CSS loader because CRA is using Last thing, since we have to override the I just tested with EDIT : oops I didn't see your last comment. Actually it is because the config object is inside a |
html plugin is supposed to be around https://github.com/facebookincubator/create-react-app/blob/4b55193f0ad479f26b0f5e153bb4b152a1ee03e7/packages/react-scripts/package.json#L45 Anyway, thanks for this, I will have a deeper look on some stuff before merging to try to reduce the maintenance even further. Thanks a lot for the work done. Stay tuned ! |
Could you fix the yarn lock issue? Rebase on master and just do "yarn", yarn will handle the conflict (it's a yarn feature!) then you can amend your commit :) |
Yes the plugin is in the dependencies, but there is no HTML template file, so it crashed when it was trying to read it (CRA declares an I will look the yarn lock issue tomorrow. And yeah, it would be so great to be added as a collaborator, thank you ! |
e26dfe2
to
a47714d
Compare
@drazik any luck with yarn lock conflict? (sorry I think that's the second time??) |
@MoOx tkt je vais m'en occuper |
I can still do it (merge in another branch, resolve & the merge into master). What I expect from you is more a code review what thoughts about the approach :) |
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.
the fact that its a bit too much react centric is kind of annoying I think, where should we branch? every renderer adding their options given the bundler or the other way around?
const isStatic = process.env.PHENOMIC_ENV === "static"; | ||
const isProduction = process.env.NODE_ENV === "production"; | ||
|
||
const baseConfig = require("react-scripts/config/webpack.config." + |
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.
I'm a bit worried to rely on a react repo for the webpack config (they are not coupled in Phenomic)
entry: { | ||
[config.bundleName]: [ | ||
!isStatic && require.resolve("webpack-hot-middleware/client"), | ||
!isStatic && require.resolve("react-hot-loader/patch"), |
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.
I'd only add this if the React plugin is used
Totally agree. I was more like "until we have other renderer we could do this and fix later". |
a47714d
to
06219a2
Compare
I fixed the conflict in |
It seems that tests are failing on Windows (see appveyor state). Can you take a look? |
Yes I will take a look. I'm pretty busy at the moment but I will take 10 minutes to do it this week ;) Edit : The error is : ModuleParseError: Module parse failed: C:\projects\phenomic\examples\react-app-getting-started\App.js Unexpected token (14:2)
You may need an appropriate loader to handle this file type. It seems the |
@drazik would you like me to continue the effort here? |
Yes sorry I am very busy these days, and I don't know where the error on Windows come from. If you have time to investigate it's great :) |
I will try to use another approach soon. @drazik thanks a lot for digging into this, that helped me to think about a better way to integrate CRA config! |
That's fine :) In the meantime, do you have some advices to deal with things the current webpack things doesn't handle ? I have some fonts to load, for example. |
… custom webpack conf see MoOx/phenomic#1212
… custom webpack conf see MoOx/phenomic#1212
BREAKING CHANGE * move old content in a folder * add articles * use phenomic with basic components * add gitignore * manage external posts * max 80 chars * outdated message * delete twitter share link * Delete PostsList page to show all posts on home * use named exports only * code highlight * set language on all code samples * add error page * move posts images to public folder * add progress bar loading * handle fonts * chore: update dependencies * feat: disable custom fonts until I find how to deal with phenomic and custom webpack conf see MoOx/phenomic#1212 * feat: update header with new job * feat: add emoji on external links * content: add preact discover post * chore: delete travis deploy script
You can create your own custom config. Eg: https://github.com/MoOx/maxim-hylian.fr/blob/master/webpack.config.js |
Thank you 👍 |
Related to #1210. It is currently a not tested WIP. I just want to get some feedback from @MoOx for the moment. Does it match to what you imagined ?
Here are some random things :
loader
property, nottest
as you suggested to me, because some of thetest
s are arrays, so I felt it was more difficult to use it in conditionsreact-scripts
are not necessary inphenomic
:InterpolateHtmlPlugin
,HtmlWebpackPlugin
,DefinePlugin
... Do we keep them anyway ?