-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Use npm to manage fomantic and only build needed components #9561
Conversation
80e7a6f
to
670cb9a
Compare
Codecov Report
@@ Coverage Diff @@
## master #9561 +/- ##
==========================================
- Coverage 42.33% 42.29% -0.04%
==========================================
Files 605 607 +2
Lines 79313 79353 +40
==========================================
- Hits 33577 33565 -12
- Misses 41597 41645 +48
- Partials 4139 4143 +4
Continue to review full report at Codecov.
|
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.
Huge PR, right?
@bagasme I don't think so. Most changes are to delete semantic-ui vendor files and add semantic-ui sources. |
package.json
Outdated
], | ||
"dependencies": { | ||
"fomantic-ui": "2.8.3", | ||
"gulp": "4.0.2" |
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.
Gulp must be devDependency
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.
Can't we just use webpack without gulp?
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.
@lafriks I just follow https://fomantic-ui.com/introduction/build-tools.html to use gulp. If we want to use webpack, I think we should do that another PRs.
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.
Gulp build is necessary to build the fomantic bundle I'm afraid, but we can tweak the Makefile so it only runs when necessary. Optionally, the resulting files could then be integrated in the webpack bundle as most pages do need it (thought, not all).
5ea0338
to
9bcd49d
Compare
@lafriks Done. I also moved |
@lunny is there a optio to only build fomatic if something has changed? |
Fomatic-ui should be dependency, and gulp devDependency |
.PHONY: fomantic | ||
fomantic: node-check node_modules | ||
cd web_src/fomantic && npx gulp build | ||
|
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.
Maybe it is possible to have this as a non-phony target that depends on package-lock.json
, so it would only run if dependencies change.
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.
Also, I'd suggest the target to be adjusted to provide one or more output files, like public/fomantic/semantic.min.js
and public/fomantic/semantic.min.css
. We can still have a phony fomantic
target that depends on that file to trigger it on-demand.
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.
@lunny @6543 I managed to devendor fomantic (8MB on disk) and implement the lazy build.
Feel free to cherry pick das7pad@6a012e9
9bcd49d
to
9830520
Compare
@das7pad Thanks! @lafriks @silverwind done. |
Please remove the Not sure I like the approach of writing into |
Can you help me understand why it should be removed?
I do not like it either, but their imports dictate that this config file is placed in the source code: As noted in the TODO, we can work around that with an alias/mock, but I could not find an easy solution for that using the gulp build tool. We could fix the fomantic source too, but i'm not sure it is worth the effort. |
d5bf2ec
to
e4c3ed7
Compare
Because it already comes in as a dependency of fomantic. If we depend on a specific version of it directly and fomantic updates their version, we'd end up with two versions which is not ideal (not sure which one would end up in the If you really want to keep it, I'd suggest depending on version |
Thanks @silverwind !
Our version would go into I agree that we may be better off with a more loose version. |
In the end, it doesn't really matter much because we already lock dependencies. Still, I would recommend removing it from our dependencies, the fomantic docs also don't recommend adding gulp to the project dependencies. |
e4c3ed7
to
2b10c76
Compare
9df17aa
to
a73a90e
Compare
gulp should be added as devDependency |
@lafriks as @silverwind mentioned. fomantic-ui has a dependency on gulp already. |
@lafriks we discussed this a few times already. Given that |
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
ac566a3
to
b3013b1
Compare
@lunny: any specific reason why you added |
@silverwind I just thought, maybe some js or css files depend on fomantic since it's a basic framework. So I did that. If that's not a thing, I think we can change that. |
Fix #9562, #9415
semantic.min.css
is 1.29MB, after ~650KB.