-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: update to manifest v3 (Resolves: #32, #33, #29) #40
Conversation
package.json
Outdated
"clean:build": "rimraf dist", | ||
"clean:test": "rimraf reports coverage", | ||
"build": "run-s -l clean:build build:*", | ||
"build:dist": "cpy . ../dist --cwd=src; cpy . ../../dist/lib/infusion --cwd=node_modules/infusion" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the ; operator is non-portable - I get an error running this line on Windows, replacing it with & allows the build to complete
|
||
uioPlus.enactor.tableOfContents.injectToCContainer = function (that) { | ||
if (!that.locate("tocContainer").length) { | ||
if (that.content.length === 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment explaining why the variant strategy is necessary here would be helpful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to explain, and hopefully we can come up with a suitable comment.
The ToC component from Infusion relies on the container for the ToC component to be located within the page. However, we cannot rely on the ToC's container being pre-added to the page with UIO+ as it runs on arbitrary sites. uioPlus.enactor.tableOfContents.injectToCContainer
will inject the necessary ToC container markup into the pages content, and this container will then be used by the ToC component.
The first if guards against adding the ToC container if one already exists.
The second if/else will either append the ToC container to the content or to the enactor's container if the content isn't found. The content is located by means of uioPlus.contentView
defined above. It provides a means for looking for the pages main content area (e.g. <main>
, <article>
etc.). In some cases, UIO+ is not able to locate the content area. For example a page marked up like <body><div></div><div></div></body>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added @jobara's comment into the code.
All code review suggestions so far have been addressed.
"nyc": "15.1.0", | ||
"rimraf": "3.0.2", | ||
"sinon": "13.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting an error when trying to run the tests that it can't find sinon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. sinon-chrome
pulls in sinon
on my computer. I've added the sinon
. Can you try again? Thanks.
With UIO+ enabled the browser console reports the following error:
|
On engadget.com when enabling Text-to-Speech I get the following error.
|
src/js/enactors.js
Outdated
domReaderContent: ["domReaderContent", "main", "article"], | ||
controllerParentContainer: ["controllerParentContainer", "main", "article"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need the "genericContent"
option here which is likely defined in a parent grade. It provides more fallbacks to find the page content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are probably looking at an old version of this file. domReaderContent
and controllerParentContainer
are used by subcomponents domReader
and controller
. As these sub-components are now disabled for turning off the page level reading. These lines have been removed in the last commit.
.github/workflows/ci.yml
Outdated
@@ -11,7 +11,7 @@ jobs: | |||
strategy: | |||
matrix: | |||
os: [ubuntu-latest, windows-latest, macOS-latest] | |||
node-version: [14.x, 16.x] | |||
node-version: [16.x] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well add Node 18 now too.
node-version: [16.x] | |
node-version: [16.x, 18.x] |
README.md
Outdated
@@ -110,7 +99,7 @@ _**NOTE:** Published versions can be installed from the [Chrome Web Store]( | |||
|
|||
### BSD 3-Clause | |||
|
|||
* [Infusion v3.0.0-dev](https://fluidproject.org/infusion.html) | |||
* [Infusion v4.0.0](https://fluidproject.org/infusion.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* [Infusion v4.0.0](https://fluidproject.org/infusion.html) | |
* [Infusion v4.6.0](https://fluidproject.org/infusion.html) |
Resolves: #32
Resolves: #33
Resolves: #29
Migration docs: