-
Notifications
You must be signed in to change notification settings - Fork 155
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
Flutter freezed v4.0.0 #47
Conversation
TypeNamePattern are used to configure the class and its factories whiles the FieldNamePattern is used to configure the parameters. New plugin-config interface
Using tuples instead of Records, we sacrifice IDE auto-complete and bloated config for positional(poor IDE support) but compact config New interface
config-value provides some methods that parses the config and returns ready-to-consume values in the various blocks
…e domains applying DDD concepts: moved every function into its appropirate domain dropped support for customDecorators, FreezedFactoryBlockRepository class renamed to NodeRepository class, FreezedConfigValue class renamed to Config classs
The previous version mutated properties of the class to generated the output. This made it very difficult to write tests without running the whole plugin and good luck tracking bugs and wrong generated output. This rewrite used functions everywhere for everything. Being static methods, you can test each independently without having to create a full instance of the class. Using value objects eliminates the use of primitive values plus ensures that we have a valid value everytime.
🦋 Changeset detectedLatest commit: b6c4b01 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@charlypoly @Urigo we have a green flag ... over to you |
hey @Parables can you create a changeset #47 (comment) |
Sure, I will that around 10pm GMT |
@saihaj done as requested |
@saihaj I have to correct some typos and grammatical errors in the guide but I have to do that at school as I am already running late. Give me about 1 hour 30 mins to get to school so that we can continue |
And please how do I fix the prettier error? |
@saihaj I am back, what else do you need me to do? |
Done that but there are no changes to be committed here on my local branch. However, when I run I didn't commit them because it was not my intention to modify them. Any other solution? |
fromJsonToJson will be implented in the next release
weird I pulled this branch and ran prettier and it was just this plugin b6c4b01 |
Thanks very much @saihaj. I couldn't have figured out this issue on my own. The guide for this plugin on the website to has been updated. Everything is ready now for release. |
hmm so something went wrong with CI publish flow. So will investigate it @Parables |
Thanks very much for your dedication @saihaj |
/theguild newsletter |
Description
The motivation for this version started when @endigo identified some bugs with the plugin.
As a quick resolution, I suggested this solution .
Then it hit me... I took a look at the schema @endigo mentioned and realized how big it was, I tried implementing my initial suggestion on that schema and ended up with a bloated config file spanning close to 500 lines just for some minor configurations.
I was working on a project at that time and was writing pure CSS. It was then that I began to wonder how certain CSS properties have multiple syntaxes. Taking inspiration from the flexibility CSS offers, I began experimenting with RegExp to be used for configuring the plugin.
Initially, I thought I was going too far with this but I stubbornly persisted... +3 months of sleepless nights debugging and tons of refactoring later, comes this PR which hopefully might inspire other plugins too.
Documentation is still in progress and video tutorials will soon follow once this PR gets merged.
Looking forward to your usual collaboration @charlypoly, @Urigo and all the team at the Guild
Related # (issue)
Replaces #8350 and #14
Type of change
How Has This Been Tested?
All modules have a corresponding test file that verifies the generated output.
yarrn
yarn test
Test Environment:
@graphql-codegen/...
: latestChecklist: