Skip to content
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

Build = compile + bundle #226

Closed
Reinmar opened this issue Jul 5, 2016 · 14 comments
Closed

Build = compile + bundle #226

Reinmar opened this issue Jul 5, 2016 · 14 comments
Assignees
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Jul 5, 2016

Currently we call the first step building and the second bundling. So the whole process doesn't have a good name. Also, we can't talk about CKEditor releases in a reasonable way. Normally you would use the word "package" or "build" but package is taken but npm packages and build by the building step.

Therefore, to clarify the naming, we're going to have building (and builds) which are a result of compiling and optional bundling. There may be an optimised build (which is bundled and minified) and dev build which is basically what you can find currently in the build/ directory.

One thing that I'd make sure before we make any changes is that we can use the word "compile" in this sense.

the action or process of producing something, especially a list or book, by assembling information collected from other sources.

In programming compiling is understood as transforming source code into byte code. The meaning used about books or other type of media makes sense in our case, but taken the usual meaning of that word in the programming world, I'm afraid that we may cause a confusion. Any thoughts?

@Reinmar Reinmar added this to the iteration 2 milestone Jul 5, 2016
@pjasiun
Copy link

pjasiun commented Jul 5, 2016

I think that the compiling makes sense here. We use Babel for it and Babel is "The compiler for writing next generation JavaScript". The compiling in IT is transforming one code into another what we do here, even if, in some cases, it is only path fixing.

Also, as far I understand it, in some cases we may do bigger changes in the code at this step, for instance to support IE 11. Then we may compile ES6 to ES5.

Anyway, this step to is transforming our human-readable code, into code which can by understand by the machine. This is even compiling in the popular meaning. It does not matter both are JavaScript.

@Reinmar
Copy link
Member Author

Reinmar commented Jul 20, 2016

I was thinking about directory structure because I think we should keep the build/ and not introduce any weird compilation/. At the same time we have to fit bundles somewhere. I thought about something like this:

build/
    # what we've got so far – so compilation results:
    amd/
    cjs/
    esnext/

    # the last bundle
    bundle/

    # docs are here too:
    docs/

Or we may keep bundle/ outside, like we do know and simply don't care.

@pjasiun
Copy link

pjasiun commented Jul 21, 2016

For me keeping everything in one directory is nice. You have only one "messy" directory, where you have code not tracked by git hub. I think that when you compline any project it is common that all semi-finished products and the final build land in one place.

What I unclear for me is the fact that we have a separate directory for each compilation, but only one for all bundles (as far I understand we may have different types of bundles too). I think we should have it same way so:

build/
    compilation/
    bundle/
    docs/

or:

build/
    amd/
    cjs/
    esnext/
    esnext-bundle/
    amd-bundle/
    docs/

or:

build/
    compilation/
        amd/
        cjs/
        esnext/
    bundle/
        esnext/
        amd/
    docs/

@fredck
Copy link
Contributor

fredck commented Jul 21, 2016

I was wondering if people will not get a bit confused on finding all those folders inside “build” and not understanding really which one to use. Maybe we should group them in a clearer way.

For instance amd, cjs and esnext are compilations of "modules". Wouldn't it be better to have them into a modules folder?

@Reinmar
Copy link
Member Author

Reinmar commented Jul 21, 2016

@pjasiun, I don't want to use the name compilation for a directory because it looks weird and I've never seen it used in any other project.

For instance amd, cjs and esnext are compilations of "modules". Wouldn't it be better to have them in to `modules" folder?

But would you put it inside build/ or outside? Outside it would be odd because it would be read as "package's modules", not "whole build's modules". That's why we want to keep all inside build/ or some other directory that has similar meaning.

@fredck
Copy link
Contributor

fredck commented Jul 21, 2016

Yes, I would leave it inside build:

build/
    modules/
        amd
        cjs
        esnext
    buldle/ (or bundles/ because it is still unclear for me as well)
    docs/
    README.md

A readme file may be welcome at this point, as an introduction to the contents of build.

@Reinmar
Copy link
Member Author

Reinmar commented Jul 21, 2016

LGTM

@pjasiun
Copy link

pjasiun commented Jul 21, 2016

I also do not like "compilation", I simply did not find anything better.modules is much better.

@Reinmar
Copy link
Member Author

Reinmar commented Jul 22, 2016

Another idea – instead of build/bundle/ we could have build/dist/. Sounds better for me.

@pjasiun
Copy link

pjasiun commented Jul 25, 2016

Still, note that these paths should be configurable. The structure described above is fine for CKEditor main repo, but if I use it as a dependency I may want to have compiled modules in ckeditor5 folder instead of build/modules/esnext.

@szymonkups
Copy link
Contributor

After merging #287 directory structure looks like this:

build/
    modules/
        amd
        cjs
        esnext
    dist/
    docs/
    README.md

I am wondering if next step should be to rename build task to compile? This will probably lead to renaming ckeditor5-dev-builder to ckeditor5-dev-compiler.

@pjasiun
Copy link

pjasiun commented Aug 9, 2016

Since there is dist folder in it, it makes sense to call it build. At the end of the day it contains build.

But ckeditor5-dev-builder and ckeditor5-dev-bundler-rollup looks bad now, especially with this ticket "Bundler should use builder as depencency". I think they should be renamed:

ckeditor5-dev-builder -> ckeditor5-dev-compiler
ckeditor5-dev-bundler-rollup -> ckeditor5-dev-builder-rollup

@oskarwrobel
Copy link
Contributor

oskarwrobel commented Aug 9, 2016

As I know bundler can but don't have to use our building. When I was talking with @Reinmar his idea was to give possibility to on/off (by some configuration) building in bundling in case of someone will have his own build and will want only to use bundler for bundling.

@szymonkups
Copy link
Contributor

szymonkups commented Aug 10, 2016

Builder package is renamed to ckeditor5-dev-compiler and Wiki pages are updated. Gulp task gulp build is renamed to gulp compile. There is an issue created inside bundler package https://github.com/ckeditor/ckeditor5-dev-bundler-rollup/issues/18 that will continue discussion about renaming it to builder. I am closing this ticket as most of the job described here is done/described by follow ups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants