shopify / sorbet-runtime-stub Goto Github PK
View Code? Open in Web Editor NEWStub definitions for Sorbet's `T` namespace
License: MIT License
Stub definitions for Sorbet's `T` namespace
License: MIT License
I'd like us to peg versions of sorbet-runtime-stub
to the versions of sorbet-runtime
to increase developer ease of use
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
# ..
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!
We should at least have a test comparing the behavior of a program with the stub versus with the real sorbet-runtime
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.