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

Rework #34

Merged
merged 22 commits into from Mar 31, 2018

Conversation

Projects
None yet
4 participants
@solnic
Copy link
Member

solnic commented Mar 28, 2018

Summary

  • Add HTTP::Schema and HTTP::Attribute
  • Add custom HTTP::MapperCompiler
  • Remove manual transformations in favor of auto-mapping feature from core
  • Remove applying transformations in insert/update - this type of functionality is not supported by core and it's actually something we intentionally do not want to have. Input that doesn't match canonical data structures can be handled by changesets with their mappings
  • Refactor Dataset so that it only uses its options
  • Remove Dataset#name as it felt like additional complexity
  • Remove Dataset::ClassInterface (we're in beta phase, no need to go through deprecation cycles)
  • Add Dataset#{get?,post?,put?,delete?}
  • Remove HTTP::Relation#wrap as this is now a core method and it does something else
  • Simplify specs

@solnic solnic requested review from cflipse , flash-gordon , AMHOL and timriley Mar 28, 2018

@solnic

This comment has been minimized.

Copy link
Member

solnic commented Mar 30, 2018

@AMHOL @cflipse @flash-gordon @timriley ding dong, please check this out. I'd love to get it done and add a couple features (associations mostly and a built-in json adapter specialization) on top of this rework.

@cflipse

This comment has been minimized.

Copy link
Contributor

cflipse commented Mar 30, 2018

Looks okay so far

@flash-gordon
Copy link
Member

flash-gordon left a comment

you're still good at programming


require 'rom/http/attribute'
require 'rom/http/schema/dsl'
require 'rom/http/schema/dsl'

This comment has been minimized.

@flash-gordon

flash-gordon Mar 30, 2018

Member

repetitive require

else
:id
end
schema.primary_key[0].name

This comment has been minimized.

@flash-gordon

flash-gordon Mar 30, 2018

Member

I think we can have a missing method here, mb it's a good idea to raise a meaningful exception

@solnic solnic force-pushed the rework branch from 1081454 to cb8d39d Mar 31, 2018

solnic added some commits Mar 28, 2018

Rework
  * Add HTTP::Schema and HTTP::Attribute
  * Add custom HTTP::MapperCompiler
  * Remove manual transformations in favor of auto-mapping feature from core
  * Simplify some specs
  * Remove applying transformations in insert/update - this type of
    functionality is not supported by core and it's actually something we
    intentionally do not want to have. Input that doesn't match
    canonical data structures can be handled by changesets with their
    mappings
Refactor dataset/gateway and specs
* Rely on options exclusively in dataset, remove config idea completely
* Remove Dataset#name, use #base_path
* Refactor dataset spec using simpler syntax and simpler examples
* Change Gateway#dataset to set up a dataset using options based on its config
Simplify relation spec
It's better to have duplication in specs than to make it more complex
with more blocks and meta-programming
More clean up in Dataset
  * Use constants for default values
  * Use HTTP::Types::Path instead of utility method
  * Simplify option declarations

@solnic solnic force-pushed the rework branch from 10167c4 to e930a81 Mar 31, 2018

@solnic solnic merged commit 536529a into master Mar 31, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@solnic

This comment has been minimized.

Copy link
Member

solnic commented Mar 31, 2018

I merged this in, feel free to provide further feedback here though, and I'll address it in new PRs or directly in master.

@AMHOL

This comment has been minimized.

Copy link
Member

AMHOL commented Apr 3, 2018

@solnic can this branch be deleted?

@solnic solnic deleted the rework branch Apr 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment