You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/08/30 13:41:31 UTC
[GitHub] [beam] alexeyinkin opened a new pull request, #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
alexeyinkin opened a new pull request, #22960:
URL: https://github.com/apache/beam/pull/22960
Resolves #22354 #22363 #22361
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`).
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/get-started-contributing/#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r958532408
##########
website/www/site/assets/js/language-switch-v2.js:
##########
@@ -26,144 +26,240 @@ $(document).ready(function() {
$('html, body').scrollTop(elCurrentHeight - elPreviousOffsetFromViewPort);
}
Review Comment:
Integrating these messages could be done with less changes, but I took the chance to refactor this file.
The mechanism here had a lot of problems:
- Unclear use of terms: `id`, `name`, `prefix`, `wrapper`. Changed all of that to only one: `name`.
- Unclear use of terms: `lang`, `langs` (even to mean a single string), `pref`, `type`, `value`. Changed to only `value` / `values`.
- Inconsistent use of `default` term: it was `java` at the invocation and `language-java` later. Changed to a short value without a prefix.
- Inconsistent use of strings like `java` and `language-java`, redundant conversion between them, redundant storage of `language-xxx` as the value for `language` setting.
- `langs` was used for values even when rendering switches other than `language`.
- Special casing for turning 'py' to 'python' in a ternary was not scalable if new special cases appear. Changed to a scalable `valueToTabTitle()` method.
- Forced capitalizing of values like "java" -> "Java" was forbidding the proper case for "TypeScript".
So all of that justifies the big change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] pabloem merged pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
pabloem merged PR #22960:
URL: https://github.com/apache/beam/pull/22960
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r958532408
##########
website/www/site/assets/js/language-switch-v2.js:
##########
@@ -26,144 +26,240 @@ $(document).ready(function() {
$('html, body').scrollTop(elCurrentHeight - elPreviousOffsetFromViewPort);
}
Review Comment:
Integrating these messages could be done with less changes, but I took the chance to refactor this file.
The mechanism here had a lot of problems:
- Unclear use of terms: `id`, `name`, `prefix`, `wrapper`. Changed all of that to only one: `name`.
- Unclear use of terms: `lang`, `langs` (even to mean a single string), `pref`, `value`. Changed to only `value` / `values`.
- Inconsistent use of `default` term: it was `java` at the invocation and `language-java` later. Changed to a short value without a prefix.
- Inconsistent use of strings like `java` and `language-java`, redundant conversion between them, redundant storage of `language-xxx` as the value for `language` setting.
- `langs` was used for values even when rendering switches other than `language`.
- Special casing for turning 'py' to 'python' in a ternary was not scalable if new special cases appear. Changed to a scalable `valueToTabTitle()` method. We can also easily add the coming use of `TypeScript` which otherwise would have been capitalized as `Typescript`.
So all of that justifies the big change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on PR #22960:
URL: https://github.com/apache/beam/pull/22960#issuecomment-1234285475
R: @pcoet
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] pabloem commented on pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
pabloem commented on PR #22960:
URL: https://github.com/apache/beam/pull/22960#issuecomment-1262645141
we don't really have any experts on the shortcodes. I took a look and they look alright to me. merging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r961399987
##########
website/www/site/assets/scss/_playground.sass:
##########
@@ -17,6 +17,14 @@
@import "media"
+.code-snippet-playground
+ padding: 0
+ background: none!important
Review Comment:
It overrides this `!important`: https://github.com/apache/beam/blob/acd0134ec61151336ccd49ff8a58b4d3675def6d/website/www/site/assets/scss/_global.sass#L112
Which in turn overrides this grey background for snippets introduced 6 years ago:
https://github.com/apache/beam/blob/acd0134ec61151336ccd49ff8a58b4d3675def6d/website/www/site/assets/scss/_syntax-highlighting.scss#L22
I removed that and all `!important`s that grew from it and see no difference, thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] pcoet commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
pcoet commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r961047128
##########
website/www/site/assets/scss/_playground.sass:
##########
@@ -17,6 +17,14 @@
@import "media"
+.code-snippet-playground
+ padding: 0
+ background: none!important
Review Comment:
I'm assuming that we need to use `!important` here -- better to avoid it if we can.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r958535384
##########
website/www/site/assets/scss/_capability-matrix.scss:
##########
@@ -305,6 +305,9 @@ nav.runner-switcher {
border-top-right-radius: 6px;
border-bottom: none;
padding-left: 0 !important;
+ &:not(:last-child) {
+ border-right: none;
+ }
Review Comment:
This fixes the double-pixel border for adjacent tabs:

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] pcoet commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
pcoet commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r961039656
##########
website/www/site/assets/scss/_capability-matrix.scss:
##########
@@ -304,7 +304,6 @@ nav.runner-switcher {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom: none;
- padding-left: 0 !important;
Review Comment:
Please make sure removing this doesn't have unintended side effects. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r959571841
##########
website/www/site/assets/scss/_capability-matrix.scss:
##########
@@ -304,7 +304,6 @@ nav.runner-switcher {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-bottom: none;
- padding-left: 0 !important;
Review Comment:
This and a similar change below fixes the missing left padding:

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] github-actions[bot] commented on pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22960:
URL: https://github.com/apache/beam/pull/22960#issuecomment-1234286983
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alevtinaboiko commented on pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alevtinaboiko commented on PR #22960:
URL: https://github.com/apache/beam/pull/22960#issuecomment-1234279767
Verified, works as expected. Reviewed and tested by QA
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on a diff in pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on code in PR #22960:
URL: https://github.com/apache/beam/pull/22960#discussion_r958532408
##########
website/www/site/assets/js/language-switch-v2.js:
##########
@@ -26,144 +26,240 @@ $(document).ready(function() {
$('html, body').scrollTop(elCurrentHeight - elPreviousOffsetFromViewPort);
}
Review Comment:
Integrating these messages could be done with less changes, but I took the chance to refactor this file.
The mechanism here had a lot of problems:
- Unclear use of terms: `id`, `name`, `prefix`, `wrapper`. Changed all of that to only one: `name`.
- Unclear use of terms: `lang`, `langs` (even to mean a single string), `pref`, `type`, `value`. Changed to only `value` / `values`.
- Inconsistent use of `default` term: it was `java` at the invocation and `language-java` later. Changed to a short value without a prefix.
- Inconsistent use of strings like `java` and `language-java`, redundant conversion between them, redundant storage of `language-xxx` as the value for `language` setting.
- `langs` was used for values even when rendering switches other than `language`.
- Special casing for turning 'py' to 'python' in a ternary was not scalable if new special cases appear. Changed to a scalable `valueToTabTitle()` method. We can also easily add the coming use of `TypeScript` which otherwise would have been capitalized as `Typescript`.
So all of that justifies the big change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] alexeyinkin commented on pull request #22960: Send JavaScript messages to Playground iframes when switching the language in docs (#22361)
Posted by GitBox <gi...@apache.org>.
alexeyinkin commented on PR #22960:
URL: https://github.com/apache/beam/pull/22960#issuecomment-1237136991
@pabloem can you review the shortcodes or suggest who can?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org