bobbingwide / react-sb Goto Github PK
View Code? Open in Web Editor NEWReact UI for Genesis-SB theme
License: GNU General Public License v3.0
React UI for Genesis-SB theme
License: GNU General Public License v3.0
WordPress 4.7 includes some of the logic that was implemented by the WP REST API plugin.
But the API has changed. So the code written for WordPress 4.6 and WP REST API may not work.
This is true for the react-SB requests that used the filter parameter.
The simplest solution is to change the code client code to use requests that do work.
In our case this means changing
/wp-json/wp/v2/bigram?filter[s-letter]=sletter-name
to
/wp-json/wp/v2/bigram?s-letter=sletter-id
The value passed needs to be the term_id rather than the term value.
This is already returned to the client so it's not a major problem.
The WP REST API plugin can be deactivated.
Same change for b-letter
Move the details above the items list and improve the styling of the image and content.
When an SB has been selected the detail is currently displayed at the bottom of the page, below the list.
It would be nicer to display it at the top of the display.
The image ( if any ) should come after the title and before the details.
Allow a maximum width of 800px.
Should this repository deliver the bundle.js file that's created by running
npm run windows
or not.
The file is needed in the genesis-SB theme; so maybe the theme should be responsible for building it
The code currently uses console.log()
to assist in problem determination.
Have a butchers at the possible solutions and choose something that will work well with React JS.
The demoApi class ( in rest-api.js file ) needs to know the url to which the REST API requests should be directed. This is currently hardcoded in the const BIGRAM_URL as http://localhost/bigram, equivalent to http://qw/bigram.
We need a solution that will work when the real target site is http://bigram.co.uk
Invocation method | Server | Type | BIGRAM_URL |
---|---|---|---|
http://localhost:8080 | webpack-dev-server | Dev | http://qw/bigram/ |
http://qw/react-SB/public | index.html | Dev / UT | http://qw/bigram/ |
http://qw/bigram/react-sb-page | page-react-sb-page.php | Test | http://qw/bigram/ |
http://bigram.co.uk/react-sb-page | page-react-sb-page.php | Prod | http://bigram.co.uk/ |
Use window.location.hostname and window.location.protocol
If hostname is localhost or qw then set BIGRAM_URL to qw/bigram else set it to the hostname
I think it would be nice to write up the Problems that I encountered while attempting to develop my first ReactJS and REST application including the Questions and, where available, Answers that I found myself asking. Some of the problems have been dropped into the problems folder, but are neither nicely formatted nor nicely explained.
Three problems.
&
The REST API works better when data is requested in chunks.
But you can't set posts_per_page
to -1 and you can't set it to an arbitrarily large number in the hope that it will be big enough.
The original logic to load 31 posts_per_page for the s-letter and b-letter taxonomies doesn't work for b-letter ( see #4 ) and the logic to load s-words or b-words when an s-letter or b-letter has been selected also fails since it only loads 10 posts and that's not enough.
We need to implement the ability to load mutiple pages of results.
When the react-SB page is viewed from my iPad or iPhone I don't get any data other than S B and Select something.
Why not?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.