Skip to content

Commit

Permalink
Merge branch 'trunk' into gutenberg/fix-highlight-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo committed Mar 21, 2024
2 parents a95c884 + a9eb189 commit 0b97ec3
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 65 deletions.
25 changes: 25 additions & 0 deletions Gutenberg/cocoapods_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

GUTENBERG_CONFIG_PATH = File.join(__dir__, '..', 'Gutenberg', 'config.yml')

# We skip the simulator architecture as we only need to extract the bundle and source map for installable builds.
GUTENBERG_FRAMEWORK_FOLDER = File.join(__dir__, '..', 'Pods', 'Gutenberg', 'Frameworks', 'Gutenberg.xcframework', 'ios-arm64', 'Gutenberg.framework')
GUTENBERG_BUNDLE_SOURCE_MAP_TARGET = File.join(__dir__, '..', 'Pods', 'Gutenberg', 'react-native-bundle-source-map')

LOCAL_GUTENBERG_KEY = 'LOCAL_GUTENBERG'

# Note that the pods in this array might seem unused if you look for
Expand Down Expand Up @@ -115,6 +119,8 @@ def apply_rnreanimated_workaround!(dependencies:, gutenberg_path:)
end

def gutenberg_post_install(installer:)
extract_bundle_source_map_files unless should_use_local_gutenberg

return unless should_use_local_gutenberg

raise "[Gutenberg] Could not find local Gutenberg at given path #{local_gutenberg_path}" unless File.exist?(local_gutenberg_path)
Expand Down Expand Up @@ -207,3 +213,22 @@ def workaround_broken_search_paths
end
project.save
end

# Copy Gutenberg bundle and source map files so they can be upload it to Sentry during the build process.
def extract_bundle_source_map_files
puts '[Gutenberg] Extracting bundle and source map files'

FileUtils.mkdir_p(GUTENBERG_BUNDLE_SOURCE_MAP_TARGET)
bundle_from_path = File.join(GUTENBERG_FRAMEWORK_FOLDER, 'App.js')
bundle_destination_path = File.join(GUTENBERG_BUNDLE_SOURCE_MAP_TARGET, 'main.jsbundle')
FileUtils.cp(bundle_from_path, bundle_destination_path)

# Source map file is moved instead of copied to avoid including it in the binary.
source_map_from_path = File.join(GUTENBERG_FRAMEWORK_FOLDER, 'App.composed.js.map')
source_map_destination_path = File.join(GUTENBERG_BUNDLE_SOURCE_MAP_TARGET, 'main.jsbundle.map')
if File.exist?(source_map_from_path)
FileUtils.mv(source_map_from_path, source_map_destination_path)
elsif !File.exist?(source_map_destination_path)
raise "[Gutenberg] Source map \"#{source_map_from_path}\" could not be found. Please verify that the Gutenberg version includes the file or reinstall the pod."
end
end
2 changes: 1 addition & 1 deletion Modules/Sources/DesignSystem/Components/DSButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public struct DSButton: View {
@ViewBuilder
private var buttonLabel: some View {
if let iconName {
HStack(alignment: .center, spacing: Length.Padding.half) {
HStack(alignment: .center, spacing: .DS.Padding.half) {
Image.DS.icon(named: iconName)
.imageScale(.small)
.foregroundStyle(style.foregroundColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ private extension SiteStatsPeriodTableViewController {
}

func applyTableUpdates() {
tableView.performBatchUpdates({
})
tableHandler.diffableDataSource.apply(viewModel.tableViewSnapshot(), animatingDifferences: false)
}

func clearExpandedRows() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private extension WhatIsNewScenePresenter {
}

private func shouldUseDashboardCustomView() -> Bool {
return self.store.appVersionName == "24.4"
return true
}

enum WhatIsNewStrings {
Expand Down
12 changes: 3 additions & 9 deletions WordPress/Jetpack/Resources/AppStoreStrings.po
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,10 @@ msgctxt "app_store_keywords"
msgid "social,notes,jetpack,writing,geotagging,media,blog,website,blogging,journal"
msgstr ""

msgctxt "v24.4-whats-new"
msgctxt "v24.5-whats-new"
msgid ""
"The Stats screen has a new Traffic tab. Get better graphs and access all your historical data in one place. That’s right, you’ve got data for days… and weeks, and months, and years.\n"
"\n"
"Notifications got a glow-up, giving you a shinier, easier-to-use design. We also made a few changes to the block editor.\n"
"\n"
"- We added support for VideoPress v5, so you should notice better performance in your video blocks.\n"
"- The app won’t crash anymore when the editor auto-scrolls down to a block. No more giving you up or letting you down.\n"
"- You’ll now see an error message when a video fails to upload to media and text blocks.\n"
"- Images no longer appear partly transparent while they’re being uploaded. All color, all the time.\n"
"We’ve introduced a fix that prevents certain bugs within the editor and individual block types. This fix logs any bugs that sneak through so we can squash those, too.\n"
"We also improved your previewing and publishing experience by removing the edit button from the “Post Published” success screen and the publish button from the “Preview” screen. All in a day’s work.\n"
msgstr ""

#. translators: This is a promo message that will be attached on top of the first screenshot in the App Store.
Expand Down
8 changes: 2 additions & 6 deletions WordPress/Jetpack/Resources/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
* [*] [internal] Block editor: Remove code associated to Story block [#22758]
* [**] [internal] Block editor: Upgrade React Native to version 0.73.3 [#22588]
* [*] Remove "Edit" button from "Post Published" screen [#22762]
* [*] Remove "Publish" button from "Preview" screen [#22763]
* [**] Block editor: Add error boundary components and exception logging [#22655]

We’ve introduced a fix that prevents certain bugs within the editor and individual block types. This fix logs any bugs that sneak through so we can squash those, too.
We also improved your previewing and publishing experience by removing the edit button from the “Post Published” success screen and the publish button from the “Preview” screen. All in a day’s work.
9 changes: 3 additions & 6 deletions WordPress/Resources/AppStoreStrings.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ msgctxt "app_store_keywords"
msgid "blogger,writing,blogging,web,maker,online,store,business,make,create,write,blogs"
msgstr ""

msgctxt "v24.4-whats-new"
msgctxt "v24.5-whats-new"
msgid ""
"We made a few changes to the block editor.\n"
"\n"
"- The app won’t crash anymore when the editor auto-scrolls down to a block.\n"
"- You’ll now see an error message when a video fails to upload to media and text blocks.\n"
"- Images no longer appear partly transparent while they’re being uploaded. All color, all the time.\n"
"We’ve introduced a fix that prevents certain bugs within the editor and individual block types. This fix logs any bugs that sneak through so we can squash those, too.\n"
"We also improved your previewing and publishing experience by removing the edit button from the “Post Published” success screen and the publish button from the “Preview” screen. All in a day’s work.\n"
msgstr ""

#. translators: This is a standard chunk of text used to tell a user what's new with a release when nothing major has changed.
Expand Down
8 changes: 2 additions & 6 deletions WordPress/Resources/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
* [*] [internal] Block editor: Remove code associated to Story block [#22758]
* [**] [internal] Block editor: Upgrade React Native to version 0.73.3 [#22588]
* [*] Remove "Edit" button from "Post Published" screen [#22762]
* [*] Remove "Publish" button from "Preview" screen [#22763]
* [**] Block editor: Add error boundary components and exception logging [#22655]

We’ve introduced a fix that prevents certain bugs within the editor and individual block types. This fix logs any bugs that sneak through so we can squash those, too.
We also improved your previewing and publishing experience by removing the edit button from the “Post Published” success screen and the publish button from the “Preview” screen. All in a day’s work.
60 changes: 26 additions & 34 deletions fastlane/lanes/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -532,39 +532,31 @@ def upload_build_to_app_center(
end

def upload_gutenberg_sourcemaps(sentry_project_slug:, release_version:, build_version:, app_identifier:)
# The bundle and source map files are the same for all architectures.
gutenberg_bundle = File.join(PROJECT_ROOT_FOLDER, 'Pods/Gutenberg/Frameworks/Gutenberg.xcframework/ios-arm64/Gutenberg.framework')

Dir.mktmpdir do |sourcemaps_folder|
# It's important that the bundle and source map files have specific names, otherwise, Sentry
# won't symbolicate the stack traces.
FileUtils.cp(File.join(gutenberg_bundle, 'App.js'), File.join(sourcemaps_folder, 'main.jsbundle'))
FileUtils.cp(File.join(gutenberg_bundle, 'App.composed.js.map'), File.join(sourcemaps_folder, 'main.jsbundle.map'))

# To generate the full release version string to attach the source maps, we need to specify:
# - App identifier
# - Release version
# - Build version
# This conforms to the following format: <app_identifier>@<release_version>+<build_version>
# Here are a couple of examples:
# - Prototype build: com.jetpack.alpha@24.2+pr22654-07765b3
# - App Store build: org.wordpress@24.1+24.1.0.3

sentry_upload_sourcemap(
auth_token: get_required_env('SENTRY_AUTH_TOKEN'),
org_slug: SENTRY_ORG_SLUG,
project_slug: sentry_project_slug,
version: release_version,
dist: build_version,
build: build_version,
app_identifier:,
# When the React native bundle is generated, the source map file references
# include the local machine path, with the `rewrite` and `strip_common_prefix`
# options Sentry automatically strips this part.
rewrite: true,
strip_common_prefix: true,
sourcemap: sourcemaps_folder
)
end
gutenberg_bundle_source_map_folder = File.join(PROJECT_ROOT_FOLDER, 'Pods', 'Gutenberg', 'react-native-bundle-source-map')

# To generate the full release version string to attach the source maps, we need to specify:
# - App identifier
# - Release version
# - Build version
# This conforms to the following format: <app_identifier>@<release_version>+<build_version>
# Here are a couple of examples:
# - Prototype build: com.jetpack.alpha@24.2+pr22654-07765b3
# - App Store build: org.wordpress@24.1+24.1.0.3

sentry_upload_sourcemap(
auth_token: get_required_env('SENTRY_AUTH_TOKEN'),
org_slug: SENTRY_ORG_SLUG,
project_slug: sentry_project_slug,
version: release_version,
dist: build_version,
build: build_version,
app_identifier:,
# When the React native bundle is generated, the source map file references
# include the local machine path, with the `rewrite` and `strip_common_prefix`
# options Sentry automatically strips this part.
rewrite: true,
strip_common_prefix: true,
sourcemap: gutenberg_bundle_source_map_folder
)
end
end

0 comments on commit 0b97ec3

Please sign in to comment.