Wishlist for the next major version of Gatsby (v3) #30976
Replies: 68 comments
-
yay! am i allowed to suggest things? 🤗
i know it looks a bit like i should just use nextjs with the first 3 ideas. i just think they're really good ideas. if thats not in line with your vision of course you should decline it.. just figured i woudl put it up |
Beta Was this translation helpful? Give feedback.
-
First class TypeScript support was pretty popular on https://twitter.com/chatsidhartha/status/1155820333095505920?s=20 as well |
Beta Was this translation helpful? Give feedback.
-
We're probably going to rewrite how we expose our plugin api to get this working. We already have support for this, just super verbose with importing typedefs yourself.
Is something we can already do, without bumping major. |
Beta Was this translation helpful? Give feedback.
-
I'm adding dropping node 8 & perhaps node 10 support (depending on the timing). Also opting to upgrade all possible dependencies to their latest like eslint 6... |
Beta Was this translation helpful? Give feedback.
-
Another thing mentioned was deprecating |
Beta Was this translation helpful? Give feedback.
-
I think this should be in by default but since it's a breaking change we'll postpone it to the next major bump. |
Beta Was this translation helpful? Give feedback.
-
Remove automatic __typename adddition to queries. |
Beta Was this translation helpful? Give feedback.
-
Less magical APIs (no more using magic exports): (just examples, not the actual design):
theme here is:
also first time reading gatsby site code without going through tutorial or docs is very confusing (how do you know the Nice thing about it that we can support both (probably deprecate current way if we chose to make this happen) |
Beta Was this translation helpful? Give feedback.
-
Support for creating collection of pages (i.e. (would require thinking through how page paths are determined) |
Beta Was this translation helpful? Give feedback.
-
Built in support for pagination via some query directives |
Beta Was this translation helpful? Give feedback.
-
My wishlist for feature additions:
|
Beta Was this translation helpful? Give feedback.
-
Seconding the first class typescript support |
Beta Was this translation helpful? Give feedback.
-
FastRefresh hot loader as default (and then required is updating minimum react semver range) |
Beta Was this translation helpful? Give feedback.
-
FWIW, I don't think we should do all of this now. This list is more turning into, "what are all the breaking changes we want to do." Doing all of these for V3 could be quite a lot of churn. |
Beta Was this translation helpful? Give feedback.
-
Added with react bump needed note
There is note:
But probably need more visibility (screaming red color! :) ) in the description |
Beta Was this translation helpful? Give feedback.
-
I’d be remiss if I didn’t throw in my two cents. For me, the strengths of Gatsby are its source plugins, graphql data layer, image optimizations, and SEO. The drags on my productivity are long build times and lack of delta updates. Of course, the other popular framework I’ve used often is Next.js. Their strengths are its SEO and incremental static regeneration (delta updates / preview). Their drags on my productivity are images (RFC proposal in progress) and sourcing data. I’ve read a bit of hearsay around the internet about how it “feels like Next are rapidly developing new feature while Gatsby are focused on repaying their investors” and “their effort seems to be put on improving their enterprise offer, as oppose to the project itself”. I don’t mean any disrespect, but it’s important to acknowledge the perceived risks of vendor lock in with Gatsby Cloud. I’ve found the only issue about hosting my own preview server is closed, there aren’t many references about the refresh endpoint, much less information about securing my custom server. I think the next big feature set for gatsby involves incremental builds, updates, and previews. I hope those features are open and accessible, like Gatsby.js What I would love to see in the next version of gatsby:
Anyway, I 💜 gatsby, and I can’t wait to see what v3 holds! |
Beta Was this translation helpful? Give feedback.
-
The summary talks about “Perf budgets”, but I would also like to see this issue addressed:
Performance is a never ending battle, but Gatsby makes it a breeze. Keep up the good work! |
Beta Was this translation helpful? Give feedback.
-
Hey @jlarmstrongiv. That's not an issue that needs to wait for a major release. You can see the progress in there, so it should be fixed sooner. |
Beta Was this translation helpful? Give feedback.
-
@jstormail2 docs for setting up a preview server are here — https://www.gatsbyjs.com/docs/running-a-gatsby-preview-server/ — let us know if you need any more help there. Appreciate your feedback! |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Since this is a wish list, I know this will be controversial, but: No more unnecessary backticks (template literals that could just be strings). They increase learning curve, they decrease readability. I already use But if Gatsby wants to welcome as many people as possible, I think newcomers to ES6 looking at Gatsby v3 code for the first time would be better greeted by |
Beta Was this translation helpful? Give feedback.
-
I think switching back to react router is super important because of issues like this one; reach/router#175 There is currently no way in gatsby to block a navigation change to tell the user "Hey are you sure you want to navigate away, you have unsaved changes?" |
Beta Was this translation helpful? Give feedback.
-
Also I think this article is spot on about GraphQL being overly complicated for the task: https://jaredpalmer.com/gatsby-vs-nextjs I was a much bigger fan of Gatsby v1 before all the GraphQL stuff got added. I think it's worth considering moving to a more nextjs-like approach where components can just have a |
Beta Was this translation helpful? Give feedback.
-
It'd be great if there was a default limit set for node list queries. It's problematic that folks will query for all nodes of a type on every page query for nodes in another type. It's never desireable to load up all posts that exist on every page that exists. Folks don't notice this when they start on new projects because it isn't a problem until your site grows and you have a ton of content. Ideally this would be very low by default, maybe 10, and you could intentionally set the limit to null to query all nodes in that type. |
Beta Was this translation helpful? Give feedback.
-
APIs are run serially — which is often what we want but some APIs should be run in parallel e.g. |
Beta Was this translation helpful? Give feedback.
-
Move runtime code under a |
Beta Was this translation helpful? Give feedback.
-
Use the module/nomodule pattern to load modern javascript for modern browsers but falling back to older javascript when an older browser is detected. |
Beta Was this translation helpful? Give feedback.
-
Built in support for i18n in a straightforward and consistent way would be fantastic. There is a lot of inconsistency in the way that people get it to work, and the blog posts aren't particularly helpful when they're split between a bunch of different libraries that don't really jazz. The recommended plugin demands quite a bit of work for updating layouts with separate files for each supported language, and it definitely makes DRY codebases more difficult. |
Beta Was this translation helpful? Give feedback.
-
Following up on the Moment question. Is it being deprecated? I forget exactly how I ran into this issue, but I was doing something that involved interacting with dates and realized the way Moment was doing it was non-standard to how JS itself is doing it. Considering Moment is in legacy mode and they actively promote using either vanilla JS or another library, it seems prudent to offload the library for something else asap. |
Beta Was this translation helpful? Give feedback.
-
This issue/discussion was created before Discussions were a thing and tracking feature requests here now will get unwieldy quickly. Please open discussions for feature requests here now: https://github.com/gatsbyjs/gatsby/discussions/categories/ideas-feature-requests |
Beta Was this translation helpful? Give feedback.
-
Summary
This is a wishlist issue for thinking about what changes might go into the next major version of Gatsby .
This is NOT a V3 umbrella issue. There will be separate issue/project with subset of this list once enough ideas are gathered and we do research on impact, migration paths, engineering/documentation efforts etc of each of the items
Note that we have not started work on the next major version of Gatsby, and there is no timeline for when we’ll start, or when it will be available.
The list
This issue is intended to collect any features that might need a breaking change to implement or shift conventions in a big way (this doesn't necessarily need breaking changes technically as often times we can support old way and new way, but major releases is good platform to shift convention / soft deprecate APIs). Nothing on here is guaranteed to happen! It's much more likely that only subset of those ideas will be used for next major version and rest will need to wait for another one.
Breaking changes:
Current gatsby behaviour
loose: false
inbabel-preset-gatsby
componentChunkName
Gatsby APIs
remove loki (it served it's purpose as experiment, but it's tedious to maintain multiple node stores implementations in the long run, especially as we will start looking into out-of-process data stores - then we would have 3+ implementantions)(loki has been removed)gatsby-config
:__experimentalThemes
( code )actions
:deleteNodes
action ( code with comments / v1->v2 migration guide )deleteNode
with anodeId
argument ( code with comments )createNodeField
withfieldName
/fieldValue
params ( code )gatsby-node
context / helpersboundActionCreators
( deprecation code / jsdoc / gatsby helpers docshasNodeChange
( jsdoc / gatsby helper docs )gatsby-browser
getResourcesForPathnameSync
andgetResourcesForPathname
args (code with comments - deprecated in April 2019)replaceComponentRenderer
hook ( deprecation mark in jsdocs - this is one iffy, because we didn't provide deprecation warnings in runtime and only had info in jsdoc / gatsby-browser docs)pathContext
(it was renamed topageContext
in v2) ( deprecation code )graphql
function without importing it fromgatsby
( code )push
,replace
,navigateTo
functions ( code with deprecation messages )Dependencies
sharp
version (requires Node 10+)react-hot-loader
withreact-refresh
(it has some behaviour differences + seems to requirereact >= 16.10
according to this comment - react-refresh + ReactDOM: hot reloading only works when bundling React facebook/react#17626 (comment) )drop Node 8 support (not clear which category to put this in - this affect not only core, but also plugins that we maintain, and we are mostly bitten by inability to bump various dependencies)(chore: bump node min version to 10.13.0 #22400)Unclear if breaking changes:
gatsby-plugin-typescript
, it's unclear if for users of that plugin adding built in support would cause problems or not)page-data
and js bundles (unclear because it depends how it's implemented, ideally final result would be failing builds if budgets are exceeded which would be breaking change, but we could start with warnings and change that to hard fails in next major)gatsby-(config/node/browser/ssr)
files in package subdirectories (allowing us to havedist
/build
directories in our plugins instead of placing them in root of the package, which makes any cleanup messy) - TBD if we should make use ofmain
or some custom package.json optionDeprecations
createNode
anddeleteNode
function signature (createNode(node)
vsdeleteNode({ node })
right now) - we can still support currentdeleteNode
signature, doesn't have to be breaking changecreateJob
,setJob
,endJob
(v1)souceNodes
API (only allow it increateSchemaCustomization
API):createFieldExtension
,createTypes
,addThirdPartySchema
)Major new APis
This are meant as brand new APIs that will enable completely new workflows and features
GraphQL renderable type
)gatsby-source-contentful
to touch and delete nodes. We could have nicer higher level APIs for this.Shifting conventions
Those doesn't strictly need breaking changes, those are meant as alternative APIs for what we already support (with goal of deprecating old ways if they same level APIs - adding shortcuts for common workflows won't result in deprecated lower level APIs it will rely on)
/src/pages/[MarkdownRemark].js
)reporter
to gatsby core (or even to separate package, i.e.gatsby-reporter
)null
in certain cases (fix(gatsby): context.nodeModel.runQuery should return [] instead of null #25885)Large refactors
(high chance of introducing behaviour changes, so might be best to schedule those for next major version)
*
). Unless developer already knows what will (or should) happen it's extremely difficult to follow effects that actions have and recognise implications of making changes.Motivation
We try to avoid breaking changes where possible, but sometimes they are necessary in order to implement or improve features. We want to batch any breaking changes into a major version release. This is a place to keep track of what those changes might be.
Beta Was this translation helpful? Give feedback.
All reactions