Coder Social home page Coder Social logo

sorbet-runtime-stub's People

Contributors

alexdunae avatar morriar avatar paracycle avatar rafaelfranca avatar shopify-admins avatar shopify-services avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sorbet-runtime-stub's Issues

Suggestion: Peg versions to sorbet-runtime versions

Summary

I'd like us to peg versions of sorbet-runtime-stub to the versions of sorbet-runtime to increase developer ease of use

Further Description

I am working with my team to create a standard where we load sorbet-runtime-stub if a client of a gem does not have sorbet-runtime.

For example, we might want to do this:
gem_root/sorbet_runtime_version.rb

# I have the 0 at the end so that we semantically lock the runtime version of runtime to the pegged version in sorbet-runtime-stub
SORBET_RUNTIME_VERSION = '~> 0.5.5369.0'

gem_root/my_special_gem/my_special_gem.gemspec

require '../sorbet_runtime_version.rb`
Gem::Specification.new do |spec|
  # ...
  spec.add_development_dependency 'sorbet-runtime', SORBET_RUNTIME_VERSION
  spec.add_dependency 'sorbet-runtime-stub', SORBET_RUNTIME_VERSION
  # ...

gem_root/my_special_gem/lib/my_special_gem.rb

require './sorbet_runtime_version.rb`
# ...
begin
  gem 'sorbet-runtime', SORBET_RUNTIME_VERSION
  require 'sorbet-runtime'
rescue Gem::LoadError
  require 'sorbet-shim'
end
# ..

The Proposal

Peg versions of this gem to sorbet-runtime. If there need to be intermediate releases of sorbet-runtime-stub between versions of sorbet-runtime, then we can specify them as additional releases after. For example, if we want to peg to sorbet-runtime version 0.5.5369, but we have several releases, we could release: 0.5.5369.1, 0.5.5369.2, 0.5.5369.3, etc. In that case, consumers would still always load the newest version of the stub that is compatible with sorbet-runtime.

This will allow me to specify the runtime version in one place (semver compatible), and then reference it when loading either the stub or the actual runtime sorbet in a way that feels natural.

Let me know if you'd like to incorporate this convention!

Add some tests

We should at least have a test comparing the behavior of a program with the stub versus with the real sorbet-runtime.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.