-
Notifications
You must be signed in to change notification settings - Fork 10.3k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wishlist for the next major version of Gatsby (v3) #15277
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 |
First class TypeScript support was pretty popular on https://twitter.com/chatsidhartha/status/1155820333095505920?s=20 as well |
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. |
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... |
Another thing mentioned was deprecating |
I think this should be in by default but since it's a breaking change we'll postpone it to the next major bump. |
Remove automatic __typename adddition to queries. |
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) |
Support for creating collection of pages (i.e. (would require thinking through how page paths are determined) |
Built in support for pagination via some query directives |
My wishlist for feature additions:
|
Seconding the first class typescript support |
FastRefresh hot loader as default (and then required is updating minimum react semver range) |
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. |
Added with react bump needed note
There is note:
But probably need more visibility (screaming red color! :) ) in the description |
I would also like to standardize our deprecation approach. Both in the code and in process. Right now we just have littered console warnings in various places which doesn't feel maintainable. If we deprecate a feature, in order to go back and actually remove it in the next major would require some significant sleuthing. |
If we update the minimum semver of React, then we can modernize our internal components too. That could also be a minor update after v3 is launched. |
I know ... I spend few hours browsing source code to generate list of deprecated things that we will possibly remove
Yeah - I don't think we would update components immediately - maybe just some critical ones that are pretty difficult to reason about right now (thinking of you |
Please also focus on 10890 |
We should make the reporter part of gatsby and not gatsby-cli. (i'll create an issue with more details)
The reporter will emit events so gatsby-cli, gatsby-desktop, gatsby-cloud can listen to them. This will remove our redux store merging and remove the complexity of our code.
|
@freiksenet does GQL renderable type enable a way to improve DX around using |
We should start validating and sanitizing Also worth considering sanitizing node field names. At the moment node field name can be anything (for example |
Not including moment in my production bundle would save me ~18 KB. |
@mbrandau moment is used in the graphql layer btw — not for browser JS. We don't include any date libraries by default |
@KyleAMathews well, sorry for wasting your time and cluttering up this issue. I searched for moment everywhere but not in gatsby-browser.js 🤦♂️ Problem solved, totally my fault. |
Manual code splitting (see #18689) would be great! This would let a CMS dynamically pick content, and the front-end would only import certain components based on the CMS content. |
Definitely agree with @nandorojo, manual code-splitting would be a great foundational change for sites with different components not to bulk their javascript bundles (where Gatsby's current template/page based splitting approach may not be ideal for performance reasons). But with the open (draft) PR #24903, is there a reason why it would be a breaking/major change instead of a minor release? cc @pieh |
Core feature itself will not have breaking changes - just additional APIs. I hope that various plugins will be able to build abstractions on top of it, so breaking changes would lie in plugins most likely (if those would use those APIs, it forces users to upgrade |
Do I understand correctly, it will allow for multiple markdown collections, that will have different node types in graphql schema, like PostMarkdownRemark, ArticleMarkdownRemark etc.? |
Fix filtering API to always return an array, never |
Deprecate long-running async operations inside most lifecycle APIs. Currently there is no standardised place where source plugins create watchers, websockets etc for updating content. We should stop allowing them in most APIs, maintaining them for |
Remove behavior that |
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! |
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! |
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. |
@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! |
|
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 |
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?" |
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 |
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. |
APIs are run serially — which is often what we want but some APIs should be run in parallel e.g. |
Move runtime code under a |
Use the module/nomodule pattern to load modern javascript for modern browsers but falling back to older javascript when an older browser is detected. |
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. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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.
The text was updated successfully, but these errors were encountered: