Commit 28f77a18 authored by Shane Hughes's avatar Shane Hughes
Browse files

Bug 1786582 - Update fluent and fluent-react in newtab. r=barret

parent 188bd7bf
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ import { actionTypes as at } from "common/Actions.sys.mjs";
import { ASRouterUtils } from "./asrouter-utils";
import { generateBundles } from "./rich-text-strings";
import { ImpressionsWrapper } from "./components/ImpressionsWrapper/ImpressionsWrapper";
import { LocalizationProvider } from "fluent-react";
import { LocalizationProvider, ReactLocalization } from "@fluent/react";
import { NEWTAB_DARK_THEME } from "content-src/lib/constants";
import React from "react";
import ReactDOM from "react-dom";
@@ -285,7 +285,9 @@ export class ASRouterUISurface extends React.PureComponent {
        // This helps with testing
        document={this.props.document}
      >
        <LocalizationProvider bundles={generateBundles(content)}>
        <LocalizationProvider
          l10n={new ReactLocalization(generateBundles(content))}
        >
          <SnippetComponent
            {...this.state.message}
            UISurface="NEWTAB_FOOTER_BAR"
+11 −9
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

import { Localized } from "fluent-react";
import { Localized } from "@fluent/react";
import React from "react";
import { RICH_TEXT_KEYS } from "../../rich-text-strings";
import { safeURI } from "../../template-utils";
@@ -69,14 +69,16 @@ export function RichText(props) {
  return (
    <Localized
      id={props.localization_id}
      {...ALLOWED_TAGS}
      {...props.customElements}
      {...convertLinks(
      elems={{
        ...ALLOWED_TAGS,
        ...props.customElements,
        ...convertLinks(
          props.links,
          props.sendClick,
          props.doNotAutoBlock,
          props.openNewWindow
      )}
        ),
      }}
    >
      <span>{props.text}</span>
    </Localized>
+2 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

import { FluentBundle } from "fluent";
import { FluentBundle, FluentResource } from "@fluent/bundle";

/**
 * Properties that allow rich text MUST be added to this list.
@@ -38,7 +38,7 @@ export function generateBundles(content) {
      const attr = attrsToTry.pop();
      string = content[attr];
    }
    bundle.addMessages(`${key} = ${string}`);
    bundle.addResource(new FluentResource(`${key} = ${string}`));
  });
  return [bundle];
}
+1033 −1110

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ module.exports = function(config) {
          },
          {
            test: /\.js$/,
            exclude: [/node_modules\/(?!(fluent|fluent-react)\/).*/, /test/],
            exclude: [/node_modules\/(?!@fluent\/).*/, /test/],
            loader: "babel-loader",
            options: {
              // This is a workaround for bug 1787278. It can be removed once
Loading