Releases: adriantoine/bloql
Changed bloql interface to avoid polluting `this.props` object and make it easier to access for posts
-
Changed bloql interface to avoid polluting
this.props
object and make it easier to access for posts:for
PostList
:{this.props.posts.edges.map(edge => <a href={edge.node.meta.slug}>{edge.node.meta.title}</a> )} // becomes: {this.props.bloql.posts.map(post => <a href={post.meta.slug}>{post.meta.title}</a> )}
for
Post
(to avoid pollutingthis.props
, in case a user wants to have pass his ownpost
prop, we shouldn't override it):this.props.post // becomes: this.props.bloql.post
Added features to PostLists and internal refactoring
-
Added ability to dynamically update filters on the post list using bloql functions in an
PostList
component:// Filter a list of posts by tags or date this.props.bloql.setFilters({ tags: ['trip', 'usa'], startDate: '2015-01-01' }); // Reset filters this.props.bloql.resetFilters();
Example: https://github.com/adriantoine/bloql-examples/blob/master/filters/public/index.js#L10
-
Changed function names for better consistency (hopefully it will be the last time I do that):
import { setComponent } from 'bloql/Post'; import { setComponent } from 'bloql/PostList'; // become => import { createComponent } from 'bloql/Post'; import { createComponent } from 'bloql/PostList';
-
Just like
Post
,PostList
becomes a big customisable object, see previous release. -
This is not part of this repo/package but examples have been updated to demonstrate more features: bloql-examples
Added feature and modularity in `Post` element
-
Added ability to update the slug of a post which will change the displayed post, just run this command in any bloql
Post
component:this.props.bloql.setSlug('my-post-slug');
Example: https://github.com/adriantoine/bloql-examples/blob/master/basic/public/post.js#L11
-
Changed interface and function names:
import createPost from 'bloql/Post'; import createPostList from 'bloql/PostList'; // become => import { setComponent } from 'bloql/Post'; import { setComponent } from 'bloql/PostList';
-
Post
element is much easier to customise with your own routes or fragments, so if you require thePost
component this way:import Post from 'bloql/Post';
you'll be able to change almost anything from this post before calling its method
setComponent
with your component. More documentation and examples to be coming, for now you can have a look at: https://github.com/adriantoine/bloql/blob/master/src/client/Post.js
This cool stuff is not yet available forPostList
but that should be in the next release
0.8.3
Small code fix and added back webpack options
General refactoring
-
Fixed build process to use webpack
-
Fixed many issues with dependencies and multiple copies of React
-
Doesn't bundle
react
andreact-relay
packages to make files minimal and avoid build issues, they are now peer dependencies -
Changed folder structure and way to get files:
- On the server side:
import bloql from 'bloql/server/middleware/express'; // become => import bloql from 'bloql/middleware/express';
- On the client side:
import { createPost } from 'bloql/client'; import { createPostList } from 'bloql/client'; // become => import createPost from 'bloql/Post'; import createPostList from 'bloql/PostList';
Set database in another package to be more modular
- Now the database that retrieves and process posts is in another module to make it more modular, in case people want to store and retrieve posts in another way (MongoDB, PostgreSQL, using an API, etc...) they would be able to write the own database module for bloql. Ex: https://github.com/adriantoine/adriantoine.com/blob/580c04261e9fc8f5000bcb8ead715e6b349f5ae7/server.js#L15
Implemented start and after date filters
- Now able to filter a date range using
startDate
andendDate
filters. Ex: https://github.com/adriantoine/adriantoine.com/blob/5cb31174cceea25183efbe27302e721901e9d74b/src/components/PostList.js#L9-L10
Simplified interface again and implemented post filters
- Removed the
createPostItem
from the client interface so that now you can actually use any React elements as PostItem, you don't have to pass thePostItem
static variable anymore toPostList
. APostList
is the only element needed by bloql to generate a list of posts. Ex: https://github.com/adriantoine/adriantoine.com/blob/7118ddcdc00f7fcb72b4e1a48363a460c5c9d03a/src/components/PostList.js - You can now use filters: https://github.com/adriantoine/adriantoine.com/blob/7118ddcdc00f7fcb72b4e1a48363a460c5c9d03a/src/components/PostList.js#L9-L10
Added Post component
Added a post component to be able to create a post page.
Simplified interface
Simplified interface for an easier way to create components. Documentation still needs to be written.