Skip to content
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
Merged

Rework #34

merged 22 commits into from Mar 31, 2018

Conversation

solnic
Copy link
Member

@solnic 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
Copy link
Member Author

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
Copy link
Contributor

cflipse commented Mar 30, 2018

Looks okay so far

Copy link
Member

@flash-gordon flash-gordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're still good at programming


require 'rom/http/attribute'
require 'rom/http/schema/dsl'
require 'rom/http/schema/dsl'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repetitive require

else
:id
end
schema.primary_key[0].name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Piotr Solnica added 22 commits March 31, 2018 12:54
  * 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
* 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
It's better to have duplication in specs than to make it more complex
with more blocks and meta-programming
  * Use constants for default values
  * Use HTTP::Types::Path instead of utility method
  * Simplify option declarations
@solnic
Copy link
Member Author

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
Copy link
Member

AMHOL commented Apr 3, 2018

@solnic can this branch be deleted?

@solnic solnic deleted the rework branch April 3, 2018 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants