github MoOx/phenomic v1.0.0-beta.1

latest releases: v1.0.0, v1.0.0-beta.11, v1.0.0-beta.10...
pre-release6 years ago

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 nextorprevious` 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

Don't miss a new phenomic release

NewReleases is sending notifications on new releases.