Cosmic JS Changelog

Follow the changelog for product updates and feature roll-outs.

Infrastructure Upgrade, New Metafields, and more


This changelog announcement is a big one for us and includes:

  1. Upgraded infrastructure
  2. New Metafields and
  3. Optimizations to our open source clients.


1. Infrastructure Upgrade

We're happy to tell you that all Cosmic JS components are now powered 100% by serverless technologies. By running completely even-driven using AWS Lambda functions, the REST API, GraphQL API, Dashboard application, and the website are now infinitely scalable through high traffic loads.

This is huge, because it means you can depend on us to deliver your content through the highest traffic loads with dynamic server capacity on demand. This is also big for the Cosmic JS team, because we are now able to make product improvements at a higher velocity with a more streamlined deployment process.

We have also added a caching service to our website to serve our website resources at the edge. Your team can now get to any resource on cosmicjs.com faster and easier with at least 10x faster page loading from any spot on the globe.



2. New Metafields

We have added Boolean Switch and Number Metafields to our list of available Metafield types. We recommend that if you are using Text Metafields for either of these value types, that you switch to these new Metafields.

New Switch Metafield in action:



3. Open Source Optimizations

We've added additional optimizations to our popular Cosmic JS NPM module and Gatsby source plugin. By adding the Accept-Encoding: gzip header to encode responses, API load times and payload sizes have been cut in half. Install the latest versions of these libraries to get this improvement (3.2.35 and 1.0.4 respectively).


We're on a mission to build the best CMS on the planet, and your feedback helps! If you have any questions or feature requests, reach out to us on Twitter, and join our Slack channel. Happy building!

Filters and Smart Views


We're excited to release a new feature that should be a huge time-saver for finding and using your Bucket content: Filters and Smart Views. You can now filter and save smart views in your Objects table view in the Dashboard.

Filter and Save Smart View

Check it out by logging in and going to any Object Type in your Bucket. 


Filters
Click the "Filters" button on any Object Type table view in the Dashboard. Filter Objects by:

  • Status
  • Created by
  • Metadata


Smart views
You can then save your filtered content into "Smart Views" that will be added to the sidebar of your Bucket dashboard for easy access. Save for just yourself, or for your whole team.


API Filtering
After filtering, click the "Developer Tools" button to then get the API REST request and NPM module code for your filter options. Metadata filters are available in the latest NPM module v3.2.31. Read more about all NPM and API options in the Cosmic jS docs.

It looks like this:

I hope you enjoy the new capabilities. This feature comes as a direct response to users that needed a better way to find and filter content.

If you have any questions or update that you would like to see shipped, please reach out to us on Twitter and join the conversation on Slack.

Customize REST API Response, Object Metafields Search


We've got a couple updates to make editing and integrating your Cosmic-powered content faster and easier.

1. Customize API Response Data
You can now add a query parameter (props) to the REST API (or NPM module) to limit the response data to only selected properties. Think of this like GraphQL-ifying your REST response to get only the data you need.

For example here's the old way to get Objects from the REST API which gives you everything:

https://api.cosmicjs.com/v1/simple-react-blog/objects?pretty=true&hide_metafields=true&type=posts&limit=20

And now the same query with added props query parameter.

https://api.cosmicjs.com/v1/simple-react-blog/objects?pretty=true&hide_metafields=true&type=posts&limit=20&props=slug,title,content

As you can see, adding props to your query makes your response much more concise giving you only the data you need. This should make your API responses faster, giving you and your end users a better experience 😎

Note: You can also add metadata.your_key to get selected metadata values (limited to one level only).

We've also updated the "Developer Tools" modal in the Dashboard to check out what this looks like:


UPDATE: 9/10/2019
You can also limit the depth of your response data by adding the query param depth. This will limit the nested depth of Object Metafields.

Check out the updated REST API docs for more info.


2. Search Objects in Object Metafields
One of our most popular features is the ability to connect Objects to each other to create relationships. For example: Blog Posts may need to connect to Categories and Authors which you can accomplish using Object Relationship Metafields.

It's now much easier to find the Object you're looking for with a new search feature on the Object Select modal. Simply type in a keyword to quickly find the Objects you need. Gif below:

Updates to Scheduled Publishing


We have a quick update to scheduled publishing that should make things easier for those using this handy feature.

How scheduled publishing used to work:

You set your scheduled publish day and time and it sets your content to draft. This was fine for new content, but not ideal for already published content. If you wanted to maintain your published content and save a new draft for later scheduled update this didn't work.

The new way:
You can now save a published version AND save a draft version scheduled for later publish. This also makes it possible to keep two versions running: 1) Your published content and 2) your draft content scheduled for publish later.

I hope you like this update to scheduled publishing. This update was shipped in direct response to a user that needed a better experience with this feature.

If you have any questions or update that you would like to see shipped, please reach out to us on Twitter and join the conversation on Slack.

Edit Object Metafields


You can now edit specific Metafields on existing Objects via the API. The following API method allows you to edit specific Metafields identified by key, without affecting other Metafields as well as add new Metafields. View in the docs.

The endpoint is:

PATCH https://api.cosmicjs.com/v1/:bucket_slug/edit-object-metafields

Body properties:

slug (String)
metafields (Array)


The Cosmic JS NPM module is also updated (3.2.19) to allow for this capability with the new method:

bucket.editObjectMetafields()

Further directions are available in the Metafields section in the REST API documentation.


Let me know if you have any questions. Join us on Slack and on Twitter.

Updates: New Webhook Event, Delete all Objects in Type, Export Options


New Webhook Event
We have added a new webhook event:

object.edited.unpublished

If you relied on "object.edited.draft" for this event, you will need to edit your webhook to this event. Find your webhooks in Bucket Settings > Webhooks. Be sure to check this out in the Webhooks documentation.


Delete all Objects in your Object Type
This experience has been improved: now when you delete an Object Type it will remove all Objects in this type.


Export Options
You can now export specific Object Types and omit others in your Bucket Export area located in Bucket Settings > Import / Export.

Cosmic JS API now powered by Fastly


We're excited to announce that all Cosmic JS API endpoints (REST and GraphQL) are now powered by the Fastly global CDN. You should now notice huge performance gains on your Bucket API endpoints. For example, if a large endpoint used to take 400ms it is now clocking in under 20ms!

What is Fastly?
Fastly is the leading global CDN cache layer provider that powers some of the most highly-trafficked websites on the internet. The New York Times, Airbnb, and more choose Fastly because of their global CDN of over 60 high-powered point of presence servers (POPs). These POPs are distributed closest to your users so they can get your content as fast as possible. This also shields your cached content from any issues caused by the origin infrastructure.

From the Fastly Network Map page, "we’ve focused our efforts on placing fewer, more powerful POPs at strategic locations around the world."



What does this mean for you?
We're happy to roll this out to all Cosmic JS users. Your Cosmic JS content is now automatically powered by the Fastly global CDN and available to your users world-wide. No extra work needs to be done on your part. Just sit back and notice huge performance gains for you and your users 😎 

And more great news: requests to the cache-served content from the Cosmic JS API will not count towards your API request limits on your billing plan. API requests are counted only on initial requests to any resource after you clear your cache either manually in Bucket > Settings or by adding, editing, or deleting content in your Bucket.

It's our mission to make sure your team has the best experience collaborating on content using Cosmic JS. With the Cosmic JS Fastly update, you can deliver great content and experiences to your world-wide customers even faster.

If you have any questions, reach out to us on Twitter and join the Slack community.

Duplicate Object Types, Editor Publishing Restrictions


We have a couple new feature releases for your review:

Duplicate Object Types
You can now Duplicate Object Types. Go to any Object Type > Settings page and scroll to the bottom and find the "Duplicate Objects Type" button. This is a great time saver for when you need to duplicate Object Type Metafield content models and settings (it does not duplicate Objects).


Editor Restricted Publishing
You can now assign a team member access to all content in your Bucket but only allow them to save content to draft. This is a nice in-between role between Editor and Contributor.

Headless CMS Features and Solution Pages


We're excited to launch new resources to demonstrate how teams all over the world are using the Cosmic JS headless CMS to manage content for their websites and apps. You'll now notice:

  1. The Navigation Bar has grown to include a new Solutions Tab, which outlines use-cases like E-Commerce Websites, Blogs, Native Apps and more. Each Solution page provides helpful open-source example apps, extensions and customer stories that demonstrate that particular use-case.
  2. All Cosmic JS Headless CMS Features now have a Feature Detail Page for easier adoption and reference among teams. See example: Revision History.