Proto commits in bazelbuild/rules_closure

These 21 commits are when the Protocol Buffers files have changed:

Commit:ed89345
Author:Goktug Gokdogan
Committer:GitHub

Remove protobuf support. (#639) With archiving of Closure Libraries and official implementation still relying on them makes it impractial to continue supporting protos at the moment. For now, I will remove the support so we can move forward with migration but this will be something we need to figure this out later on.

The documentation is generated from this commit.

Commit:165b1c8
Author:Goktug Gokdogan
Committer:GitHub

Remove soy support (#630)

Commit:01d45e9
Author:Goktug Gokdogan
Committer:GitHub

Updates Closure Compiler & Library to latest versions. (#541) This also updates protobuf and Closure template dependencies. The patch removes //closure/library since Closure Library recently updated to include necessary BUILD targets under @com_google_javascript_closure_library//closure/goog. For migration: Most users can do replace @io_bazel_rules_closure//closure/library with @com_google_javascript_closure_library//closure/goog. Note that :all_js targets are not provided and can be replaced with specific targets in the particular package. Closes #528, Closes #525, Closes #516, Closes #504, Closes #412

Commit:619f575
Author:Andrew Rossignol
Committer:GitHub

Simplify closure_proto_library include path generation (#537) * Simplify closure_proto_library include path generation Rather than attempt to build include paths, let's just use the paths that bazel provides. This resolves a bug with generated protos that are placed in a virtual import directory, causing missing import errors due to gaps in the removed logic that attempt to rebuild import paths. * Add a test for closure_proto_library with external deps

Commit:dafab69
Author:Dmitry Lomov
Committer:GitHub

Revert "Format .bzl files with buildifier." (#289) * Revert "Format .bzl files with buildifier." This reverts commit 7b4b99dba7f3414404f1e2e59b37a948e0a70bfd.

Commit:66f2b3a
Author:Dmitry Lomov

Revert "Format .bzl files with buildifier." This reverts commit 7b4b99dba7f3414404f1e2e59b37a948e0a70bfd.

Commit:7b4b99d
Author:Vladimir Moskva
Committer:Dmitry Lomov

Format .bzl files with buildifier. PIPER=203390014

Commit:dbb9684
Author:Yannic
Committer:Justine Tunney

Modernize JS protobuf rule (#263) Fixes #190

Commit:dfc0f84
Author:jart
Committer:Justine Tunney

Allow command line args for dev web server These args come in protobuf text format (pbtxt) style. For example: bazel run @io_bazel_rules_closure[] -- bind:\"127.0.0.1:9011\" no_reloader:true The no_reloader flag has also been added, which causes the ibazel file system monitoring of build graph changes to no longer happen. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=160699738

Commit:f4878a4
Author:Justine Tunney
Committer:Justine Tunney

Introduce webfiles zip helpers The web compiler will be using zip files in two capacities: 1. To store object files produced by each incremental compilation rule. Think of these .i.zip files (incremental zips) as like jars. They contain both the raw sources, and also possibly intermediate serialized AST cache variations. It might also contain magic files that the compiler pulled out from embedded <script> tags into their own files. These zips use light compression to favor speed. It is also smart enough to know which files are already compressed, e.g. jpeg, and not bother compressing them further. 2. To create deploy archives. Unlike incremental zips, deploy zips contain a minimal calculation of the transitive closure of assets which takes into consideration the links the compiler determined between files, along with things like runtime_deps edges. These zip files are optimized for heavy compression to favor small size. Special care is taken of course to ensure the timestamps inherent in the zip standard remain deterministic. It is also worthing noting that the design introduced by this CL is already deprecated. Bazel has a TreeArtifact feature which will replace this system, once it's ready. After speaking with the Bazel team, they communicated this will be a difficult API to design, and as a result, are taking their time to make sure it's done right on the first try. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=153208438

Commit:ab327d1
Author:Justine Tunney
Committer:Justine Tunney

Improve abstraction for Bazel persistent workers Closure Rules has historically used PersistentWorker to inject commands that are to be run, either as traditional commands, or via the stdio worker protocol that Bazel uses. This CL extends PersistentWorker so it introduces a new @ActionScope so that each command invocation can have its own independent object graph. When creating this subgraph, PersistentWorker seeds it with the arguments List, a result code AtomicBoolean, and a Map of input digests for input file caching, By doing this, each particular command that's incorporated into the persistent worker dæmon can have a rich object graph, where modules can translate command line parameters into richly typed objects, such as the set of direct, runtime, and transitive dependencies. Best of all, since @ActionScope still has access to its parent @Singleton scope, it can cache values such as ASTs in weak maps between action invocations, which can greatly improve the performance of compilations. This is especially important for Bazel users who do not have Forge. Dependency injection is not a strict requirement, considering it is not used by the Blaze codebase. However we feel it might be appropriate here, because DI is very standard practice for web development teams at Google. We hope that by using DI, we can attract more such teams to this codebase. We also want to ensure that if existing DI-based web projects at Google are able to be made open source, that this codebase will be able to be replaced with those solutions more easily. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=150973116

Commit:5b7127a
Author:jart
Committer:Justine Tunney

Increment webfiles server port on BindException ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148114712

Commit:0ca5280
Author:Justine Tunney
Committer:Justine Tunney

Add build graph reloading to webfiles dev server If webfiles is being used with iblazé, then the srcs in rules, and dependency relationships between rules might change while the server is running. The server will now monitor the file system for changes in the build graph and reload it the instant that happens. This happens instantaneously. It works by reading the entire transitive closure of proto manifests upon encountering the first file change event. If another file change event happens while the build graph is being reloaded, then it will interrupt the thread reading the manifests and start over. Doing this elegantly required paying off a lot of technical debt. The dev web server now uses dependency injection. We also have a lot of tests now, which is nice. It's very clean. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=147782934

Commit:a0ec40e
Author:Justine Tunney
Committer:Justine Tunney

Document closure_js_library and exports providers This change also loosens the restriction a little bit to make exports a more universal feature. It also renames the roots provider to js_module_roots. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=141232430

Commit:5a8d6df
Author:jart
Committer:Justine Tunney

Introduce webfiles() and development web server The webfiles() rule has been designed primarily for supporting Polymer web components, but it's general purpose enough to serve the needs of any web developer. It allows each piece of a website to be defined in terms of the relationships between source files. This is validated by checking the src/href/url attributes to make sure the referenced files exist. Vulcanization support will also be reinvented shortly. Each webfiles() rule is executable. It starts a lightweight Jetty web server that serves up the transitive closure of dependencies with directory listings and live source reloading. This rule is capable of serving as a Fileset() replacement, which means it will be extended in the near future create zip/war archives. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139121978

Commit:64f93d9
Author:Justine Tunney
Committer:GitHub

Sync changes from Google internal repository (#167) 1. The closure_js_binary pedantic flag has been removed. 2. closure_js_binary is now stricter than pedantic by default. All the lovely warnings are now enabled and treated as errors unless suppressed. This even includes the ones --jscomp_error=* is too timid to enable, e.g. reportUnknownTypes. This is going to break your codebase, and it's going to break it hard. But you're going to be extremely happy your codebase is broken, due to all the hard work we've put into our error reporting and suppression system. Once you suppress all the warnings you don't care to fix in things like vendor libraries, you're going to find so many bugs in your code. The reportUnknownTypes compiler pass is amazing in the sense that it removes all the wishy washy leniency from the compiler. Your code will either be completely type safe, or the compiler will tell you it isn't. Regardless of whether or not you're `defs=["--new_type_inf"]`, you'll never again have to play guessing games about whether or not a `@type` tag is superfluous. The great mystery of the Closure Compiler will finally be easy to understand. 3. Each compiler error printed by closure_js_library and closure_js_binary will now show instructions on how to use the suppress attribute and `@suppress` JSDoc tag to make it go away. 4. Fixed #157 by making the closure_js_library convention flag now disable appropriate linter errors. See Diagnostics.java for more information. 5. If suppress codes are specified in a closure_js_library that aren't specific to linting, then they will be propagated up to any closure_js_binary rule linking that library automatically, and suppressed there. This is a long awaited feature. The fact that we didn't have this in the past is the reason why we never felt comfortable enabling all the errors by default. 6. A suppress attribute has been added to closure_js_binary, but please don't use it. It's strongly recommended that suppress codes be placed on library rules. Even if that leads to a lot of extra lines of BUILD code. Locality and strong definitions are a virtue in BUILD files. This feature is provided solely as an escape hatch for situations where the user might have a broken build due to a dependency in a different repository that can't be modified. 7. An includes attribute has been added to closure_js_library. It works the same way as the includes attribute on cc_library. It's meant for trimming directory prefixes off ES6 module paths, which are normally relative to the root of the repository. See also #16 8. The calculation of ES6 module paths across repositories has now been greatly improved. 9. Each Skylark rule now returns one provider which is a struct containing whatever. This makes providers less anarchistic and polymorphic relationships easier to grok. 10. Lots of literate documentation to make life easier for maintainers. 11. Some edge cases were fixed with the exports attribute. 12. PhantomJS tests will now retry automatically on transient errors. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138916383

Commit:5f7bbd7
Author:Justine Tunney
Committer:GitHub

Don't create new JVM for each compilation (#143) This commit causes `bazel build //closure/...` to go ~5x faster with RAM consumption reduced by about 10GB. This was done by adding support for Bazel worker processes to our modded version of the Closure Compiler. To take advantage of this new development, you must put the following in your ~/.bazelrc file: build --strategy=Closure=worker This flag encompasses both JsChecker and JsCompiler. In the future, it will also cover Closure Templates and Closure Stylesheets. However these have not yet been incorporated into the worker process. Fixed #77

Commit:1cae287
Author:Andy Hochhaus
Committer:Justine Tunney

Integrate JS soy proto support (#124)

Commit:9dd5f99
Author:Justine Tunney

Make JsChecker a Bazel worker (#95) This change significantly improves the performance of closure_js_library when --strategy=JsChecker=worker is passed to Bazel. Now it won't have to spin up a new JVM for every single library rule.

Commit:315e344
Author:Andy Hochhaus
Committer:Justine Tunney

Rename closure_proto_js_library to closure_js_proto_library (#90) Per discussion in Issue #89.

Commit:93fb8d4
Author:hochhaus
Committer:Justine Tunney

Add closure_proto_js_library (#68)