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

RSS Reader Webpart - upgraded to spfx 1.18.2 #4692

Merged
merged 2 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions samples/react-rss-reader/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// For more information on how to run this SPFx project in a VS Code Remote Container, please visit https://aka.ms/spfx-devcontainer
{
"name": "SPFx 1.11.0",
"image": "docker.io/m365pnp/spfx:1.11.0",
"name": "SPFx 1.18.2",
"image": "docker.io/m365pnp/spfx:1.18.2",
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
Expand Down Expand Up @@ -36,4 +36,4 @@
},
"postCreateCommand": "bash .devcontainer/spfx-startup.sh",
"remoteUser": "node"
}
}
353 changes: 353 additions & 0 deletions samples/react-rss-reader/.eslintrc.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions samples/react-rss-reader/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ node_modules
# Build generated files
dist
lib
solution
temp
*.sppkg
.heft
release
package-lock.json

# Coverage directory used by tools like istanbul
coverage
Expand Down
16 changes: 16 additions & 0 deletions samples/react-rss-reader/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
!dist
config

gulpfile.js

release
src
temp

tsconfig.json
tslint.json

*.log

.yo-rc.json
.vscode
1 change: 1 addition & 0 deletions samples/react-rss-reader/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.18.0
9 changes: 7 additions & 2 deletions samples/react-rss-reader/.yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
"@microsoft/generator-sharepoint": {
"isCreatingSolution": true,
"environment": "spo",
"version": "1.11.0",
"version": "1.18.2",
"libraryName": "react-rssreader",
"libraryId": "fcb53167-e0d5-4ed1-9648-149146649aa1",
"packageManager": "npm",
"isDomainIsolated": false,
"componentType": "webpart"
"componentType": "webpart",
"nodeVersion": "18.17.1",
"sdkVersions": {
"@microsoft/teams-js": "2.12.0",
"@microsoft/microsoft-graph-client": "3.0.2"
}
}
}
46 changes: 23 additions & 23 deletions samples/react-rss-reader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

A RSS Reader original based [on work by Olivier Carpentier](https://github.com/OlivierCC/spfx-40-fantastics/tree/master/src/webparts/rssReader), part of the [SPFx Fantastic 40 Web Parts](https://github.com/OlivierCC/spfx-40-fantastics)

This RSS Reader utilizes SharePoint Framework v1.11.0 with no dependency on jQuery or a RSS Feed library. This project does utilize [
@pnp/spfx-property-controls](https://sharepoint.github.io/sp-dev-fx-property-controls/), and Moment React for date manipulation. Handlebar template option derived from React Search Refiners ([PnP Modern Search](https://microsoft-search.github.io/pnp-modern-search/)) . Use NodeJS version 10 to compile or rebuild the SPFx solution.
This RSS Reader utilizes SharePoint Framework v1.18.2 with no dependency on jQuery or a RSS Feed library. This project does utilize [
@pnp/spfx-property-controls](https://sharepoint.github.io/sp-dev-fx-property-controls/), and Moment React for date manipulation. Handlebar template option derived from React Search Refiners ([PnP Modern Search](https://microsoft-search.github.io/pnp-modern-search/)). Use NodeJS version 18 (validated using v18.17.1) to compile or rebuild the SPFx solution.

Main features include:

- Three different RSS Feed retrieval services, direct, https://feed2json.org, https://rss2json.com
- Three different RSS Feed retrieval services, direct, <https://feed2json.org>, <https://rss2json.com>
- Optionally store RSS feed results to local storage for quick reload with configurable timeout window
- Optional CORS proxy service for cross origin feeds
- Optional View All link in header to point to custom feed source
Expand All @@ -18,7 +18,7 @@ Main features include:
-- Demonstration of color picker property for color control of certain aspects of web part
- Custom feed rendering using local or remote handlebar template

![RSS Reader](./assets/react-rss-reader.gif)
![RSS Reader](./assets/react-rss-reader-original.gif)

## Compatibility

Expand All @@ -27,29 +27,28 @@ Main features include:
| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
|Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |

![SPFx 1.11](https://img.shields.io/badge/SPFx-1.11.0-green.svg)
![Node.js v10](https://img.shields.io/badge/Node.js-v10-green.svg)
![SPFx 1.18.2](https://img.shields.io/badge/SPFx-1.18.2-green.svg)
![Node.js v18](https://img.shields.io/badge/Node.js-v18-green.svg)
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Incompatible-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
![Teams Incompatible](https://img.shields.io/badge/Teams-Incompatible-lightgrey.svg)
![Local Workbench Compatible](https://img.shields.io/badge/Local%20Workbench-Compatible-green.svg)
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)

Tested with: Node.js v10.16.3
Tested with: Node.js v18.17.1

## Applies to

* [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
* [Microsoft 365 tenant](https://learn.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
- [SharePoint Framework](https://learn.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
- [Microsoft 365 tenant](https://learn.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)

## Contributors

* [Abderahman Moujahid](https://github.com/Abderahman88)
* [Eric Overfield](https://github.com/eoverfield)
* [Kalle Mansikkaniemi](https://github.com/djsladi)
* [Lauri Koskimies](https://github.com/koskimiesl)
- [Abderahman Moujahid](https://github.com/Abderahman88)
- [Eric Overfield](https://github.com/eoverfield)
- [Kalle Mansikkaniemi](https://github.com/djsladi)
- [Lauri Koskimies](https://github.com/koskimiesl)

## Version history

Expand All @@ -60,16 +59,17 @@ Version|Date|Comments
1.0.2 | April 6, 2023 | Fix bug in Direct request retrieval service
1.0.3 | April 21, 2023 | Added theme awareness
1.0.4 | May 25, 2023 | Fixed direct request issues
1.1.0 | February 6, 2024 | Upgraded to SPFx 1.18.2

## Minimal Path to Awesome

- Clone this repository

> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit https://aka.ms/spfx-devcontainer for further instructions.
> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit <https://aka.ms/spfx-devcontainer> for further instructions.

### SPFx

- In the command line, with a version of Node 10, i.e. 10.16.3, run:
- In the command line, with a version of Node 18, i.e. 18.17.1, run:
- `npm install`
- `gulp serve`

Expand All @@ -85,19 +85,19 @@ Version|Date|Comments

#### RSS Reader Settings

Setting | Description
Setting | Description
-------|----
Feed URL | The URL of the RSS Feed for readers. Normally will URL will return XML
Feed Retrieval Service | The service to use to retrieve the feed. **Direct** = Make a direct call from the web part to the feed. Note, may have issues with CORS depending on the feed owner. **Feed2Json** = Retrieve a JSON version of feed via feed2json.org. Note, not for production, and may have issues with CORS. For production use, host your own feed2json service. Learn more at https://github.com/appsattic/feed2json.org. **Rss2Json** = CORS safe method to retieve a feed response. Note, subject to limitations with paid options available.
Feed Service URL | If using Feed2Json, the URL of the feed2json service. Host your own service, learn more at https://github.com/appsattic/feed2json.org
Feed Retrieval Service | The service to use to retrieve the feed. **Direct** = Make a direct call from the web part to the feed. Note, may have issues with CORS depending on the feed owner. **Feed2Json** = Retrieve a JSON version of feed via feed2json.org. Note, not for production, and may have issues with CORS. For production use, host your own feed2json service. Learn more at <https://github.com/appsattic/feed2json.org>. **Rss2Json** = CORS safe method to retrieve a feed response. Note, subject to limitations with paid options available.
Feed Service URL | If using Feed2Json, the URL of the feed2json service. Host your own service, learn more at <https://github.com/appsattic/feed2json.org>
Feed Service API Key | If using rss2json, an optional API key for paid services
Max Count | The maximum results to return, default: 10
Max Count | The maximum results to return, default: 10. **Note** When using the free versions of feed2json or rss2json, results are limited to 10 or less by the services.
Cache Results | Locally store results in browser local storage, default: no
Mins to Cache Results | If storing results in browser, number of minutes to store. Valid 1 to 1440 (one day), default: 60
Storage Key Prefix | An optional local storage key prefix to use when storing results
Loading Message | An optional custom message to display while the RSS feed is being loaded
Use a CORS proxy | Use a CORS proxy to assist with feed retrieval, default: no
CORS Proxy URL | The URL of a CORS proxy if allowed. {0} will be replaced with Feed URL, i.e. https://cors-anywhere.herokuapp.com/{0}
CORS Proxy URL | The URL of a CORS proxy if allowed. {0} will be replaced with Feed URL, i.e. <https://cors-anywhere.herokuapp.com/{0}>. To use CORS anywhere by Herokuapp for testing, be sure to visit ![https://cors-anywhere.herokuapp.com](https://cors-anywhere.herokuapp.com) first to unlock yourself for testing.
Disable CORS | Set request header mode to "no-cors", thus not requesting CORS response from service. Will disable CORS request, default: no

#### Styling Options
Expand All @@ -110,8 +110,8 @@ Disable CORS | Set request header mode to "no-cors", thus not requesting CORS re
|View All Link | An optional link to view the entire feed, often a link to the RSS source blog itself, default: none|
|View All Link Label | An optional label for the View All Link|


##### Default layout options

|Setting | Description|
-------|----
Show Publication Date | Display the publication date
Expand All @@ -123,6 +123,7 @@ Title Color | Color override for a listing title
Background Color | Color override for the web part background

## Features

This Web Part illustrates the following concepts on top of the SharePoint Framework:

- Use HttpClient to retrieve data from an outside data source using different services
Expand All @@ -131,7 +132,6 @@ This Web Part illustrates the following concepts on top of the SharePoint Framew
- Handlebar based rendering with inline editor or remote template retrieval
- Use the React container component approach inspiring by the [react-todo-basic sample](https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-todo-basic).


## Help

We do not support samples, but we this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified samples/react-rss-reader/assets/react-rss-reader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion samples/react-rss-reader/assets/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"key": "SPFX-VERSION",
"value": "1.11.0"
"value": "1.18.2"
}
],
"thumbnails": [
Expand Down
4 changes: 0 additions & 4 deletions samples/react-rss-reader/config/copy-assets.json

This file was deleted.

2 changes: 1 addition & 1 deletion samples/react-rss-reader/config/deploy-azure-storage.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./temp/deploy/",
"workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "react-rssreader",
"accessKey": "<!-- ACCESS KEY -->"
Expand Down
28 changes: 25 additions & 3 deletions samples/react-rss-reader/config/package-solution.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "react-rssreader-client-side-solution",
"name": "PnP Sample - React RssReader",
"id": "fcb53167-e0d5-4ed1-9648-149146649aa1",
"version": "1.0.2.0",
"version": "1.1.0.0",
"developer": {
"name": "Eric Overfield",
"privacyUrl": "https://contoso.com/privacy",
Expand All @@ -13,7 +13,29 @@
},
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false
"isDomainIsolated": false,
"metadata": {
"shortDescription": {
"default": "react-rssreader description"
},
"longDescription": {
"default": "react-rssreader description"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "PnP Sample - React RssReader Webpart Feature",
"description": "The feature that activates RssReaderWebPart from the PnP Sample - React RssReader solution.",
"id": "f489b1fd-98bf-4b41-8db0-85d5018ba484",
"version": "1.1.0.0",
"componentIds": [
"f489b1fd-98bf-4b41-8db0-85d5018ba484"
]
}
]
},
"paths": {
"zippedPackage": "solution/react-rssreader.sppkg"
Expand Down
3 changes: 3 additions & 0 deletions samples/react-rss-reader/config/sass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
8 changes: 2 additions & 6 deletions samples/react-rss-reader/config/serve.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://localhost:5432/workbench",
"api": {
"port": 5432,
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
}
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
}
11 changes: 11 additions & 0 deletions samples/react-rss-reader/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,15 @@ build.configureWebpack.mergeConfig({
}
});

var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
var result = getTasks.call(build.rig);

result.set('serve', result.get('serve-deprecated'));

return result;
};

// build.tslintCmd.enabled = false;

build.initialize(gulp);
Loading
Loading