-
Notifications
You must be signed in to change notification settings - Fork 1.7k
refactor: remove deprecated Sass wrapper macros #7103
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,45 +249,6 @@ def tf_svg_bundle(name, srcs, out): | |
| ], | ||
| ) | ||
|
|
||
| def tf_sass_binary(deps = [], include_paths = [], strict_deps = True, **kwargs): | ||
| """TensorBoard wrap for declaring SASS binary. | ||
|
|
||
| It adds dependency on theme by default then add include Angular material | ||
| theme library paths for better node_modules library resolution. | ||
|
|
||
| strict_deps is included here and intentionally ignored so it can be used | ||
| internally. | ||
| """ | ||
| sass_binary( | ||
| deps = deps, | ||
| include_paths = include_paths + [ | ||
| "external/npm/node_modules", | ||
| ], | ||
| sourcemap = False, | ||
| **kwargs | ||
| ) | ||
|
|
||
| def tf_sass_library(**kwargs): | ||
| """TensorBoard wrap for declaring SASS library. | ||
|
|
||
| It re-exports the sass_libray symbol so users do not have to depend on | ||
| "@io_bazel_rules_sass//:defs.bzl". | ||
| """ | ||
| sass_library( | ||
| **kwargs | ||
| ) | ||
|
|
||
| def tf_external_sass_libray(**kwargs): | ||
| """TensorBoard wrapper for declaring external SASS dependency. | ||
|
|
||
| When an external (NPM) package have SASS files that has `import` statements, | ||
| TensorBoard has to depdend on them very specifically. This rule allows SASS | ||
| modules in NPM packages to be built properly. | ||
| """ | ||
| npm_sass_library( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can also remove the "load" statement at the top for these rules. |
||
| **kwargs | ||
| ) | ||
|
|
||
| def tf_ng_module(assets = [], **kwargs): | ||
| """TensorBoard wrapper for Angular modules.""" | ||
| tf_ts_library( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| load("//tensorboard/defs:defs.bzl", "tf_external_sass_libray", "tf_ng_module", "tf_ng_prod_js_binary", "tf_ng_web_test_suite", "tf_sass_binary", "tf_svg_bundle", "tf_ts_library") | ||
| load("@io_bazel_rules_sass//:defs.bzl", "npm_sass_library", "sass_binary") | ||
| load("//tensorboard/defs:defs.bzl", "tf_ng_module", "tf_ng_prod_js_binary", "tf_ng_web_test_suite", "tf_svg_bundle", "tf_ts_library") | ||
| load("//tensorboard/defs:js.bzl", "tf_resource_digest_suffixer") | ||
| load("//tensorboard/defs:web.bzl", "tb_combine_html", "tf_web_library") | ||
|
|
||
|
|
@@ -86,9 +87,10 @@ tf_ts_library( | |
| ], | ||
| ) | ||
|
|
||
| tf_sass_binary( | ||
| sass_binary( | ||
| name = "app_styles", | ||
| src = "app_container.scss", | ||
| include_paths = ["external/npm/node_modules"], | ||
| deps = ["//tensorboard/webapp/theme"], | ||
| ) | ||
|
|
||
|
|
@@ -379,13 +381,14 @@ tf_svg_bundle( | |
| out = "icon_bundle.svg", | ||
| ) | ||
|
|
||
| tf_external_sass_libray( | ||
| npm_sass_library( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this rule is not available internally. We might need to either in-line this dependency wherever it's used, or modify this to be a plain "sass_library", which AFAIU would require creating a file that The downside of in-lining it everywhere would be that if at some point we need or want another common dependency everywhere where this one is used, then we'd have to do that manually, or recreate this wrapper at that time and update all references anyway. This sass_library wrapper would be useful to not have to update every place where this is currently used in that case, although I think that's somewhat unlikely. Up to you, either way is fine by me. |
||
| name = "angular_material_sass_deps", | ||
| deps = ["@npm//@angular/material"], | ||
| ) | ||
|
|
||
| tf_sass_binary( | ||
| sass_binary( | ||
| name = "styles", | ||
| src = "styles.scss", | ||
| include_paths = ["external/npm/node_modules"], | ||
| deps = ["//tensorboard/webapp/theme"], | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's uncommon to say
most recent as of <a date in the past>, although perhaps technically correct (?).Can we rephrase to say something like "This version was the latest one available when rules_nodejs 5.8.1 was released, so we use it because we know they're compatible", or "This version is used by rules_nodejs 5.8.1", or something like that.