Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Restructure Compiler #130

Closed
ebollens opened this issue Nov 10, 2012 · 4 comments · Fixed by #138
Closed

Restructure Compiler #130

ebollens opened this issue Nov 10, 2012 · 4 comments · Fixed by #138
Assignees
Milestone

Comments

@ebollens
Copy link
Contributor

The compiler is in a much better state than it used to be, but there are still some issues:

  • Packages are forced to run in a particular step of execution (first). This is bad because it prevents a package (like the one in https://github.com/ebollens/OptiCSS that I'm to add in CSS Optimizers #56) from being able to run later during execution. To get around this, we should provide a hooking interface.
  • The object orientation is a bit limited in power because it's too constrained by traditional structures that we see in languages like PHP and Java, where in reality Ruby's OO implementation is a lot more flexible (with things like open classes). I'd like to make this more "Ruby-like" so that it's more digestible. Will likely add an internal DSL to assist with this.
  • There are two bits of functionality that need to be built directly into the builder: watch (see Compass Watch-like Functionality #80) and dependency management (see Investigate Bower for Dependency Management #104).

As such, I'm going to be doing a refactor of this for the next milestone.

@ebollens
Copy link
Contributor Author

I believe the code in https://github.com/ebollens/WebBlocks/tree/architecture/builder is now ready to be merged. The compile in my environment produces the same visible outputs as the old builder. @loganfranken @atsengucla @ccheung can you clone the ebollens/WebBlocks repo, check out the architecture/builder branch and confirm that it indeed compiles in your environment by calling Rake?

While I'll formalize my thoughts more in an update to the architecture docs, a few wins up front...

  • The architecture is now based on the observable pattern and hooks for extensibility.
  • The execution stack with clear and understandable phases.
  • A DSL allows one to run this in other environments besides Rake.
  • Far more trivial now to add additional packages and adapters.
  • Packages can now attach to any point in the execution stack because its observable.
  • Improved modularity supports separate build_css, build_js and build_img calls in addition to build.
  • Tossed in better support for the -ie suffix.
  • Organization is far more clear in terms of purpose and now far easier to write package/adapter handlers.
  • Completely backwards compatible with what we already have.

Before filing the merge request itself, I will add documentation for this tomorrow, which will explain all the improvements and how to better attach to the architecture.

@loganfranken
Copy link
Contributor

Hey @ebollens, everything seemed to compile correctly except that I ran into the tricky #106 issue. After putting a distribution of jQuery in the appropriate directory, everything ran smoothly. I'll try and dig a little deeper and see if I can figure out why grunt didn't run (I even ran it myself and it didn't seem to do anything, which was a little strange).

@ebollens
Copy link
Contributor Author

@brendanmurphy is also reporting the jQuery build issue. I'm going to throw some more cycles at this today.

@ebollens
Copy link
Contributor Author

@brendanmurphy and @loganfranken what operating system are you running? I'm guessing this is maybe something like what happened with the other Node-related stuff.

ebollens added a commit that referenced this issue Feb 22, 2013
ebollens added a commit that referenced this issue Feb 22, 2013
ebollens added a commit that referenced this issue Feb 22, 2013
ebollens added a commit that referenced this issue Feb 22, 2013
ebollens added a commit that referenced this issue Feb 22, 2013
ebollens added a commit that referenced this issue Feb 22, 2013
ebollens added a commit that referenced this issue Feb 22, 2013
ebollens pushed a commit that referenced this issue Feb 22, 2013
Refactor builder architecture [fixes #130] [fixes #131] [fixes #97]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants