@times-components/ssr 2.59.36-alpha.10 → 2.59.36-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@times-components/ssr",
3
3
  "main": "src",
4
- "version": "2.59.36-alpha.10+0027742a05",
4
+ "version": "2.59.36-alpha.15+cb7cb55365",
5
5
  "scripts": {
6
6
  "bundle:dev": "yarn cleanup-dist && webpack --config=webpack.config.js",
7
7
  "bundle:prod": "yarn cleanup-dist && NODE_ENV=production webpack --config=webpack.config.js -p",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "0027742a051e484e066d705cf6c21afc4c011fe4"
82
+ "gitHead": "cb7cb5536546f0ccd26f5760db5c72021a6aa22c"
83
83
  }
@@ -13,6 +13,7 @@ const {
13
13
  defaults
14
14
  } = require("@times-components/context/rnw");
15
15
  const { scales, themeFactory } = require("@times-components/ts-styleguide/rnw");
16
+ const { addAttribute } = require("../lib/add-attribute");
16
17
 
17
18
  const scale = scales.large;
18
19
 
@@ -40,9 +41,6 @@ module.exports = (client, analyticsStream, data, helmetContext) => {
40
41
  isEntitlementFeatureEnabled
41
42
  } = data;
42
43
 
43
- // eslint-disable-next-line no-console
44
- console.log("[SSR Article] Data: ", data);
45
-
46
44
  return React.createElement(
47
45
  HelmetProvider,
48
46
  { context: helmetContext },
@@ -62,9 +60,10 @@ module.exports = (client, analyticsStream, data, helmetContext) => {
62
60
  ? providerData.draftArticle
63
61
  : providerData.article;
64
62
  const articleTemplate = article ? article.template : null;
63
+ const formattedArticle = addAttribute(article);
65
64
 
66
65
  // eslint-disable-next-line no-console
67
- console.log("Provider data: ", article);
66
+ console.log("Formatted Article: ", formattedArticle);
68
67
 
69
68
  return React.createElement(
70
69
  ContextProviderWithDefaults,
@@ -86,7 +85,7 @@ module.exports = (client, analyticsStream, data, helmetContext) => {
86
85
  React.createElement(Article, {
87
86
  analyticsStream,
88
87
  article: {
89
- ...article,
88
+ ...formattedArticle,
90
89
  section: article
91
90
  ? getSectionNameForAnalytics(article)
92
91
  : "unknown section",
@@ -0,0 +1,4 @@
1
+ module.exports.addAttribute = article => ({
2
+ ...article,
3
+ ssrAttr: "new-ssr-attr"
4
+ });