Add ability to customize class metadata in j2cl_application macro
@@ -9,6 +9,7 @@ def j2cl_application(
rewrite_polyfills = False,
jre_logging_log_level = "OFF",
jre_checks_check_level = "NORMAL",
+ jre_class_metadata = "STRIPPED",
closure_defines = dict(),
extra_dev_resources = [],
**kwargs):
@@ -42,8 +43,15 @@ def j2cl_application(
Note that development binary will still do checks but will throw
assertion errors instead to prevent user code to incorrectly rely on
specific exceptions to be thrown.
+ jre_class_metadata: the level of class metadata emulated at the runtime.
+ SIMPLE will provide basic metadata like class names, type of class etc.
+ STRIPPED will remove most of the metadata provided at SIMPLE level to
+ reduce the code size in production.
+ Note that development binary will still provide some metadata to help
+ with debugging.
closure_defines: override the value of a variable defined by goog.define.
extra_dev_resources: extra resource to serve for development server.
+ **kwargs: passed to underlying compilation and dev server.
"""
entry_point_defs = ["--entry_point=goog:%s" % e for e in entry_points]
@@ -53,6 +61,7 @@ def j2cl_application(
define_defaults = {
"jre.checks.checkLevel": jre_checks_check_level,
"jre.logging.logLevel": jre_logging_log_level,
+ "jre.classMetadata": jre_class_metadata,
}
_define_js("%s_config" % name, define_defaults, closure_defines)
