Skip to content
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

Merge upstream v8.2.11 #78

Merged
merged 14 commits into from
Apr 28, 2022
Merged

Merge upstream v8.2.11 #78

merged 14 commits into from
Apr 28, 2022

Conversation

2bndy5
Copy link
Collaborator

@2bndy5 2bndy5 commented Apr 28, 2022

merge in updates from upstream v8.2.11

closes #55

There were 3 files that had conflicts:

src/assets/javascripts/components/search/query/index.ts

Merged in this PR.

--- a/src/assets/javascripts/components/search/query/index.ts
+++ b/src/assets/javascripts/components/search/query/index.ts
@@ -106,6 +106,17 @@ export function watchSearchQuery(
         history.replaceState({}, "", `${url}`)
       })
 
+<<<<<<< ours
+=======
+  /* Set query from parameter */
+  param$.subscribe(value => { // TODO: not ideal - find a better way
+    if (value) {
+      el.value = value
+      el.focus()
+    }
+  })
+
+>>>>>>> theirs
   /* Intercept focus and input events */
   const focus$ = watchElementFocus(el)
   const value$ = merge(
src/assets/javascripts/components/search/result/index.ts

Ignored these changes

--- a/src/assets/javascripts/components/search/result/index.ts
+++ b/src/assets/javascripts/components/search/result/index.ts
@@ -155,5 +155,41 @@ export function mountSearchResult(
           meta.textContent = translation("search.result.placeholder")
         }
       })
+<<<<<<< ours
   return of()
+=======
+
+  /* Update search result list */
+  push$
+    .pipe(
+      tap(() => list.innerHTML = ""),
+      switchMap(({ items }) => merge(
+        of(...items.slice(0, 10)),
+        of(...items.slice(10))
+          .pipe(
+            bufferCount(4),
+            zipWith(boundary$),
+            switchMap(([chunk]) => chunk)
+          )
+      ))
+    )
+      .subscribe(result => list.appendChild(
+        renderSearchResultItem(result)
+      ))
+
+  /* Filter search result message */
+  const result$ = rx$
+    .pipe(
+      filter(isSearchResultMessage),
+      map(({ data }) => data)
+    )
+
+  /* Create and return component */
+  return result$
+    .pipe(
+      tap(state => push$.next(state)),
+      finalize(() => push$.complete()),
+      map(state => ({ ref: el, ...state }))
+    )
+>>>>>>> theirs
 }
tools/build/index.ts

Merged only single line changes and import statements - ignored block changes at bottom

--- a/tools/build/index.ts
+++ b/tools/build/index.ts
@@ -35,14 +35,10 @@ import {
   scan,
   startWith,
   switchMap,
-  switchMapTo,
   toArray,
   zip
 } from "rxjs"
-import {
-  extendDefaultPlugins,
-  optimize
-} from "svgo"
+import { optimize } from "svgo"
 
 import { base, resolve, watch } from "./_"
 import { copyAll } from "./copy"
@@ -79,10 +75,11 @@ function ext(file: string, extension: string): string {
  */
 function minsvg(data: string): string {
   const result = optimize(data, {
-    plugins: extendDefaultPlugins([
+    plugins: [
+      "preset-default",
       { name: "removeDimensions", active: true },
       { name: "removeViewBox", active: false }
-    ])
+    ]
   })
   return result.data || data
 }
@@ -158,7 +155,7 @@ const manifest$ = merge(
       )
         .pipe(
           startWith("*"),
-          switchMapTo(observable$.pipe(toArray()))
+          switchMap(() => observable$.pipe(toArray()))
         )
     ))
 )
@@ -254,6 +251,12 @@ const docs$ = (() => {
 
 })()
 
+/* Build overrides */
+const overrides$ =
+  process.argv.includes("--all")
+    ? merge(index$, schema$)
+    : EMPTY
+
 /* ----------------------------------------------------------------------------
  * Program
  * ------------------------------------------------------------------------- */
@@ -261,6 +264,7 @@ const docs$ = (() => {
 /* Assemble pipeline */
 const templatesBuild$ =
   process.argv.includes("--dirty")
+<<<<<<< ours
     ? templates$
     : concat(assets$, templates$)
 
@@ -268,6 +272,10 @@ const build$: Observable<any> =
   process.argv.includes("--docs")
     ? merge(templatesBuild$, docs$)
     : templatesBuild$
+=======
+    ? merge(templates$, sources$)
+    : concat(assets$, merge(templates$, sources$, overrides$))
+>>>>>>> theirs
 
 /* Let's get rolling */
 build$.subscribe()

2bndy5 and others added 6 commits April 25, 2022 18:33
It appears that one of the dependencies of [email protected] (not
specifically listed in `package.json`) causes an out-of-memory crash,
though it is not yet clear which one.

However, due to the way NPM resolves package versions, it is not
sufficient to merely pin the version of `cssnano` itself, as NPM may
still pull in newer versions of the dependencies.

The correct fix would be to identify the problematic cssnano
dependency and add the package with a version constraint to
`package.json`.  Since the package has not yet been identified,
though, instead this commit merely relies on package-lock.json to
avoid pulling in the problematic package.

The package-lock.json from this commit was created by the following
steps:

1. Reverting package-lock.json to its version prior to the commit that
   merges in changes from upstream v8.2.11.
2. Modifying package.json to pin cssnano to 5.0.17 rather than 5.1.0.
3. Running `npm install` to make the minimal updates to the old
   `package-lock.json` to satisfy the new contents of `package.json`.

Note that deleting `package-lock.json` and then recreating it by
running `npm install` will NOT work; it will pull in the problematic
cssnano dependency.
@2bndy5 2bndy5 requested a review from jbms April 28, 2022 15:56
@2bndy5 2bndy5 linked an issue Apr 28, 2022 that may be closed by this pull request
giscus.json Outdated Show resolved Hide resolved
@@ -106,6 +106,14 @@ export function watchSearchQuery(
history.replaceState({}, "", `${url}`)
})

/* Set query from parameter */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now makes the assignment to el.value and call to el.focus above redundant, so we can remove that.

tools/build/_/index.ts Outdated Show resolved Hide resolved
@@ -106,14 +106,6 @@ export function watchSearchQuery(
history.replaceState({}, "", `${url}`)
})

/* Set query from parameter */
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to keep it, and instead do the removal I mentioned, as that will minimize merge conflicts in the future.

@jbms
Copy link
Owner

jbms commented Apr 28, 2022

As far as the redundant assignment to el.value, I was referring to this line:

const value = el.value = searchParams.get("q")!

(Unfortunately github does not allow you to comment on unmodified lines very easily)

That should be changed to just:

const value = searchParams.get("q")!
param$ = of(value)

@@ -110,7 +110,6 @@ export function watchSearchQuery(
param$.subscribe(value => { // TODO: not ideal - find a better way
if (value) {
el.value = value
el.focus()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to keep the call to el.focus() here and instead remove it from a few lines above in the same file. That way we minimize merge conflicts.

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Apr 28, 2022

This whole review system is all messed up for some reason. I can't even do a simple reply unless I'm looking at the PR diff. And then that seems to look like a separate review comment...

@jbms
Copy link
Owner

jbms commented Apr 28, 2022

Thanks. Just one last change:

8274da5#diff-36117e5373aef262c0fc3e0d37c56bec5d51de771f9d91a7100aa5def753dfb8L90

that line should remove the assignment to el.value

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Apr 28, 2022

oops, I didn't notice that missing bit in the snippet you posted.

@jbms
Copy link
Owner

jbms commented Apr 28, 2022

This looks ready to merge, thanks!

@jbms jbms merged commit 2c69428 into main Apr 28, 2022
@2bndy5 2bndy5 deleted the merge-upstream-v8.2.11 branch April 28, 2022 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resolving merge conflicts with upstream v8.2.11 copy button is not displayed for longer code block
2 participants