Releases: MoOx/phenomic
v1.0.0-beta.2
Stable 1.0.0, we are almost there!
This release is probably the penultimate before the stable release.
It brings us 2 majors things:
- π For React users, 2 methods, supported via the new
withInitialProps
HOC, allows you to consume any kind of data (not just Phenomic API but any kind of REST APIs, GraphQL APIs for CMS etc) viastatic async getInitialProps()
. This API, inspired by Next.js is not alone as it comes with another new method for the pre-rendering step, calledstatic async getAllPossibleUrls()
. - πͺ We adjusted 2 transform plugins (markdown and asciidoc) so you can directly pass to those the unified plugins you want to use.
This release is an important step for us as it brings us our missing pieces to be happy with Phenomic current state.
Stay tuned for the final release, that will be done at the same time as we will publish documentations on the website.
π€© We also created a new react-app-blog example that you can use as a good starting point to create any site (not only a blog - and we plan to push more examples when we will hit stable 1.0.0).
This starter includes some pages, some posts, and the usage of our new fresh API to create pages from github data (but you can just use this and replace with any kind of API) to generate client side and static generated pages from those data!
For the architecture, we used something simple, with a few components for header/footer with differents layouts etc. We also included a standard error page (used for 404).
For the styling, we didn't wanted to do something too opinionated and also something too old school (CSS in dedicated files since we all love CSS-in-JS), so we took an simple approach in the middle, with a CSS style tags per components. This allows CSS lover to just extract the CSS in files, and CSS-in-JS lovers to easily convert in places the styles. Remember that we have plenty of examples to know how to handle CSS via any kind of solutions.
You will find a visual preview at the end of this post.
Details
@phenomic/plugin-renderer-react
: createContainer
is now withPhenomicApi
(you will get a warning until you update your import) by @MoOx
Not a breaking change yet, but will be during stable 1.0.0 release.
π @phenomic/plugin-collector-files
: fix edge case when you request an index file with an id (db was not correctly filled) by @MoOx
π @phenomic/core
: fix edge case when you request an empty id (for index
) by @MoOx
π @phenomic/core
: fix time log between pre-rendering and after build hook by @MoOx
π @phenomic/plugin-transform-markdown
: code is now highlighted without failing if language is not recognized by @MoOx
π¨@phenomic/plugin-transform-markdown
: remark/rehype plugins order have been changed a bit by @MoOx
This should only affect you if you were relying on (previously broken) code highlight.
π¨/β¨ @phenomic/plugin-transform-asciidoc
: plugin have been update to work like markdown. by @MoOx
Previously we never tested this plugin on a real project so we are not sure it has ever worked correctly π.
β¨ @phenomic/plugin-transform-markdown
: you can now specifiy options for highlighting language unsupported by default by @MoOx
β¨ @phenomic/plugin-transform-markdown
: you can now choose between json/html mode for the rendering via output
option by @MoOx
β¨ @phenomic/plugin-transform-markdown
: new plugins
option to replace unified/remark/rehype plugins by @MoOx
β¨ @phenomic/plugin-transform-asciidoc
: you can now choose between json/html mode for the rendering via output
option by @MoOx
β¨ @phenomic/plugin-transform-asciidoc
: new plugins
option to replace unified/remark/rehype plugins by @MoOx
β¨ @phenomic/helpers-transform
: new package that exposes stuff shared across transform plugin by @MoOx
β¨ @phenomic/plugin-renderer-react
: withInitialProps
HOC that supports static async getInitialProps({pathname, params})
and static async getAllPossibleUrls({path})
by @MoOx
This allows to generate pages with any source of data (fetch from any kind of REST, Grapql APIs).
Inspired by Next.js.
You can check our example of usage in our react-app-blog example
β¨ @phenomic/plugin-renderer-react
: withPhenomicApi
HOC (previously named createContainer
) by @MoOx
π examples/react-app-blog: a sweet starter to discover phenomic with react and make a blog in a few minutes by @MoOx
Preview of the homepage of the new react-app-blog example
v1.0.0-beta.1
This release might include breaking changes for you.
This is one of the final step before stable 1.0.0!
The breaking changes included in this release are for the best. We have worked hard so you can be able to use simple options for plugins, exactly like babel.
More on this below.
If you use @phenomic/preset-react-app
without any customisation, you are probably all good
- Just be careful if you where using JSON
- If you code was working without any warning, you donβt have anything to do except looking for
hasNextPage
&hasPreviousPage
. If you were still using those, just replace your test with the presence of nextor
previous` directly.
If your are using custom plugins, you will have to update some signatures.
π¨Breaking changes
π¨ Remove deprecated attributes for pagination and routes by @MoOx
π π¨ @phenomic/plugin-transform-json
: support array by passing all js on as data (+use a partial version is accessible) by @MoOx
Previously, using JSON files that were array was broken. We were spreading JSON like if it was an object. We adjusted the behavior that might affect partial
(when you fetch list via queries) if you had a "partial" entry in your JSON (edge case).
Reach us on our community tools if you struggle updating.
π¨ @phenomic/plugin-transform-markdown
: upgrade to gray-matter@3 by @MoOx
If you are using something else than JSON, YAML of JavaScript in your front-matter, please open an issue so we can improve the situation so we can work on allowing engine
option https://www.npmjs.com/package/gray-matter#optionsengines
π¨ @phenomic/core
: collect
method for plugin should now be collectFile
. by @MoOx
π¨ @phenomic/core
: many plugin methods have their signature that have been updated by @MoOx
Please check flow definitions until docs is online (major change is that config is not send since plugin receive it when it's created).
All signatures for plugin have been adjusted. Please take a look if you are a plugin author.
See https://github.com/phenomic/phenomic/blob/954fbe16f20a51af90cbd6a25502da1426e4bdc5/flow-typed/phenomic.js#L159-L202
β¨ New features and improvements
β¨ @phenomic/*
: we can now configure every plugins from phenomic config. by @MoOx
See last item of this list to see an example ;)
β¨ @phenomic/core
: support baseUrl
option in configuration by @MoOx
You can now send a baseUrl in phenomic configuration. This allow website to work at a folder level of a domain (eg: http://domain.tld/root/).
{
"baseUrl": "http://mydomain.com/root-of-my-site/β,
"presets": ["@phenomic/preset-react-app"]
}
Note that this will directly be reflected during development for your mental health! This means you will have to open http://localhost:3333/root-of-my-site/
β¨ @phenomic/core
: support .env(.)? files for PHENOMIC_ env vars by @MoOx
Like CRA support REACT_APP_*
env var to be passed over to your JavaScript during compilation, you will have access to PHENOMIC_*
var that you can define from .env files.
We are using https://github.com/motdotla/dotenv hunder the hood.
β¨ @phenomic/core
: we added a new plugin api so any plugin can add static or dynamic url on runtime (resolveURLs
) by @MoOx
β¨ @phenomic/core
: renderStatic
is now not limited to a single plugin. Multiples plugins (those that have a resolveURLs
can now render static files). by @MoOx
β¨ @phenomic/api-client
: import fetchRestApi from "@phenomic/api-client/lib/fetch";
to fetch phenomic api directly. by @MoOx
This method is mostly for plugin developers.
Calling this method should be made with import query from "@phenomic/api-client/lib/queryβ;
.
Be careful to use this method wisely as it wonβt be magically pre-rendered for all end point unless a plugin handle the static rendering of the resource.
β¨ @phenomic/plugin-bundler-webpack
: respect baseUrl
option by @MoOx
β¨ @phenomic/plugin-bundler-webpack
: inject NODE_ENV + PHENOMIC_* env var (PHENOMIC_ENV & PHENOMIC_APP_BASENAME for now) by @MoOx
β¨ @phenomic/plugin-renderer-react
: expose enhanced Link component that respect baseUrl
option by @MoOx
β¨ @phenomic/plugin-rss-feed
: this is now a thing and can generate multiples feed by @MoOx
Example of the config for Phenomic website
{
"baseUrl": "http://phenomic.io/",
"presets": ["@phenomic/preset-react-app"],
"plugins": [
[
"@phenomic/plugin-rss-feed",
{
"feeds": {
"feed.xml": {
"feedOptions": {
"title": "Phenomic.io",
"description": "Phenomic news"
},
"query": { "path": "news", "limit": 20 }
}
}
}
]
]
}
π Various minor docs improvements by @getDanArias
v1.0.0-beta.0
We are on the road to final 1.0.0!
What is planned:
- We only plan to add an new generic API to fetch any kind of data (like
async getInitialProps
in Next.js) & a few minor improvements. - We will also soon publish a few benchmarks between some well known others static site gen (that might reveal thingsβ¦).
- We will try to add a bunch of plugins to show the world what Phenomic can really do.
If you have any question you can ask us on Spectrum or on Gitter.
Core
- π¨
@phenomic/core
:dist
option is now relative topath
by @MoOx - β¨
@phenomic/core
: introducecontent
option to folder for the content
by @MoOx - π
@phenomic/core
: correctly throw fetch error during static build
by @MoOx - π
@phenomic/core
: add missing API entry points for queries without path
by @MoOx
ReasonML
- Use bs-platform@^2.2.0
- π
@phenomic/plugin-renderer-react
: Fix jsEdge Errored state that was never in this state,
by @MoOx - π
@phenomic/plugin-renderer-react
: Remove unneeded div around bodyRenderer,
by @ulrikstrid - π
@phenomic/plugin-renderer-react
: (reason) Fix return type for query builder,
by @bloodyowl, reported by @ulrikstrid (in #1230) - β¨
examples/reason-react-app
: handle error pages,
by @MoOx
Website
- Remove sites in the showcase that were not using Phenomic anymore (or where unavailable).
We used a script to detect Phenomic on those website that we will run periodically.
by @MoOx - Move the website from
docs
towebsite
folder, more clear for contributors
by @MoOx - Add a link to our new Spectrum community (by @mxstbr)
- Add favicons & friends
Internal
- Migration to Circle CI 2.0
- Readme update
- PNGs logo added into git repo (previously only sketch & svgs were available)
v1.0.0-alpha.20
-
π₯
@phenomic/plugin-bundler-webpack
: remove react-native-web alias for react-native as latest version (0.3.x) rely on babel plugin,
by @MoOx -
π
@phenomic/plugin-bundler-webpack
: fix react-native-web styles prerendering issues with latest version (0.3.x)),
by @MoOx -
π
@phenomic/plugin-bundler-webpack
: stop hiding user webpack issues,
by @MoOx, reported by @thangngoc89 (in #1216)
v1.0.0-alpha.19
π₯ Includes Breaking changes for Reason users.
This release is mostly a bunch of improvements (with a minor breaking change) for Reason users in addition to a bugfix for an edge case.
π₯ Breaking changes (Reason only)
@phenomic/plugin-renderer-react
: (Reason)jsEdgeToReason
is nowjsEdge
, by @MoOx
There is no transformation anymore. Transformation should be made in your component.
This change is accompanied with a new type to help you (seejsNodeList
type below).
We highly recommend you to take a look to the updated example. See below for more details.
π Bugfixes
@phenomic/core
: support query without path for prerendering as itβs supported by database, by @MoOx
β οΈ Deprecation
hasPreviousPage
&hasNextPage
are deprecated, by @MoOx
Please test directly the existence ofprevious
andnext
.
It will continue to work for a while, but will be remove some day.
This is to make it more straight forward to use pagination in Reason.
πͺ Improvements
-
@phenomic/core
:previousPageIsFirst
now always return a value (false
instead ofundefined
), by @MoOx
This is to make it more straight forward to use pagination in Reason. -
@phenomic/plugin-renderer-react
: (Reason) exposejsNodeList
type, by @MoOx
It is the type of data that comes from list queries.
π Improved Example (Reason)
@MoOx worked a lot on the examples/reason-react-app
:
- upgrade to reason-react 0.3.1
- we switched to es6 for bs generated files
- we added pagination, like in the JavaScript example
- we added react-helmet usage (via bs-react-helmet)
- we reorganized the code and added tiny helpers
v1.0.0-alpha.18
-
π
@phenomic/core
: various regression to database introduced inv1.0.0-alpha.14
by @MoOx -
π₯
@phenomic/plugin-collector-files
: remove specific code forauthor
field automatically associated withauthors
in the database,
by @MoOx
If you were previously relying on the fact that the meta author
from a file was magically resolved to a possible authors
from your database, you should instead rely on the generic behavior that works with identical names.
This means you should change author: "name"
to authors: ["name"]
. This will produce the same magic resolution when retrieving content from a single (id
based) query.
If you really want the old behavior back, we should think about a generic solution. So please open an issue.
v1.0.0-alpha.17
v1.0.0-alpha.16
π No breaking changes π
π Reason fix
Ooops! We forgot to publish bsconfig.json
files for new reason packages.
Fixed by @MoOx in #19746b6, reported by @Essential
v1.0.0-alpha.15
π No breaking changes π
π Bugfix
@phenomic/core
: Prevent watcher from crashing when a file is renamed (or saved with vim),
by @hugmanrique, reported by @ArthurClemens (in #1157) and @drazik (in #1208)
(#1211)
v1.0.0-alpha.14
Windows compatibility! Yeay! We can thanks tretton37 that invited @MoOx to work on phenomic for an entire day with a dedicated team of developers (including @oscar-b, @emilpalsson and many more)!
π We can also thanks our backers that are supporting us for a while!
Thanks for believing in Phenomic!
If you are a JavaScript user π No breaking changes π
If you are a ReasonML user π₯ (minor) breaking change is expected π₯
Note that we replaced our database engine, to unlock new features in future releases. This should not change anything for you, but if you have weird differences or behaviors, please reach us.
π₯ Breaking changes
@phenomic/reason
: this plugin is deprecated by @MoOx
You can now directly includes some packages instead of this one in yourbsconfig.json
. See https://github.com/phenomic/phenomic/blob/4c9fb4a738ee1c26035e53d15ba8878298b9b26c/examples/reason-react-app/bsconfig.json#L14-L16
You can remove this package from yourpackage.json
.
Each packages should have bs-bindings (or native reasonml code). If not, do not hesitate to open issue or help us!
Feel free to reach us on our chat if you struggle updating.
π Bugfixes
-
@phenomic/plugin-collector-files
: Fix date parse from filename when using sub folders,
by @emilpalsson , reported by @dlindahl (in #1096) -
@phenomic/plugin-bundler-webpack
: Make webpack follow configured outdir,
by @emilpalsson
π Improvements
@phenomic/core
: Full windows compatibility (433c63d and f858688)@phenomic/core
: Gracefully handle if port is busy when starting dev server,
by @oscar-b, reported by @DavidWells (in #897)