Moving towards a new Frontend Builder #6161
Comments
Generating a sprite image file is a build task. It doesn't add up on my mind how a deployment task can eliminate a build task regarding sprite image file. |
Also, development iteration of sprite editing should be considered before going into it. |
Can you elaborate? |
If builder is not going to generate a sprite image then what developer is supposed to do? |
That was exactly the thing i was trying to come up with a solution. But have literally no idea. I guess sprite generating still needs to be the part of the builder, but builder should be smart enough to not recompile when building first if there are no change in the sprites. |
That's a completely different matter :) |
What would be the best solution for sprites? Because clearly it's one of the bottlenecks at the initial build and i think we need to address that. |
webpack is a good idea maintenance wise but a daunting task. Finer details of corresponding weback steps should be designated first before Project I.G.I. |
This is exactly the reason of me creating this issue, let's come up with the steps all together towards our need. |
I still think we can investigate slowness regarding sprite generation and JavaScript watcher. It should take less than webpack replacement 💥 |
Initial proof of concept goal should be an optimal {Coffee,Java}Script file watcher and sprite image generation process. |
I agree with you, we should first investigate those and fix those problems, since sprite generation will require extra attention regardless of us changing builder. I also think that we should have this issue open to figure out what the ultimate needs of ours are to have a better/faster/stronger builder. For example, having a |
Here is an idea, let's put already created sprite images to s3 and download them to dev's machine while building the client and use it instead building the sprites again. Here is the flow of the idea above,
Let's say you need to add new sprite image then you will need to generate the sprites again as usual and as is right now then your This is just an idea how we can utilize remote sprite images but this may work or not and/or contain some pitfalls, since it's an idea in my mind and I wanted to add it here. bye. |
#6208 was not working correctly, i made lots of changes which is living in my local, will send it when i have time. |
I've lots of things to say for this one but I'm unable to have time to list them, it's my bad. But let me start from somewhere;
|
browserify was fine when we first did it, but then to make everything work ( Their solution to sprites is different, you don't create spritesheets but it checks the images by size and if smaller than 8kb (adjustable) it embeds into the compiled css as base64 if bigger it puts it to the dist folder of your choice and links the background-image to it (paths are also adjustable). IMO this is a clever solution than sprites as it created weird problems on retina displays and it was always an hassle during deployments. I like your https://github.com/gokmen/kodemirror/blob/master/gulpfile.coffee if you see our landing build it is more or less the same thing. But when things get bigger that simple approach may become messy. As a last note re: Hot-reload, yes that's an ongoing debate on which is nicer, browsersync vs webpack's. Webpack came with it from the beginning then browserify people did a similar thing. I am not going to take a side on that because I think it's less important than the issues above. |
as an update http://blog.tighten.co/unpacking-webpack just see this, fyi. |
Hello,
Following is the builder's requirements to work. I tried my best to describe each step in words, so that we can discuss and come up with better ideas, and mostly because if we know the requirements of it right now we can move to a new one with confidence and ditch
bant
once and for all./cc @koding/frontend
Build Sprites
Sprite Specification
sprites
array in theirbant.json
. (the default islib/sprites
for each app right now.)sprites
array consists of 2 folders:lib/sprites/1x
lib/sprites/2x
1x
folder, there should be another file present in the2x
folder with the same name:Sprite build step
sprites
array inbant.json
1x
css spritesheet and saves it underopts.spriteTmpCssOutdir
2x
css spritesheet and saves it underopts.spriteTmpCssOutdir
1x
sprite image and saves it underopts.spriteImgOutdir
2x
sprite image and saves it underopts.spriteImgOutdir
Build Styles
Style Specification
styles
array in theirbant.json
styles
array can be aglob
relative to the root folder of app folder.styles
array corresponds to a file or list of files that can be compiled viastylus
compiler.Style build step
STYLES_COMMONS_GLOB
('app/styl/**/*.styl'
) (for each app :/)styles
array ofbant.json
css
file for each app underopts.stylesOutdir/<app-name>.css
watch
mode for styles:STYLES_COMMONS_GLOB
styles
array ofbant.json
of each app.sprites
compilation:opts.spriteTmpCssOutdir
Build Scripts files
main
key which corresponds to a file that is relative to the app root folder.main
key will be used as an entry file forbant
compilation.Scripts build step
require
paths.lib
for requiring single modules under<app-name>/lib
folder..coffee
extension.opts.minifyJs
globals.modules
globals.REMOTE_API
globals.acePath
globals.aceConfig
kd.js
modules. (wtf?)opts.extractJsSourcemaps
option istrue
.watch
mode is enabled:Copy Assets
Copy assets builder step
opts.assetsDir
toopts.assetsOutdir
with the same folder structure.Copy Thirdparty
Copy thirdparty builder step.
opts.thirdpartyDir
toopts.thirdpartyOutdir
with the same folder structure.Here are my suggestions:
bant
, usewebpack
webpack
is widely supported by the developers from big companies:facebook
,twitter
, etc.webpack
supports awesome debugging tools out of box,hot-reloading
webpack
is the defacto builder in React community.images
,style
files, etc.If we switch to
webpack
requiring a style file for a component will become like this:webpack
to create chunks, and only serve the requiredjs
andcss
files on initial load, and the loading the rest can be deferred.Any feedback/help will make our lives as frontend engineers way much easier, cause waiting for 284712894 seconds for a simple js file change shouldn't be a normal practice. 👻
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: