This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 3a9e2d4f557 Performance improvements (#27119)
3a9e2d4f557 is described below

commit 3a9e2d4f557857dd57b5c512407a9688ff3b45cb
Author: alexeyinkin <[email protected]>
AuthorDate: Wed Jun 21 19:28:25 2023 +0400

    Performance improvements (#27119)
    
    * Performance improvements
    
    * Add a missing file
---
 .../shortcuts/constants/global_shortcuts.dart      |  2 +-
 .../lib/src/repositories/backend_urls.dart         |  8 ++---
 .../playground_components/lib/src/theme/theme.dart |  3 ++
 .../lib/src/theme/transitions.dart                 | 35 ++++++++++++++++++++++
 playground/frontend/web/index.html                 |  3 +-
 5 files changed, 44 insertions(+), 7 deletions(-)

diff --git 
a/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart 
b/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart
index 4c762e1c6c3..30ba033fac6 100644
--- a/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart
+++ b/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart
@@ -51,7 +51,7 @@ final kNewExampleShortcut = BeamShortcut(
   ],
   actionIntent: const NewExampleIntent(),
   createAction: (_) => CallbackAction(
-    onInvoke: (_) => launchUrl(Uri.parse('/')),
+    onInvoke: (_) => launchUrl(Uri.parse(BeamLinks.newExample)),
   ),
 );
 
diff --git 
a/playground/frontend/playground_components/lib/src/repositories/backend_urls.dart
 
b/playground/frontend/playground_components/lib/src/repositories/backend_urls.dart
index 7654a8afcd6..cfd2860e894 100644
--- 
a/playground/frontend/playground_components/lib/src/repositories/backend_urls.dart
+++ 
b/playground/frontend/playground_components/lib/src/repositories/backend_urls.dart
@@ -95,11 +95,11 @@ List<Uri> _getBackendUrlOptions(String node) {
   }
 
   final currentHost = Uri.base.host;
-  final nodeUriFromCurrentHost = Uri.base.replace(
+  final nodeUriFromCurrentHost = Uri(
+    scheme: Uri.base.scheme,
     host: '$node.$currentHost',
-    path: '',
-    queryParameters: {},
-  ).removeFragment();
+    port: Uri.base.port,
+  );
 
   return {
     nodeUriFromCurrentHost.toString(),
diff --git a/playground/frontend/playground_components/lib/src/theme/theme.dart 
b/playground/frontend/playground_components/lib/src/theme/theme.dart
index 28efa7f3a25..dd18fa4e3c0 100644
--- a/playground/frontend/playground_components/lib/src/theme/theme.dart
+++ b/playground/frontend/playground_components/lib/src/theme/theme.dart
@@ -22,6 +22,7 @@ import 
'package:flutter_markdown_selectionarea/flutter_markdown.dart';
 import 'package:google_fonts/google_fonts.dart';
 
 import '../../playground_components.dart';
+import 'transitions.dart';
 
 const codeFontSize = 14.0;
 
@@ -171,6 +172,7 @@ final kLightTheme = ThemeData(
     BeamLightThemeColors.text,
     BeamLightThemeColors.primary,
   ),
+  pageTransitionsTheme: NoTransitionsTheme(),
   primaryColor: BeamLightThemeColors.primary,
   scaffoldBackgroundColor: BeamLightThemeColors.secondaryBackground,
   selectedRowColor: BeamLightThemeColors.selectedUnitColor,
@@ -248,6 +250,7 @@ final kDarkTheme = ThemeData(
     BeamDarkThemeColors.text,
     BeamDarkThemeColors.primary,
   ),
+  pageTransitionsTheme: NoTransitionsTheme(),
   primaryColor: BeamDarkThemeColors.primary,
   scaffoldBackgroundColor: BeamDarkThemeColors.secondaryBackground,
   selectedRowColor: BeamDarkThemeColors.selectedUnitColor,
diff --git 
a/playground/frontend/playground_components/lib/src/theme/transitions.dart 
b/playground/frontend/playground_components/lib/src/theme/transitions.dart
new file mode 100644
index 00000000000..8388ba37775
--- /dev/null
+++ b/playground/frontend/playground_components/lib/src/theme/transitions.dart
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import 'package:flutter/material.dart';
+
+/// Disables page transitions.
+///
+/// See 
https://medium.com/flutter/improving-perceived-performance-with-image-placeholders-precaching-and-disabled-navigation-6b3601087a2b
+class NoTransitionsTheme extends PageTransitionsTheme {
+  @override
+  Widget buildTransitions<T>(
+    PageRoute<T> route,
+    BuildContext context,
+    Animation<double> animation,
+    Animation<double> secondaryAnimation,
+    Widget child,
+  ) {
+    return child;
+  }
+}
diff --git a/playground/frontend/web/index.html 
b/playground/frontend/web/index.html
index cb7ab505253..bed71f2f21e 100644
--- a/playground/frontend/web/index.html
+++ b/playground/frontend/web/index.html
@@ -61,8 +61,7 @@
     textarea ~ grammarly-extension {
       display: none;
     }
-
-    </style>
+  </style>
 </head>
 <body>
 <!-- This script installs service_worker.js to provide PWA functionality to

Reply via email to