From 0a6b618da32f5ea69f31a28b035eee6bf6928a1a Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 6 Apr 2021 19:53:13 -0400 Subject: [PATCH 01/49] merged --- docs/SUMMARY.md | 2 +- docs/hyper-model/README.md | 22 +- docs/hyper-state/README.md | 8 +- docs/hyper-state/old-param-state-stuff.md | 358 ---------------------- 4 files changed, 19 insertions(+), 371 deletions(-) delete mode 100644 docs/hyper-state/old-param-state-stuff.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 2c24fd661..3a639f989 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -32,7 +32,7 @@ * [Operations](operations/README.md) * [Policies](policies/README.md) * [Internationalization](internationalization/README.md) -* [Development Workflow and Procedures](development-workflow/README.md) +* [Development Tools, Workflow and Procedures](development-workflow/README.md) * [Debugging](development-workflow/debugging.md) * [HyperTrace](development-workflow/hyper-trace.md) * [HyperSpec](development-workflow/hyper-spec/README.md) diff --git a/docs/hyper-model/README.md b/docs/hyper-model/README.md index b0c5205d0..d3cbb95c2 100644 --- a/docs/hyper-model/README.md +++ b/docs/hyper-model/README.md @@ -15,7 +15,7 @@ In other words, one browser creates, updates, or destroys a Model, and the chang * You access your Model data in your Components, Operations, and Stores just like you would on the server or in an ERB or HAML view file. * If an optional push transport is connected Hyperstack broadcasts any changes made to your ActiveRecord models as they are persisted on the server or updated by one of the authorized clients. -* Some Models can be designated as _server-only_ which means they are not available to the Isomorphic code. +* Some Models (or even parts of Models) can be designated as _server-only_ which means they are not available to the client code. For example, consider a simple model called `Dictionary` which might be part of Wiktionary type app. @@ -38,8 +38,7 @@ class WordOfTheDay < Hyperstack::Component def pick_entry! # pick a random word and assign the selected record to entry - @entry = Dictionary.defined.all[rand(Dictionary.defined.count)] - force_update! # redraw our component when the word changes + mutate @entry = Dictionary.defined[rand(Dictionary.defined.count)] # Notice that we use standard ActiveRecord constructs to select our # random entry value end @@ -61,7 +60,8 @@ class WordOfTheDay < Hyperstack::Component end ``` -For complete examples with _push_ updates, see any of the apps in the `examples` directory, or build your own in 5 minutes following one of the quickstart guides: +**This is the entire code. There are no application APIs needed. The synchronization between server and client is completely taken care of by HyperModel. If you have +an existing code base little to updates to your existing Models is needed, and you will use the same ActiveRecord API you have been using.** ## Isomorphic Models @@ -284,7 +284,7 @@ To force the value to be recomputed at the server append a `!` to the end of the `columns_hash`: returns the details of the columns specification. Note that on the server `columns_hash` returns a hash of objects specifying column information. On the client the entire structure is just one big hash of hashes. -`abstract_class=`, `abstract_class?`, `primary_key`, `primary_key=`, `inheritance_column`, `inheritance_column=`, `model_name`: All work as on the server. See ActiveRecord documentation for more info. +`abstract_class=`, `abstract_class?`, `primary_key`, `primary_key=`, `inheritance_column`, `inheritance_column=`, `model_name`, `serialize`, `alias_attribute`, `table_name`: All work as on the server. See ActiveRecord documentation for more info. ### Instance Methods @@ -313,6 +313,10 @@ end After a save operation completes the models will have an `errors` hash \(just like on the server\) with any validation problems. +`save` does not fail, but rather returns `{success: false ...}`. If there was an +exception the `message` key will hold the error information, otherwise the errors will +be stored in the records error data (as on the server.) + During the save operation the method `saving?` will return `true`. This can be used to instead of \(or with\) the promise to update the screen: ```ruby @@ -333,7 +337,9 @@ end Like `save` destroy returns a promise that is resolved when the destroy completes. -After the destroy completes the record's `destroyed?` method will return true. +After the destroy completes successfully the record's `destroyed?` method will return true. + +Like `save` destroy never fails, but rather returns `{success: false...}` #### Other Instance Methods @@ -391,12 +397,12 @@ The `load` method takes a list of attributes \(symbols\) and will insure these a before_mount do Todo.find(1).load(:name).then do |name| @name = name; - state.loaded! true + mutate @loaded = true end end ``` -Think hard about how you are using this, as Hyperstack already acts as flux store, and is managing state for you. It may be you are just creating a redundant store! +> Think hard about how you are using this, as Hyperstack already acts as flux store, and is managing state for you. It may be you are just creating a redundant store! ## Client Side Scoping diff --git a/docs/hyper-state/README.md b/docs/hyper-state/README.md index 7a8652320..6d0d88f80 100644 --- a/docs/hyper-state/README.md +++ b/docs/hyper-state/README.md @@ -9,8 +9,8 @@ The `Hyperstack::State::Observable` module allows you to build classes that shar The easiest way to understand HyperState is by example. If you you did not see the Tic-Tac-Toe example, then **[please review it now](client-dsl/interlude-tic-tac-toe.md)**, as we are going to use this to demonstrate how to use the `Hyperstack::State::Observable` module. -In our original Tic Tac Toe implementation the state of the game was stored in the `DisplayGame` component. State was updated by -"bubbling up" events from lower level components up to `DisplayGame` where the event handers updated the state. +In our original Tic-Tac-Toe implementation the state of the game was stored in the `DisplayGame` component. State was updated by +"bubbling up" events from lower level components up to `DisplayGame` where the event handler updated the state. This is a nice simple approach but suffers from two issues: + Each level of lower level components must be responsible for bubbling up the events to the higher component. @@ -366,7 +366,7 @@ the appropriate `mutate` or `observe` method. Typically in a large system you will have one or more central stores, and what you end up passing as parameters are either instances of those stores, or some other kind of index into the store. Or if (as in the case of our Game) there is only one store, you need not pass any parameters at all. -We can rewrite the last iteration of DisplayBoard to demonstrate this: +We can rewrite the previous iteration of `DisplayBoard` to demonstrate this: ```ruby class DisplaySquare @@ -391,7 +391,7 @@ Here `DisplayBoard` no longer takes any parameter (and should be renamed again t `DisplaySquare` takes the id of the square to display, but the game or the current board are never passed as parameters; there is no need to as they are implicit. -Whether to not pass store objects, an instance of a store, and index into the store is a design decision that depends on +Whether to pass (or not pass) a store class, an instance of a store, or some other index into the store is a design decision that depends on lots of factors, mainly how you see your application evolving over time. ### Summary of Methods diff --git a/docs/hyper-state/old-param-state-stuff.md b/docs/hyper-state/old-param-state-stuff.md deleted file mode 100644 index bd5e3497c..000000000 --- a/docs/hyper-state/old-param-state-stuff.md +++ /dev/null @@ -1,358 +0,0 @@ - - -### Param Equality - -Params can be arbitrarily - -### Params, Immutability and State - -Some care must be taken when passing params that are not simple scalars (string, numbers, etc) or JSON like -combinations of arrays and hashes. When passing more complex objects - -Hyperstack differs from React in how it deals with changes in param values - -A component will re-render when new param values are received. If it appears that parameter values have changed, -then the component will not re-render. For scalars such as strings and numbers and JSON like combinations of arrays -and hashes, the component will be re-rendered if the value of the param changes. - -For more complex objects such as application defined classes, there is generally no way to easily determine that an -object's value has changed. Hyperstack solves this problem with the `Observable` class, that allows objects to -track which components are depending on their values - -In React \(and Hyperstack\) state is mutable. Changes \(mutations\) to state variables cause Components to re-render. Where state is passed into a child Component as a `param`, it will cause a re-rendering of that child Component. Change flows from a parent to a child - change does not flow upward and this is why params are not mutable. - -State variables are normal instance variables or objects. When a state variable changes, we use the `mutate` method to get React's attention and cause a re-render. Like normal instance variables, state variables are created when they are first accessed, so there is no explicit declaration. - -The syntax of `mutate` is simple - its `mutate` and any other number of parameters and/or a block. Normal evaluation means the parameters are going to be evaluated first, and then `mutate` gets called. - -* `mutate @foo = 12, @bar[:zap] = 777` executes the two assignments first, then calls mutate -* or you can say `mutate { @foo = 12; @bar[:zap] = 777 }` which is more explicit, and does the same thing - -Here are some examples: - -```ruby -class Counter < HyperComponent - before_mount do - @count = 0 # optional initialization - end - - render(DIV) do - # note how we mutate count - BUTTON { "+" }.on(:click) { mutate @count += 1) } - P { @count.to_s } - end -end -``` - -```ruby -class LikeButton < HyperComponent - render(DIV) do - BUTTON do - "You #{@liked ? 'like' : 'haven\'t liked'} this. Click to toggle." - end.on(:click) do - mutate @liked = !@liked - end - end -end -``` - -### Components are Just State Machines - -React thinks of UIs as simple state machines. By thinking of a UI as being in various states and rendering those states, it's easy to keep your UI consistent. - -In React, you simply update a component's state, and then the new UI will be rendered on this new state. React takes care of updating the DOM for you in the most efficient way. - -### What Components Should Have State? - -Most of your components should simply take some params and render based on their value. However, sometimes you need to respond to user input, a server request or the passage of time. For this you use state. - -**Try to keep as many of your components as possible stateless.** By doing this you'll isolate the state to its most logical place and minimize redundancy, making it easier to reason about your application. - -A common pattern is to create several stateless components that just render data, and have a stateful component above them in the hierarchy that passes its state to its children via `param`s. The stateful component encapsulates all of the interaction logic, while the stateless components take care of rendering data in a declarative way. - -State can be held in any object \(not just a Component\). For example: - -```ruby -class TestIt - def self.swap_state - @@test = !@@test - end - - def self.result - @@test ? 'pass' : 'fail' - end -end - -class TestResults < HyperComponent - render(DIV) do - P { "Test is #{TestIt.result}" } - BUTTON { 'Swap' }.on(:click) do - mutate TestIt::swap_state - end - end -end -``` - -In the example above, the singleton class `TestIt` holds its own internal state which is changed through a `swap_state` class method. The `TestResults` Component has no knowledge of the internal workings of the `TestIt` class. - -When the BUTTON is pressed, we call `mutate`, passing the object which is being mutated. The actual mutated value is not important, it is the fact that the _observed_ object \(our `TestIt` class\) is being mutated that will cause a re-render of the _observing_ `TestResults` Component. Think about `mutate` as a way of telling React that the Component needs to be re-rendered as the state has changed. - -In the example above, we could also move the _observing_ and _mutating_ behaviour out of the Component completely and manage it in the `TestIt` class - in this case, we would call it a Store. Stores are covered in the Hyper-Store documentation later. - -### What Should Go in State? - -**State should contain data that a component's instance variables, event handlers, timers, or http requests may change and trigger a UI update.** - -When building a stateful component, think about the minimal possible representation of its state, and only store those properties in `state`. Add to your class methods to compute higher level values from your state variables. Avoid adding redundant or computed values as state variables as these values must then be kept in sync whenever state changes. - -### What Shouldn't Go in State? - -State should contain the minimal amount of data needed to represent your UI's state. As such, it should not contain: - -* **Computed data:** Don't worry about precomputing values based on state — it's easier to ensure that your UI is consistent if you do all computation during rendering. For example, if you have an array of list items in state and you want to render the count as a string, simply render `"#{@list_items.length} list items'` in your `render` method rather than storing the count as another state. -* **Data that does not effect rendering:** Changing an instance variable \(or any object\) that does not affect rendering does not need to be mutated \(i.e you do not need to call `mutate`\). - -The rule is simple: anytime you are updating a state variable use `mutate` and your UI will be re-rendered appropriately. - -### State and user input - -Often in a UI you gather input from a user and re-render the Component as they type. For example: - -```ruby -class UsingState < HyperComponent - - render(DIV) do - # the button method returns an HTML element - # .on(:click) is an event handeler - # notice how we use the mutate method to get - # React's attention. This will cause a - # re-render of the Component - button.on(:click) { mutate(@show = !@show) } - DIV do - input - output - easter_egg - end if @show - end - - def button - BUTTON(class: 'ui primary button') do - @show ? 'Hide' : 'Show' - end - end - - def input - DIV(class: 'ui input fluid block') do - INPUT(type: :text).on(:change) do |evt| - # we are updating the value per keypress - # using mutate will cause a rerender - mutate @input_value = evt.target.value - end - end - end - - def output - # rerender whenever input_value changes - P { "#{@input_value}" } - end - - def easter_egg - H2 {'you found it!'} if @input_value == 'egg' - end -end -``` - -### State and HTTP responses - -Often your UI will re-render based on the response to a HTTP request to a remote service. Hyperstack does not need to understand the internals of the HTTP response JSON, but does need to _observe_ the object holding that response so we call `mutate` when updating our response object in the block which executes when the HTTP.get promise resolves. - -```ruby -class FaaS < HyperComponent - render(DIV) do - BUTTON { 'faastruby.io' }.on(:click) do - faast_ruby - end - - DIV(class: :block) do - P { @hello_response['function_response'].to_s } - P { "executed in #{@hello_response['execution_time']} ms" } - end if @hello_response - end - - def faast_ruby - HTTP.get('https://api.faastruby.io/paulo/hello-world', - data: {time: true} - ) do |response| - # this code executes when the promise resolves - # notice that we call mutate when updating the state instance variable - mutate @hello_response = response.json if response.ok? - end - end -end -``` - -### State and updating interval - -One common use case is a component wanting to update itself on a time interval. It's easy to use the kernel method `every`, but it's important to cancel your interval when you don't need it anymore to save memory. Hyperstack provides Lifecycle Methods \(covered in the next section\) that let you know when a component is about to be created or destroyed. Let's create a simple mixin that uses these methods to provide a React friendly `every` function that will automatically get cleaned up when your component is destroyed. - -```ruby -module ReactInterval - - def self.included(base) - base.before_mount do - @intervals = [] - end - - base.before_unmount do - @intervals.each(&:stop) - end - end - - def every(seconds, &block) - Kernel.every(seconds, &block).tap { |i| @intervals << i } - end -end - -class TickTock < HyperComponent - include ReactInterval - - before_mount do - @seconds = 0 - end - - after_mount do - every(1) { mutate @seconds = @seconds + 1 } - end - - render(DIV) do - P { "Hyperstack has been running for #{@seconds} seconds" } - end -end -``` - -Notice that TickTock effectively has two `before_mount` methods, one that is called to initialize the `@intervals` array and another to initialize `@seconds` - - - -# Stores - -A core concept behind React is that Components contain their own state and pass state down to their children as params. React re-renders the interface based on those state changes. Each Component is discreet and only needs to worry about how to render itself and pass state down to its children. - -Sometimes however, at an application level, Components need to be able to share information or state in a way which does not adhere to this strict parent-child relationship. - -Some examples of where this can be necessary are: - -* Where a child needs to pass a message back to its parent. An example would be if the child component is an item in a list, it might need to inform it's parent that it has been clicked on. -* When Hyperstack models are passed as params, child components might change the values of fields in the model, which might be rendered elsewhere on the page. -* There has to be a place to store non-persisted, global application-level data; like the ID of the currently logged in user or a preference or variable that affects the whole UI. - -Taking each of these examples, there are ways to accomplish each: - -* Child passing a message to parent: the easiest way is to pass a `Proc` as a param to the child from the parent that the child can `call` to pass a message back to the parent. This model works well when there is a simple upward exchange of information \(a child telling a parent that it has been selected for example\). You can read more about Params of type Proc in the Component section of these docs. If howevere, you find yourself adding overusing this method, or passing messages from child to grandparent then you have reached the limits of this method and a Store would be a better option \(read about Stores in this section.\) -* Models are stores. An instance of a model can be passed between Components, and any Component using the data in a Model to render the UI will re-render when the Model data changes. As an example, if you had a page displaying data from a Model and let's say you have an edit button on that page \(which invokes a Dialog \(Modal\) based Component which receives the model as a param\). As the user edits the Model fields in Dialog, the underlying page will show the changes as they are made as the changes to Model fields will be observed by the parent Components. In this way, Models act very much like Stores. -* Stores are where global, application wide state can exist in singleton classes that all Components can access or as class instances objects which hold data and state. **A Store is a class or an instance of a class which holds state variables which can affect a re-render of any Component observing that data.** - -In technical terms, a Store is a class that includes the `include Hyperstack::State::Observable` mixin, which just adds the `mutate` and `observe` primitive methods \(plus helpers built on top of them\). - -In most cases, you will want class level instance variables that share data across components. Occasionally you might need multiple instances of a store that you can pass between Components as params \(much like a Model\). - -As an example, let's imagine we have a filter field on a Menu Bar in our application. As the user types, we want the user interface to display only the items which match the filter. As many of the Components on the page might depend on the filter, a singleton Store is the perfect answer. - -```ruby -# app/hyperstack/stores/item_store.rb -class ItemStore - include Hyperstack::State::Observable - - class << self - def filter=(f) - mutate @filter = f - end - - def filter - observe @filter || '' - end - end -end -``` - -In Our application code, we would use the filter like this: - -```ruby -# the TextField on the Menu Bar could look like this: -TextField(label: 'Filter', value: ItemStore.filter).on(:change) do |e| - ItemStore.filter = e.target.value -end - -# elsewhere in the code we could use the filter to decide if an item is added to a list -show_item(item) if item.name.include?(ItemStore.filter) -``` - -## The observe and mutate methods - -As with Components, you `mutate` an instance variable to notify React that the Component might need to be re-rendered based on the state change of that object. Stores are the same. When you `mutate` and instance variable in Store, all Components that are observing that variable will be re-rendered. - -`observe` records that a Component is observing an instance variable in a Store and might need to be re-rendered if the variable is mutated in the future. - -> If you `mutate` an instance variable outside of a Component, you need to `observe` it because, for simplicity, a Component observe their own instance vaibales. - -The `observe` and `mutate` methods take: - -* a single param as shown above -* a string of params \(`mutate a=1, b=2`\) -* or a block in which case the entire block will be executed before signalling the rest of the system -* no params \(handy for adding to the end of a method\) - -## Helper methods - -To make things easier the `Hyperstack::State::Observable` mixin contains some useful helper methods: - -The `observer` and `mutator` methods create a method wrapped in `observe` or `mutate` block. - -* `observer` -* `mutator` - -```ruby -mutator(:inc) { @count = @count + 1 } -mutator(:reset) { @count = 0 } -``` - -The `state_accessor`, `state_reader` and `state_writer` methods work just like `attr_accessor` methods except access is wrapped in the appropriate `mutate` or `observe` method. These methods can be used either at the class or instance level as needed. - -* `state_reader` -* `state_writer` -* `state_accessor` - -Finally there is the `toggle` method which does what it says on the tin. - -* `toggle` toggle\(:foo\) === mutate @foo = !@foo - -```ruby -class ClickStore - include Hyperstack::State::Observable - - class << self - observer(:count) { @count ||= 0 } - state_writer :count - mutator(:inc) { @count = @count + 1 } - mutator(:reset) { @count = 0 } - end -end -``` - -### Initializing class variables in singleton Store - -You can keep the logic around initialization in your Store. Remember that in Ruby your class instance variables can be initialized as the class is defined: - -```ruby -class CardStore - include Hyperstack::State::Observable - - @show_card_status = true - @show_card_details = false - - class << self - state_accessor :show_card_status - state_accessor :show_card_details - end -end -``` From ee7f4f05bae1ca3cada1bf86bff43041e4554ac7 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 6 Apr 2021 20:17:43 -0400 Subject: [PATCH 02/49] merged --- docs/hyper-state/README.md | 169 ++++++++++++++++++++++++------------- 1 file changed, 111 insertions(+), 58 deletions(-) diff --git a/docs/hyper-state/README.md b/docs/hyper-state/README.md index 6d0d88f80..5c6a5aff2 100644 --- a/docs/hyper-state/README.md +++ b/docs/hyper-state/README.md @@ -1,16 +1,15 @@ - The `Hyperstack::State::Observable` module allows you to build classes that share their state with Hyperstack Components, and have those components update when objects in those classes change state. - -## This Page Under Construction - -The `Hyperstack::State::Observable` module allows you to build classes that share their state with Hyperstack Components and have those components update when objects in those classes change state. ### Revisiting the Tic Tac Toe Game The easiest way to understand HyperState is by example. If you you did not see the Tic-Tac-Toe example, then **[please review it now](client-dsl/interlude-tic-tac-toe.md)**, as we are going to use this to demonstrate how to use the `Hyperstack::State::Observable` module. In our original Tic-Tac-Toe implementation the state of the game was stored in the `DisplayGame` component. State was updated by +<<<<<<< Updated upstream "bubbling up" events from lower level components up to `DisplayGame` where the event handler updated the state. +======= +"bubbling up" events from lower level components up to `DisplayGame` where the event hander updated the state. +>>>>>>> Stashed changes This is a nice simple approach but suffers from two issues: + Each level of lower level components must be responsible for bubbling up the events to the higher component. @@ -19,11 +18,11 @@ This is a nice simple approach but suffers from two issues: As our applications become larger we will want a way to keep each component's interface isolated and not dependent on the overall architecture, and to insure good separation of concerns. -The `Hyperstack::State::Observable` module allows us to put the game's state into a separate class, which can be accessed from any -component: No more need to bubble up events, and no more cluttering up our `DisplayGame` component with state management stuff +The `Hyperstack::State::Observable` module allows us to put the game's state into a separate class which can be accessed from any +component: No more need to bubble up events, and no more cluttering up our `DisplayGame` component with state management and details of the game's data structure. -Here is the game state moved out of the `DisplayGame` component into its own class: +Here is the game state and associated methods moved out of the `DisplayGame` component into its own class: ```ruby class Game @@ -73,9 +72,8 @@ class Game include Hyperstack::State::Observable ``` -Including `Hyperstack::State::Observable` gives us access to a number of methods that allows our class to become -a *reactive store*, and interact with other stores and components so that when the `Game` state updates so will -any components that directly or indirectly depend on its state. +`Game` is now in its own class and includes `Hyperstack::State::Observable`. This adds a number of methods to `Game` that allows our class to become +a *reactive store*. When `Game` interacts with other stores and components they will be updated as the state of `Game` changes. ```ruby def initialize @@ -84,9 +82,9 @@ any components that directly or indirectly depend on its state. end ``` -In the original implementation we initialized the two state variables `@history` and `@step` in the `before_mount` callback. -There is no "mounting" of a store, so instead we will initialize our game by creating a new instance in the `DisplayGame` before -mount callback (see below.) +In the original implementation we initialized the two state variables `@history` and `@step` in the `before_mount` callback. The same initialization +is now in the `initialize` method which will be called when a new instance of the game is created. This will still be done in the `DisplayGame` +`before_mount` callback (see below.) ```ruby observer :player do @@ -108,8 +106,7 @@ been changed `observe` and `observer` indicate that state has been accessed outs attr_reader :history ``` -Just as we have `mutate`, `mutator`, and `state_writer`, we have `observe`, `observer`, and `state_reader`. The `state_accessor` -method just combines the two together. +Just as we have `mutate`, `mutator`, and `state_writer`, we have `observe`, `observer`, and `state_reader`. ```ruby WINNING_COMBOS = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]] @@ -178,7 +175,7 @@ end The `DisplayGame` `before_mount` callback is still responsible for initializing the game, but it no longer needs to be aware of the internals of the game's state. It simply calls `Game.new` and stores the result in the `@game` instance variable. For the rest -of the component call the appropriate method on `@game`. +of the component's code we call the appropriate method on `@game`. We will need to pass the entire game to `DisplayBoard` (we will see why shortly) so we will rename it to `DisplayCurrentBoard`. @@ -216,7 +213,7 @@ communicate back upwards via events. Instead we communicate through the central Rather than sending params down to lower level components, and having the components bubble up events, we have created a *Flux Loop*. The `Game` store holds the state, the top level component reads the state and sends it down to lower level components, those -components update the state, causing the top level component to re-rerender. +components update the `Game` state causing the top level component to re-rerender. This structure greatly simplifies the structure and understanding of our components, and keeps each component functionally isolated. @@ -224,11 +221,12 @@ Furthermore algorithms such as `current_winner?` now are neatly abstracted out i ### Classes and Instances -If we are sure we will only want one Game board, we could define Game with class methods like this: +If we are sure we will only want one game board, we could define `Game` with class methods like this: ```ruby class Game include Hyperstack::State::Observable + class << self def initialize @history = [[]] @@ -286,7 +284,6 @@ class DisplayBoard < HyperComponent end class DisplayGame < HyperComponent - before_mount { Game.initialize } def moves return unless Game.history.length > 1 @@ -316,33 +313,14 @@ class DisplayGame < HyperComponent end ``` -Note that with this approach we can go back to passing just the current board to `DisplayBoard` as `DisplayBoard` can -directly access `Game.handle_click!` since there is only one game. - -### The Boot Broadcast - -Observable classes can also receive information from *broadcasts*. Hyperstack comes with one predefined broadcast: `Hyperstack::Application::Boot` which is sent when the application has finished loading but before the first component is mounted. +Now instead of creating an instance and passing it around we +call the class level methods on `Game` throughout. -We can hook into the Boot broadcast and replace the need for our top level component to call initialize: +The `Hyperstack::State::Observable` module will call any class level `initialize` methods in the class or subclasses +before the first component mounts. -```ruby -class Game - include Hyperstack::State::Observable - - receives Hyperstack::Application::Boot do - @history = [[]] - @step = 0 - end - - class << self - ... - end -end -... -``` -> Why is `receives` outside the class definitions? The receives method can be used to attach broadcasts to either class level or -instances. In this case we want to attach the receiver to Game, not to Game's singleton class. More on receivers and broadcasting -in the chapter on Operations. +Note that with this approach we can go back to passing just the current board to `DisplayBoard` as `DisplayBoard` can +directly access `Game.handle_click!` since there is only one game. ### Thinking About Stores @@ -359,11 +337,9 @@ If your store's methods access other stores, you do not need worry about their s that the built in Ruby Array and Hash classes are **not** stores, so when you modify or read an Array or a Hash its up to you to use the appropriate `mutate` or `observe` method. -> Why not make Arrays and Hashes stores? For efficiency. Its a comprimise solution. - ### Stores and Parameters -Typically in a large system you will have one or more central stores, and what you end up passing as parameters are either instances of those stores, or some other kind of index into the store. Or if (as in the case of our Game) there is only one store, you +Typically in a large system you will have one or more central stores, and what you end up passing as parameters are either instances of those stores, or some other kind of index into the store. If there is only one store (as in the case of our Game), you need not pass any parameters at all. We can rewrite the previous iteration of `DisplayBoard` to demonstrate this: @@ -387,8 +363,8 @@ class DisplayBoard < HyperComponent end ``` -Here `DisplayBoard` no longer takes any parameter (and should be renamed again to `DisplayCurrentBoard`) and now -`DisplaySquare` takes the id of the square to display, but the game or the current board are never passed as parameters; +Here `DisplayBoard` no longer takes any parameter (and could be renamed again to `DisplayCurrentBoard`) and now a new component - +`DisplaySquare` - takes the id of the square to display, but the game or the current board are never passed as parameters; there is no need to as they are implicit. Whether to pass (or not pass) a store class, an instance of a store, or some other index into the store is a design decision that depends on @@ -398,11 +374,11 @@ lots of factors, mainly how you see your application evolving over time. All the observable methods can be used either at the class or instance level. -#### Observing State +#### Observing State: `observe, observer, state_reader` The `observe` method takes any number of arguments and/or a block. The last argument evaluated or the value of the block is returned. -The arguments and block are evaluated then the objects state will be *observed*. +The arguments and block are evaluated then the object's state will be *observed*. If the block exits with a return or break, the state will **not** be observed. @@ -416,7 +392,7 @@ observe do end ``` -The `observer` method defines a new method with an implicit observer call: +The `observer` method defines a new method with an implicit observe: ```ruby observer :foo do |x, y, z| @@ -449,10 +425,87 @@ def baz end ``` -#### Mutating State +#### Mutating State: `mutate, mutator, state_writer, toggle` + +The `mutate` method takes any number of arguments and/or a block. The last argument evaluated or the value of the block is returned. + +The arguments and block are evaluated then the object's state will be *mutated*. + +If the block exits with a return or break, the state will **not** be mutated. + +```ruby +# evaluate and return a value +mutate @history[@step] + +# evaluate a block and return its value +mutate do + @history[@step] +end +``` + +The `mutator` method defines a new method with an implicit mutate: + +```ruby +mutator :foo do |x, y, z| + ... +end +``` +is equivilent to +```ruby +def foo(x, y, z) + mutate do + ... + end +end +``` + +Again if the block exits with a `return` or `break` the state will **not** be mutated. + +The `state_writer` method declares one or more state accessors with an implicit state mutation: + +```ruby +state_reader :bar, :baz +``` +is equivilent to +```ruby +def bar=(x) + mutate @bar = x +end +def baz=(x) + observe @baz = x +end +``` + +The `toggle` method reverses the polarity of a instance variable: + +```ruby +toggle(:foo) +``` +is equivilent to +```ruby +mutate @foo = !@foo +``` + +#### The `state_accessor` Method + +Combines `state_reader` and `state_writer` methods. + +```ruby +state_accessor :foo, :bar +``` +is equivilent to +```ruby +state_reader :foo, :bar +state_writer :foo, :bar +``` + +### Components and Stores +The standard `HyperComponent` base class includes `Hyperstack::State::Observable` so any `HyperComponent` has access to +all of the above methods. A component also always **observes itself** so you never need to use `observe` within +a component **unless** the state will be accessed outside the component. However once you start doing that you +would be better off to move the state into a separate store. -receives -mutate, mutator, state_writer -state_accessor -toggle +> In addition components also act as the **Observers** in the system. What this means is +that current component that is running its render method is recording all stores that call `observe`, when +a store mutates, then all the components that recorded observations will be rerendered. From b60eede2e410b8ed327800b08d6d8175f2fe7a8d Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 6 Apr 2021 20:18:26 -0400 Subject: [PATCH 03/49] how does this even happen --- ruby/hyper-state/lib/ext/object_space.rb | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ruby/hyper-state/lib/ext/object_space.rb diff --git a/ruby/hyper-state/lib/ext/object_space.rb b/ruby/hyper-state/lib/ext/object_space.rb new file mode 100644 index 000000000..1fed670ea --- /dev/null +++ b/ruby/hyper-state/lib/ext/object_space.rb @@ -0,0 +1,25 @@ +module ObjectSpace + def self.each_object(target_klass, &block) + klasses = [Object] + i = 0 + loop do + klass = klasses[i] + yield klass + names = `klass.$$const` && `Object.keys(klass.$$const)` + names.each do |name| + begin + k = klass.const_get(name) rescue nil + next unless `k.$$const` + next unless k.respond_to?(:is_a?) + next if klasses.include?(k) + + klasses << k if k.is_a? target_klass + rescue Exception => e + next + end + end if names + i += 1 + break if i >= klasses.length + end + end +end From 2362c10fb5d8e64e3cd5803eb049c8048a74e6b0 Mon Sep 17 00:00:00 2001 From: catmando Date: Wed, 7 Apr 2021 12:10:08 -0400 Subject: [PATCH 04/49] updated release note --- release-notes/1.0.alpha1.8.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release-notes/1.0.alpha1.8.md b/release-notes/1.0.alpha1.8.md index 23ec55420..b4fc8e4b8 100644 --- a/release-notes/1.0.alpha1.8.md +++ b/release-notes/1.0.alpha1.8.md @@ -24,6 +24,7 @@ None ### Feature Added + [#401](https://github.com/hyperstack-org/hyperstack/issues/401) Can call `receives` inside the singleton class. ++ [#124](https://github.com/hyperstack-org/hyperstack/issues/124) HyperModel time now is in milliseconds ### Fixed From 41ad714a2fc54911bc69d604293758451c568e5b Mon Sep 17 00:00:00 2001 From: catmando Date: Wed, 7 Apr 2021 12:31:49 -0400 Subject: [PATCH 05/49] closes issue #403 --- docs/hyper-state/README.md | 3 ++- release-notes/1.0.alpha1.8.md | 1 - ruby/hyper-spec/lib/hyper-spec/helpers.rb | 6 +++++- ruby/hyper-spec/spec/hyper_spec.rb | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/hyper-state/README.md b/docs/hyper-state/README.md index 4d044c6bb..0f3131d14 100644 --- a/docs/hyper-state/README.md +++ b/docs/hyper-state/README.md @@ -348,6 +348,7 @@ class DisplaySquare .on(:click) { Game.handle_click(id) } end end + class DisplayBoard < HyperComponent render(DIV) do (0..6).step(3) do |row| @@ -503,5 +504,5 @@ a component **unless** the state will be accessed outside the component. Howev would be better off to move the state into a separate store. > In addition components also act as the **Observers** in the system. What this means is -that current component that is running its render method is recording all stores that call `observe`, when +that the current component that is running its render method is recording all stores that call `observe`, when a store mutates, then all the components that recorded observations will be rerendered. diff --git a/release-notes/1.0.alpha1.8.md b/release-notes/1.0.alpha1.8.md index b4fc8e4b8..23ec55420 100644 --- a/release-notes/1.0.alpha1.8.md +++ b/release-notes/1.0.alpha1.8.md @@ -24,7 +24,6 @@ None ### Feature Added + [#401](https://github.com/hyperstack-org/hyperstack/issues/401) Can call `receives` inside the singleton class. -+ [#124](https://github.com/hyperstack-org/hyperstack/issues/124) HyperModel time now is in milliseconds ### Fixed diff --git a/ruby/hyper-spec/lib/hyper-spec/helpers.rb b/ruby/hyper-spec/lib/hyper-spec/helpers.rb index c5d05df04..e86104f20 100644 --- a/ruby/hyper-spec/lib/hyper-spec/helpers.rb +++ b/ruby/hyper-spec/lib/hyper-spec/helpers.rb @@ -82,7 +82,11 @@ def before_mount(&block) def isomorphic(&block) yield - before_mount(&block) + if page.instance_variable_get('@hyper_spec_mounted') + internal_evaluate_ruby(&block) + else + before_mount(&block) + end end # Allows options to the mount method to be specified globally diff --git a/ruby/hyper-spec/spec/hyper_spec.rb b/ruby/hyper-spec/spec/hyper_spec.rb index beff868f9..d1e2af1d6 100644 --- a/ruby/hyper-spec/spec/hyper_spec.rb +++ b/ruby/hyper-spec/spec/hyper_spec.rb @@ -108,6 +108,20 @@ def factorial(n) expect(evaluate_ruby('factorial(5)')).to eq(factorial(5)) end + it "can load isomorphic code after loading" do + on_client do + CONSTANT = 1 + end + CONSTANT = 1 + isomorphic do + def factorial(n) + n==CONSTANT ? CONSTANT : n * factorial(n-CONSTANT) + end + nil + end + expect(evaluate_ruby('factorial(5)')).to eq(factorial(5)) + end + context 'promise helpers' do # just to demonstrate a few things: # 1 - You can use methods like mount, isomorphic, on_client in before(:each) blocks From eb3b1ae153cabb1ccad6d93d5a5e98c2fd4bb434 Mon Sep 17 00:00:00 2001 From: catmando Date: Mon, 12 Apr 2021 22:31:11 -0400 Subject: [PATCH 06/49] ready for next point release --- current-status.md | 1 + docs/hyper-model/README.md | 56 +++++-------------- readme.md | 2 +- release-notes/1.0.alpha1.8.md | 8 ++- .../lib/hyperstack/component/version.rb | 2 +- .../lib/hyperloop/console/version.rb | 2 +- ruby/hyper-i18n/lib/hyper-i18n/version.rb | 2 +- .../hyper-i18n/lib/hyperstack/i18n/version.rb | 2 +- ruby/hyper-model/lib/hyper_model/version.rb | 2 +- .../lib/hyper-operation/version.rb | 2 +- .../lib/hyperstack/router/version.rb | 2 +- ruby/hyper-spec/lib/hyper-spec/version.rb | 2 +- .../lib/hyperstack/state/version.rb | 2 +- .../lib/hyperstack/legacy/store/version.rb | 2 +- ruby/hyper-trace/lib/hyper_trace/version.rb | 2 +- .../lib/hyperstack/config/version.rb | 2 +- .../lib/hyperstack/version.rb | 2 +- 17 files changed, 34 insertions(+), 59 deletions(-) diff --git a/current-status.md b/current-status.md index de398a2e7..5f3b632cc 100644 --- a/current-status.md +++ b/current-status.md @@ -10,6 +10,7 @@ We now are issuing 1.0 release candidates weekly until all issues are either clo | Release
Date | Version | Open
Issues | Documentation
Sections
Draft Ready | Documentation
Sections
WIP | |--------------|---------|-------------|-------|------| +| April 12, 2021 | 1.0.alpha1.8 | 128 | 36 | 9 | | April 5, 2021 | 1.0.alpha1.7 | 147 | 35 | 10 | | March 29, 2021 | 1.0.alpha1.6 | 167 | 35 | 10 | diff --git a/docs/hyper-model/README.md b/docs/hyper-model/README.md index d3cbb95c2..cad9ae85e 100644 --- a/docs/hyper-model/README.md +++ b/docs/hyper-model/README.md @@ -72,34 +72,7 @@ In order for Hyperstack to see your Models \(and make them Isomorphic\) you need | **Location of Models** | **Scope** | | :--- | :--- | | `app\models` | Server-side code only | -| `app\Hyperstack\models` | Isomorphic code \(client and server\) | - -### Rails 5.1.x - -Upto Rails 4.2, all models inherited from `ActiveRecord::Base`. But starting from Rails 5, all models will inherit from `ApplicationRecord`. - -To accommodate this change, the following file has been automatically added to models in Rails 5 applications. - -```ruby -# app/models/application_record.rb -class ApplicationRecord < ActiveRecord::Base - self.abstract_class = true -end -``` - -For Hyperstack to see this change, this file needs to be moved \(or copied if you have some server-side models\) to the `apps/Hyperstack` folder. - -### Explicit Scope Access - -In order to prevent unauthorized access to information like scope counts, lists of record ids, etc, Hyperstack now \(see issue [https://github.com/ruby-Hyperstack/hyper-mesh/issues/43](https://github.com/ruby-Hyperstack/hyper-mesh/issues/43)\) requires you explicitly allow scopes to be viewed on the client, otherwise you will get an AccessViolation. - -To globally allow access to all scopes add this to the ApplicationRecord class - -```ruby -class ApplicationRecord < ActiveRecord::Base - regulate_scope :all -end -``` +| `app\hyperstack\models` | Isomorphic code \(client and server\) | ## ActiveRecord API @@ -109,15 +82,15 @@ Hyperstack uses a subset of the standard ActiveRecord API to give your Isomorphi Hyperstack integrates with React \(through Components\) to deliver your Model data to the client without you having to create extra APIs or specialized controllers. The key idea of React is that when state \(or params\) change, the portions of the display effected by this data will be updated. -Hyperstack automatically creates React state objects that will be updated as server side data is loaded or changes. When these states change the associated parts of the display will be updated. +On the client each database record being used by the client is represented as an observable store **([see the chapter on HyperState for details](hyper-state/README.md))** which will mutate as server side data is loaded or changes. When these states change the associated parts of the display will be updated. -A brief overview of how this works will help you understand the how Hypeloop gets the job done. +A brief overview of how this works will help you understand the how HyperStack gets the job done. #### Rendering Cycle On the UI you will be reading models in order to display data. -If during the rendering of the display the Model data is not yet loaded, placeholder values \(the default values from the `columns_hash`\) will be returned by Hyperstack. +If during the rendering of the display the Model data is not yet loaded, placeholder values \(the default values from the database schema\) will be returned by Hyperstack. Hyperstack then keeps track of where these placeholders \(or `DummyValue`s\) are displayed, and when they do get loaded, those parts of the display will re-render. @@ -143,7 +116,7 @@ There are a number of methods that allow you to interact with this load cycle wh #### New and Create -`new`: Takes a hash of attributes and initializes a new unsaved record. The values of any attributes not specified in the hash will be taken from the Models default values specified in the `columns_hash`. +`new`: Takes a hash of attributes and initializes a new unsaved record. The values of any attributes not specified in the hash will be taken from the Models default values specified in the data base schema. If `new` is passed a native javascript object it will be treated as a hash and converted accordingly. @@ -209,7 +182,7 @@ Word.offset(500).limit(20) # get words 500-519 #### Applying Class Methods to Collections -Like Rails if you define a class method on a model, you can apply it to collection of those records, allowing you +Like Rails if you define a class method on a model, you can apply it to a collection of those records, allowing you to chain methods with scopes (and relationships) ```ruby @@ -264,6 +237,9 @@ class User < ActiveRecord::Base end ``` + + + Sometimes it is desirable to only run the method on the server. This can be done using the `server_method` macro: ```ruby @@ -284,7 +260,7 @@ To force the value to be recomputed at the server append a `!` to the end of the `columns_hash`: returns the details of the columns specification. Note that on the server `columns_hash` returns a hash of objects specifying column information. On the client the entire structure is just one big hash of hashes. -`abstract_class=`, `abstract_class?`, `primary_key`, `primary_key=`, `inheritance_column`, `inheritance_column=`, `model_name`, `serialize`, `alias_attribute`, `table_name`: All work as on the server. See ActiveRecord documentation for more info. +`abstract_class=`, `abstract_class?`, `primary_key`, `primary_key=`, `inheritance_column`, `inheritance_column=`, `model_name`: All work as on the server. See ActiveRecord documentation for more info. ### Instance Methods @@ -313,10 +289,6 @@ end After a save operation completes the models will have an `errors` hash \(just like on the server\) with any validation problems. -`save` does not fail, but rather returns `{success: false ...}`. If there was an -exception the `message` key will hold the error information, otherwise the errors will -be stored in the records error data (as on the server.) - During the save operation the method `saving?` will return `true`. This can be used to instead of \(or with\) the promise to update the screen: ```ruby @@ -337,9 +309,7 @@ end Like `save` destroy returns a promise that is resolved when the destroy completes. -After the destroy completes successfully the record's `destroyed?` method will return true. - -Like `save` destroy never fails, but rather returns `{success: false...}` +After the destroy completes the record's `destroyed?` method will return true. #### Other Instance Methods @@ -397,12 +367,12 @@ The `load` method takes a list of attributes \(symbols\) and will insure these a before_mount do Todo.find(1).load(:name).then do |name| @name = name; - mutate @loaded = true + state.loaded! true end end ``` -> Think hard about how you are using this, as Hyperstack already acts as flux store, and is managing state for you. It may be you are just creating a redundant store! +Think hard about how you are using this, as Hyperstack already acts as flux store, and is managing state for you. It may be you are just creating a redundant store! ## Client Side Scoping diff --git a/readme.md b/readme.md index 5a538c7c2..a255dbe7b 100644 --- a/readme.md +++ b/readme.md @@ -46,7 +46,7 @@ We now are issuing 1.0 release candidates weekly until all issues are either clo | Release
Date | Version | Open
Issues | Documentation
Sections
Draft Ready | Documentation
Sections
WIP | |--------------|---------|-------------|-------|------| -| April 5, 2021 | 1.0.alpha1.7 | 147 | 35 | 10 | +| April 12, 2021 | 1.0.alpha1.8 | 128 | 36 | 9 | > Open issues includes enhancements, documentation, and discussion issues as well as few bugs. > diff --git a/release-notes/1.0.alpha1.8.md b/release-notes/1.0.alpha1.8.md index 23ec55420..6df58b68e 100644 --- a/release-notes/1.0.alpha1.8.md +++ b/release-notes/1.0.alpha1.8.md @@ -2,7 +2,7 @@ | Release
Date | Version | Open
Issues | Documentation
Sections
Draft Ready | Documentation
Sections
WIP | |--------------|---------|-------------|-------|------| -| April 12, 2021 | 1.0.alpha1.8 | ?? | ?? | ?? | +| April 12, 2021 | 1.0.alpha1.8 | 127 | 36 | 9 | | April 5, 2021 | 1.0.alpha1.7 | 147 | 35 | 10 | | March 29, 2021 | 1.0.alpha1.6 | 167 | 35 | 10 | > Open issues includes enhancements, documentation, and discussion issues as well as few bugs. Additional issues @@ -23,11 +23,15 @@ None None ### Feature Added + ++ [#402](https://github.com/hyperstack-org/hyperstack/issues/402) Class level +`initialize` method will be called at boot for Observers + [#401](https://github.com/hyperstack-org/hyperstack/issues/401) Can call `receives` inside the singleton class. + ### Fixed -None ++ [#403](https://github.com/hyperstack-org/hyperstack/issues/403) Fixed: `isomorphic` method only worked before mounting ### Not Reproducible diff --git a/ruby/hyper-component/lib/hyperstack/component/version.rb b/ruby/hyper-component/lib/hyperstack/component/version.rb index 972624ade..de5a13179 100644 --- a/ruby/hyper-component/lib/hyperstack/component/version.rb +++ b/ruby/hyper-component/lib/hyperstack/component/version.rb @@ -1,5 +1,5 @@ module Hyperstack module Component - VERSION = '1.0.alpha1.7' # '1.0.alpha1.5' + VERSION = '1.0.alpha1.8' # '1.0.alpha1.5' end end diff --git a/ruby/hyper-console/lib/hyperloop/console/version.rb b/ruby/hyper-console/lib/hyperloop/console/version.rb index bb6cf77b4..7d7cbeb0f 100644 --- a/ruby/hyper-console/lib/hyperloop/console/version.rb +++ b/ruby/hyper-console/lib/hyperloop/console/version.rb @@ -1,5 +1,5 @@ module Hyperloop module Console - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end end diff --git a/ruby/hyper-i18n/lib/hyper-i18n/version.rb b/ruby/hyper-i18n/lib/hyper-i18n/version.rb index 32802d9f0..23b0d5f44 100644 --- a/ruby/hyper-i18n/lib/hyper-i18n/version.rb +++ b/ruby/hyper-i18n/lib/hyper-i18n/version.rb @@ -1,3 +1,3 @@ module HyperI18n - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end diff --git a/ruby/hyper-i18n/lib/hyperstack/i18n/version.rb b/ruby/hyper-i18n/lib/hyperstack/i18n/version.rb index 6fbb26b65..414e46f90 100644 --- a/ruby/hyper-i18n/lib/hyperstack/i18n/version.rb +++ b/ruby/hyper-i18n/lib/hyperstack/i18n/version.rb @@ -1,5 +1,5 @@ module Hyperstack module I18n - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end end diff --git a/ruby/hyper-model/lib/hyper_model/version.rb b/ruby/hyper-model/lib/hyper_model/version.rb index e990965a4..a5881f945 100644 --- a/ruby/hyper-model/lib/hyper_model/version.rb +++ b/ruby/hyper-model/lib/hyper_model/version.rb @@ -1,3 +1,3 @@ module HyperModel - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end diff --git a/ruby/hyper-operation/lib/hyper-operation/version.rb b/ruby/hyper-operation/lib/hyper-operation/version.rb index 503992a35..2a0e07d81 100644 --- a/ruby/hyper-operation/lib/hyper-operation/version.rb +++ b/ruby/hyper-operation/lib/hyper-operation/version.rb @@ -1,5 +1,5 @@ module Hyperstack class Operation - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end end diff --git a/ruby/hyper-router/lib/hyperstack/router/version.rb b/ruby/hyper-router/lib/hyperstack/router/version.rb index aa74b24fb..b386e5e32 100644 --- a/ruby/hyper-router/lib/hyperstack/router/version.rb +++ b/ruby/hyper-router/lib/hyperstack/router/version.rb @@ -1,3 +1,3 @@ module HyperRouter - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end diff --git a/ruby/hyper-spec/lib/hyper-spec/version.rb b/ruby/hyper-spec/lib/hyper-spec/version.rb index 60e2f4f6e..59df37dbd 100644 --- a/ruby/hyper-spec/lib/hyper-spec/version.rb +++ b/ruby/hyper-spec/lib/hyper-spec/version.rb @@ -1,3 +1,3 @@ module HyperSpec - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end diff --git a/ruby/hyper-state/lib/hyperstack/state/version.rb b/ruby/hyper-state/lib/hyperstack/state/version.rb index 014a96712..b16fd1ced 100644 --- a/ruby/hyper-state/lib/hyperstack/state/version.rb +++ b/ruby/hyper-state/lib/hyperstack/state/version.rb @@ -1,5 +1,5 @@ module Hyperstack module State - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end end diff --git a/ruby/hyper-store/lib/hyperstack/legacy/store/version.rb b/ruby/hyper-store/lib/hyperstack/legacy/store/version.rb index c5d9f089d..b6ba5bb77 100644 --- a/ruby/hyper-store/lib/hyperstack/legacy/store/version.rb +++ b/ruby/hyper-store/lib/hyperstack/legacy/store/version.rb @@ -1,7 +1,7 @@ module Hyperstack module Legacy module Store - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end end end diff --git a/ruby/hyper-trace/lib/hyper_trace/version.rb b/ruby/hyper-trace/lib/hyper_trace/version.rb index f56801774..dff9a4eee 100644 --- a/ruby/hyper-trace/lib/hyper_trace/version.rb +++ b/ruby/hyper-trace/lib/hyper_trace/version.rb @@ -1,3 +1,3 @@ module HyperTrace - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end diff --git a/ruby/hyperstack-config/lib/hyperstack/config/version.rb b/ruby/hyperstack-config/lib/hyperstack/config/version.rb index 09c21e7b8..923640f12 100644 --- a/ruby/hyperstack-config/lib/hyperstack/config/version.rb +++ b/ruby/hyperstack-config/lib/hyperstack/config/version.rb @@ -1,5 +1,5 @@ module Hyperstack module Config - VERSION = '1.0.alpha1.7' + VERSION = '1.0.alpha1.8' end end diff --git a/ruby/rails-hyperstack/lib/hyperstack/version.rb b/ruby/rails-hyperstack/lib/hyperstack/version.rb index 72cbb55eb..4c001ab78 100644 --- a/ruby/rails-hyperstack/lib/hyperstack/version.rb +++ b/ruby/rails-hyperstack/lib/hyperstack/version.rb @@ -1,3 +1,3 @@ module Hyperstack - ROUTERVERSION = VERSION = '1.0.alpha1.7' + ROUTERVERSION = VERSION = '1.0.alpha1.8' end From 2eab67d1d032b6d9282a8c0cd0e9e72ab6b3cc3a Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 13 Apr 2021 01:07:10 -0400 Subject: [PATCH 07/49] updated notes --- release-notes/1.0.alpha1.8.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release-notes/1.0.alpha1.8.md b/release-notes/1.0.alpha1.8.md index 6df58b68e..349055818 100644 --- a/release-notes/1.0.alpha1.8.md +++ b/release-notes/1.0.alpha1.8.md @@ -5,8 +5,7 @@ | April 12, 2021 | 1.0.alpha1.8 | 127 | 36 | 9 | | April 5, 2021 | 1.0.alpha1.7 | 147 | 35 | 10 | | March 29, 2021 | 1.0.alpha1.6 | 167 | 35 | 10 | -> Open issues includes enhancements, documentation, and discussion issues as well as few bugs. Additional issues -may be closed that are not documented below because of duplicates, documentation updates, and old issues previously closed. +> Open issues includes enhancements, documentation, and discussion issues as well as few bugs. Issues tagged for post launch are not included. Additional issues may be closed that are not documented below because of duplicates, documentation updates, and old issues previously closed. > > The documentation WIP (work in progress) numbers are approx, as more sections may be added. From c7b3d6ada22fc0e2ef0feb66eb9f7fd3dbbf713c Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 13 Apr 2021 01:24:04 -0400 Subject: [PATCH 08/49] updated gemspec links --- ruby/hyper-component/hyper-component.gemspec | 4 +++- ruby/hyper-i18n/hyper-i18n.gemspec | 4 +++- ruby/hyper-model/hyper-model.gemspec | 2 ++ ruby/hyper-operation/hyper-operation.gemspec | 2 ++ ruby/hyper-router/hyper-router.gemspec | 4 +++- ruby/hyper-spec/hyper-spec.gemspec | 4 +++- ruby/hyper-state/hyper-state.gemspec | 4 +++- ruby/hyper-store/hyper-store.gemspec | 4 +++- ruby/hyper-trace/hyper-trace.gemspec | 4 +++- ruby/hyperstack-config/hyperstack-config.gemspec | 2 ++ ruby/rails-hyperstack/rails-hyperstack.gemspec | 2 ++ 11 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index 8b2049eac..e3523426d 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -8,7 +8,9 @@ Gem::Specification.new do |spec| spec.authors = ['David Chang', 'Adam Jahn', 'Mitch VanDuyn', 'Jan Biedermann', 'Adam Creekroad'] spec.email = ['mitch@catprint.com'] - spec.homepage = 'http://hyperstack.org' + spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.summary = 'Opal Ruby wrapper of React.js library.' spec.license = 'MIT' spec.description = 'Write React UI components in pure Ruby.' diff --git a/ruby/hyper-i18n/hyper-i18n.gemspec b/ruby/hyper-i18n/hyper-i18n.gemspec index 568d1a7f9..5b0138efa 100644 --- a/ruby/hyper-i18n/hyper-i18n.gemspec +++ b/ruby/hyper-i18n/hyper-i18n.gemspec @@ -11,7 +11,9 @@ Gem::Specification.new do |spec| spec.email = ['adamgeorge.31@gmail.com'] spec.summary = 'HyperI18n seamlessly brings Rails I18n into your Hyperstack application.' - spec.homepage = 'https://www.github.com/ruby-hyperstack/hyper-i18n' + spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' spec.files = `git ls-files`.split("\n") diff --git a/ruby/hyper-model/hyper-model.gemspec b/ruby/hyper-model/hyper-model.gemspec index 61e8d1788..85bd85398 100644 --- a/ruby/hyper-model/hyper-model.gemspec +++ b/ruby/hyper-model/hyper-model.gemspec @@ -14,6 +14,8 @@ Gem::Specification.new do |spec| 'possible technologies) so changes to records on the server are '\ 'dynamically updated on all authorised clients.' spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://ruby-hyperstack.org', diff --git a/ruby/hyper-operation/hyper-operation.gemspec b/ruby/hyper-operation/hyper-operation.gemspec index d4bec9065..0c6e2a774 100644 --- a/ruby/hyper-operation/hyper-operation.gemspec +++ b/ruby/hyper-operation/hyper-operation.gemspec @@ -10,6 +10,8 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'HyperOperations are the swiss army knife of the Hyperstack' spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://ruby-hyperstack.org', diff --git a/ruby/hyper-router/hyper-router.gemspec b/ruby/hyper-router/hyper-router.gemspec index 2418fc684..d189fa6c8 100644 --- a/ruby/hyper-router/hyper-router.gemspec +++ b/ruby/hyper-router/hyper-router.gemspec @@ -7,7 +7,9 @@ Gem::Specification.new do |spec| spec.version = HyperRouter::VERSION spec.authors = ['Adam George', 'Jan Biedermann'] spec.email = ['adamgeorge.31@gmail.com', 'jan@kursator.com'] - spec.homepage = 'http://hyperstack.org' + spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' spec.summary = 'hyper-router for Opal, part of the hyperstack framework' diff --git a/ruby/hyper-spec/hyper-spec.gemspec b/ruby/hyper-spec/hyper-spec.gemspec index 0b1d645f5..65fad62b7 100644 --- a/ruby/hyper-spec/hyper-spec.gemspec +++ b/ruby/hyper-spec/hyper-spec.gemspec @@ -12,7 +12,9 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.description = 'A Hyperstack application consists of isomorphic React Components, '\ 'Active Record Models, Stores, Operations and Policiespec. '\ 'Test them all from Rspec, regardless if the code runs on the client or server.' - spec.homepage = 'http://hyperstack.org' + spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-state/hyper-state.gemspec b/ruby/hyper-state/hyper-state.gemspec index 9b1f0b8d1..5ae8c7994 100644 --- a/ruby/hyper-state/hyper-state.gemspec +++ b/ruby/hyper-state/hyper-state.gemspec @@ -9,7 +9,9 @@ Gem::Specification.new do |spec| spec.authors = ['Mitch VanDuyn', 'Adam Creekroad', 'Jan Biedermann'] spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Flux Stores and more for Hyperloop' - spec.homepage = 'https://hyperstack.org' + spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-store/hyper-store.gemspec b/ruby/hyper-store/hyper-store.gemspec index a0b621cef..638cef72f 100644 --- a/ruby/hyper-store/hyper-store.gemspec +++ b/ruby/hyper-store/hyper-store.gemspec @@ -9,7 +9,9 @@ Gem::Specification.new do |spec| spec.authors = ['Mitch VanDuyn', 'Adam Creekroad', 'Jan Biedermann'] spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Flux Stores and more for Hyperloop' - spec.homepage = 'https://hyperstack.org' + spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-trace/hyper-trace.gemspec b/ruby/hyper-trace/hyper-trace.gemspec index 34ecd3095..ba2dfca80 100644 --- a/ruby/hyper-trace/hyper-trace.gemspec +++ b/ruby/hyper-trace/hyper-trace.gemspec @@ -10,7 +10,9 @@ Gem::Specification.new do |spec| spec.email = ["mitch@catprint.com"] spec.summary = %q{Method tracing and conditional breakpoints for Opal Ruby} - spec.homepage = "https://github.com/reactrb/hyper-trace" + spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index 3db9ce49c..fc4076990 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -10,6 +10,8 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Provides a single point configuration module for hyperstack gems' spec.homepage = 'http://ruby-hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://ruby-hyperstack.org', diff --git a/ruby/rails-hyperstack/rails-hyperstack.gemspec b/ruby/rails-hyperstack/rails-hyperstack.gemspec index 123f59b83..597932113 100644 --- a/ruby/rails-hyperstack/rails-hyperstack.gemspec +++ b/ruby/rails-hyperstack/rails-hyperstack.gemspec @@ -11,6 +11,8 @@ Gem::Specification.new do |spec| spec.authors = ['Loic Boutet', 'Adam George', 'Mitch VanDuyn', 'Jan Biedermann'] spec.email = ['loic@boutet.com', 'jan@kursator.com'] spec.homepage = 'http://hyperstack.org' + spec.documentation = 'https://docs.hyperstack.org/' + spec.download = 'https://github.com/hyperstack-org/hyperstack' spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://hyperstack.org', From 438554f5fcf508462eba6d46b107842d3282e207 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 13 Apr 2021 01:49:42 -0400 Subject: [PATCH 09/49] updated gemspec links again --- ruby/hyper-component/hyper-component.gemspec | 3 +-- ruby/hyper-i18n/hyper-i18n.gemspec | 3 +-- ruby/hyper-model/hyper-model.gemspec | 8 +------- ruby/hyper-operation/hyper-operation.gemspec | 8 +------- ruby/hyper-router/hyper-router.gemspec | 3 +-- ruby/hyper-spec/hyper-spec.gemspec | 3 +-- ruby/hyper-state/hyper-state.gemspec | 3 +-- ruby/hyper-store/hyper-store.gemspec | 3 +-- ruby/hyper-trace/hyper-trace.gemspec | 3 +-- ruby/hyperstack-config/hyperstack-config.gemspec | 3 +-- ruby/rails-hyperstack/rails-hyperstack.gemspec | 3 +-- 11 files changed, 11 insertions(+), 32 deletions(-) diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index e3523426d..61faceefb 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -9,8 +9,7 @@ Gem::Specification.new do |spec| spec.authors = ['David Chang', 'Adam Jahn', 'Mitch VanDuyn', 'Jan Biedermann', 'Adam Creekroad'] spec.email = ['mitch@catprint.com'] spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.summary = 'Opal Ruby wrapper of React.js library.' spec.license = 'MIT' spec.description = 'Write React UI components in pure Ruby.' diff --git a/ruby/hyper-i18n/hyper-i18n.gemspec b/ruby/hyper-i18n/hyper-i18n.gemspec index 5b0138efa..a1be22779 100644 --- a/ruby/hyper-i18n/hyper-i18n.gemspec +++ b/ruby/hyper-i18n/hyper-i18n.gemspec @@ -12,8 +12,7 @@ Gem::Specification.new do |spec| spec.summary = 'HyperI18n seamlessly brings Rails I18n into your Hyperstack application.' spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files`.split("\n") diff --git a/ruby/hyper-model/hyper-model.gemspec b/ruby/hyper-model/hyper-model.gemspec index 85bd85398..d19f28ce4 100644 --- a/ruby/hyper-model/hyper-model.gemspec +++ b/ruby/hyper-model/hyper-model.gemspec @@ -14,14 +14,8 @@ Gem::Specification.new do |spec| 'possible technologies) so changes to records on the server are '\ 'dynamically updated on all authorised clients.' spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' - # spec.metadata = { - # "homepage_uri" => 'http://ruby-hyperstack.org', - # "source_code_uri" => 'https://github.com/ruby-hyperstack/hyper-component' - # } - spec.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(examples|gemfiles|pkg|reactive_record_test_app|spec)/}) } # spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } spec.test_files = `git ls-files -- {spec}/*`.split("\n") diff --git a/ruby/hyper-operation/hyper-operation.gemspec b/ruby/hyper-operation/hyper-operation.gemspec index 0c6e2a774..0c213c644 100644 --- a/ruby/hyper-operation/hyper-operation.gemspec +++ b/ruby/hyper-operation/hyper-operation.gemspec @@ -10,14 +10,8 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'HyperOperations are the swiss army knife of the Hyperstack' spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' - # spec.metadata = { - # "homepage_uri" => 'http://ruby-hyperstack.org', - # "source_code_uri" => 'https://github.com/ruby-hyperstack/hyper-component' - # } - spec.files = `git ls-files -z` .split("\x0") .reject { |f| f.match(%r{^(gemfiles|examples|spec)/}) } diff --git a/ruby/hyper-router/hyper-router.gemspec b/ruby/hyper-router/hyper-router.gemspec index d189fa6c8..711b46d9f 100644 --- a/ruby/hyper-router/hyper-router.gemspec +++ b/ruby/hyper-router/hyper-router.gemspec @@ -8,8 +8,7 @@ Gem::Specification.new do |spec| spec.authors = ['Adam George', 'Jan Biedermann'] spec.email = ['adamgeorge.31@gmail.com', 'jan@kursator.com'] spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.summary = 'hyper-router for Opal, part of the hyperstack framework' diff --git a/ruby/hyper-spec/hyper-spec.gemspec b/ruby/hyper-spec/hyper-spec.gemspec index 65fad62b7..265a7f47a 100644 --- a/ruby/hyper-spec/hyper-spec.gemspec +++ b/ruby/hyper-spec/hyper-spec.gemspec @@ -13,8 +13,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength 'Active Record Models, Stores, Operations and Policiespec. '\ 'Test them all from Rspec, regardless if the code runs on the client or server.' spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-state/hyper-state.gemspec b/ruby/hyper-state/hyper-state.gemspec index 5ae8c7994..53de3a72b 100644 --- a/ruby/hyper-state/hyper-state.gemspec +++ b/ruby/hyper-state/hyper-state.gemspec @@ -10,8 +10,7 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Flux Stores and more for Hyperloop' spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-store/hyper-store.gemspec b/ruby/hyper-store/hyper-store.gemspec index 638cef72f..ad994a2e6 100644 --- a/ruby/hyper-store/hyper-store.gemspec +++ b/ruby/hyper-store/hyper-store.gemspec @@ -10,8 +10,7 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Flux Stores and more for Hyperloop' spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-trace/hyper-trace.gemspec b/ruby/hyper-trace/hyper-trace.gemspec index ba2dfca80..68099681e 100644 --- a/ruby/hyper-trace/hyper-trace.gemspec +++ b/ruby/hyper-trace/hyper-trace.gemspec @@ -11,8 +11,7 @@ Gem::Specification.new do |spec| spec.summary = %q{Method tracing and conditional breakpoints for Opal Ruby} spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index fc4076990..264855ce1 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -10,8 +10,7 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Provides a single point configuration module for hyperstack gems' spec.homepage = 'http://ruby-hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://ruby-hyperstack.org', diff --git a/ruby/rails-hyperstack/rails-hyperstack.gemspec b/ruby/rails-hyperstack/rails-hyperstack.gemspec index 597932113..cb0ec8a81 100644 --- a/ruby/rails-hyperstack/rails-hyperstack.gemspec +++ b/ruby/rails-hyperstack/rails-hyperstack.gemspec @@ -11,8 +11,7 @@ Gem::Specification.new do |spec| spec.authors = ['Loic Boutet', 'Adam George', 'Mitch VanDuyn', 'Jan Biedermann'] spec.email = ['loic@boutet.com', 'jan@kursator.com'] spec.homepage = 'http://hyperstack.org' - spec.documentation = 'https://docs.hyperstack.org/' - spec.download = 'https://github.com/hyperstack-org/hyperstack' + spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://hyperstack.org', From e5d0300c6da9cc95f1aa955c69a70ce55bfebcf1 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 13 Apr 2021 01:54:48 -0400 Subject: [PATCH 10/49] gemspec meta data has to be strings not symbols --- ruby/hyper-component/hyper-component.gemspec | 2 +- ruby/hyper-i18n/hyper-i18n.gemspec | 2 +- ruby/hyper-model/hyper-model.gemspec | 2 +- ruby/hyper-operation/hyper-operation.gemspec | 2 +- ruby/hyper-router/hyper-router.gemspec | 2 +- ruby/hyper-spec/hyper-spec.gemspec | 2 +- ruby/hyper-state/hyper-state.gemspec | 2 +- ruby/hyper-store/hyper-store.gemspec | 2 +- ruby/hyper-trace/hyper-trace.gemspec | 2 +- ruby/hyperstack-config/hyperstack-config.gemspec | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index 61faceefb..098621d3d 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |spec| spec.authors = ['David Chang', 'Adam Jahn', 'Mitch VanDuyn', 'Jan Biedermann', 'Adam Creekroad'] spec.email = ['mitch@catprint.com'] spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.summary = 'Opal Ruby wrapper of React.js library.' spec.license = 'MIT' spec.description = 'Write React UI components in pure Ruby.' diff --git a/ruby/hyper-i18n/hyper-i18n.gemspec b/ruby/hyper-i18n/hyper-i18n.gemspec index a1be22779..a2d66610a 100644 --- a/ruby/hyper-i18n/hyper-i18n.gemspec +++ b/ruby/hyper-i18n/hyper-i18n.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.summary = 'HyperI18n seamlessly brings Rails I18n into your Hyperstack application.' spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files`.split("\n") diff --git a/ruby/hyper-model/hyper-model.gemspec b/ruby/hyper-model/hyper-model.gemspec index d19f28ce4..11dca81b8 100644 --- a/ruby/hyper-model/hyper-model.gemspec +++ b/ruby/hyper-model/hyper-model.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |spec| 'possible technologies) so changes to records on the server are '\ 'dynamically updated on all authorised clients.' spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(examples|gemfiles|pkg|reactive_record_test_app|spec)/}) } # spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) } diff --git a/ruby/hyper-operation/hyper-operation.gemspec b/ruby/hyper-operation/hyper-operation.gemspec index 0c213c644..1f8b4bdab 100644 --- a/ruby/hyper-operation/hyper-operation.gemspec +++ b/ruby/hyper-operation/hyper-operation.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'HyperOperations are the swiss army knife of the Hyperstack' spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files -z` .split("\x0") diff --git a/ruby/hyper-router/hyper-router.gemspec b/ruby/hyper-router/hyper-router.gemspec index 711b46d9f..7d401e191 100644 --- a/ruby/hyper-router/hyper-router.gemspec +++ b/ruby/hyper-router/hyper-router.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |spec| spec.authors = ['Adam George', 'Jan Biedermann'] spec.email = ['adamgeorge.31@gmail.com', 'jan@kursator.com'] spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.summary = 'hyper-router for Opal, part of the hyperstack framework' diff --git a/ruby/hyper-spec/hyper-spec.gemspec b/ruby/hyper-spec/hyper-spec.gemspec index 265a7f47a..02261b929 100644 --- a/ruby/hyper-spec/hyper-spec.gemspec +++ b/ruby/hyper-spec/hyper-spec.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength 'Active Record Models, Stores, Operations and Policiespec. '\ 'Test them all from Rspec, regardless if the code runs on the client or server.' spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-state/hyper-state.gemspec b/ruby/hyper-state/hyper-state.gemspec index 53de3a72b..e6121cc27 100644 --- a/ruby/hyper-state/hyper-state.gemspec +++ b/ruby/hyper-state/hyper-state.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Flux Stores and more for Hyperloop' spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-store/hyper-store.gemspec b/ruby/hyper-store/hyper-store.gemspec index ad994a2e6..f5efb902e 100644 --- a/ruby/hyper-store/hyper-store.gemspec +++ b/ruby/hyper-store/hyper-store.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Flux Stores and more for Hyperloop' spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(gemfiles|spec)/}) } spec.bindir = 'exe' diff --git a/ruby/hyper-trace/hyper-trace.gemspec b/ruby/hyper-trace/hyper-trace.gemspec index 68099681e..0be02035e 100644 --- a/ruby/hyper-trace/hyper-trace.gemspec +++ b/ruby/hyper-trace/hyper-trace.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.summary = %q{Method tracing and conditional breakpoints for Opal Ruby} spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index 264855ce1..c6955534b 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.email = ['mitch@catprint.com', 'jan@kursator.com'] spec.summary = 'Provides a single point configuration module for hyperstack gems' spec.homepage = 'http://ruby-hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://ruby-hyperstack.org', From e2106545249b4cbd2f323dc456a4fb0e1f7edd93 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 13 Apr 2021 02:00:41 -0400 Subject: [PATCH 11/49] missed updating rails-hyperspec gemspec --- ruby/rails-hyperstack/rails-hyperstack.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/rails-hyperstack/rails-hyperstack.gemspec b/ruby/rails-hyperstack/rails-hyperstack.gemspec index cb0ec8a81..f42541c2d 100644 --- a/ruby/rails-hyperstack/rails-hyperstack.gemspec +++ b/ruby/rails-hyperstack/rails-hyperstack.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.authors = ['Loic Boutet', 'Adam George', 'Mitch VanDuyn', 'Jan Biedermann'] spec.email = ['loic@boutet.com', 'jan@kursator.com'] spec.homepage = 'http://hyperstack.org' - spec.metadata = { documentation_uri: 'https://docs.hyperstack.org/' } + spec.metadata = { 'documentation_uri' => 'https://docs.hyperstack.org/' } spec.license = 'MIT' # spec.metadata = { # "homepage_uri" => 'http://hyperstack.org', From 179353ce7a0ff0b73b0b74dd251839c48ae53b2f Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 13 Apr 2021 02:29:00 -0400 Subject: [PATCH 12/49] using mini_racer < 0.4.0 in test because of weird libv8-node checksum problem --- ruby/hyper-component/hyper-component.gemspec | 2 +- ruby/hyper-i18n/hyper-i18n.gemspec | 2 +- ruby/hyper-model/hyper-model.gemspec | 2 +- ruby/hyper-router/hyper-router.gemspec | 2 +- ruby/hyper-spec/hyper-spec.gemspec | 2 +- ruby/hyper-state/hyper-state.gemspec | 2 +- ruby/hyper-store/hyper-store.gemspec | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index 098621d3d..8239235dc 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'jquery-rails' spec.add_development_dependency 'listen' spec.add_development_dependency 'mime-types' - spec.add_development_dependency 'mini_racer' + spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'nokogiri' spec.add_development_dependency 'opal-jquery' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' diff --git a/ruby/hyper-i18n/hyper-i18n.gemspec b/ruby/hyper-i18n/hyper-i18n.gemspec index a2d66610a..492638eed 100644 --- a/ruby/hyper-i18n/hyper-i18n.gemspec +++ b/ruby/hyper-i18n/hyper-i18n.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'chromedriver-helper' spec.add_development_dependency 'hyper-model', Hyperstack::I18n::VERSION spec.add_development_dependency 'hyper-spec', Hyperstack::I18n::VERSION - spec.add_development_dependency 'mini_racer' + spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0.0' spec.add_development_dependency 'pry' spec.add_development_dependency 'puma' diff --git a/ruby/hyper-model/hyper-model.gemspec b/ruby/hyper-model/hyper-model.gemspec index 11dca81b8..1cb213c15 100644 --- a/ruby/hyper-model/hyper-model.gemspec +++ b/ruby/hyper-model/hyper-model.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'factory_bot_rails' spec.add_development_dependency 'hyper-spec', HyperModel::VERSION spec.add_development_dependency 'hyper-trace', HyperModel::VERSION - spec.add_development_dependency 'mini_racer' + spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'pg' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' diff --git a/ruby/hyper-router/hyper-router.gemspec b/ruby/hyper-router/hyper-router.gemspec index 7d401e191..6332a7485 100644 --- a/ruby/hyper-router/hyper-router.gemspec +++ b/ruby/hyper-router/hyper-router.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-spec', HyperRouter::VERSION spec.add_development_dependency 'hyper-store', HyperRouter::VERSION spec.add_development_dependency 'listen' - spec.add_development_dependency 'mini_racer' + spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' diff --git a/ruby/hyper-spec/hyper-spec.gemspec b/ruby/hyper-spec/hyper-spec.gemspec index 02261b929..f2f82ea2a 100644 --- a/ruby/hyper-spec/hyper-spec.gemspec +++ b/ruby/hyper-spec/hyper-spec.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.add_development_dependency 'bundler' spec.add_development_dependency 'hyper-component', HyperSpec::VERSION - spec.add_development_dependency 'mini_racer' + spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'opal-browser', '~> 0.2.0' spec.add_development_dependency 'opal-rails', '>= 0.9.4' spec.add_development_dependency 'pry-rescue' diff --git a/ruby/hyper-state/hyper-state.gemspec b/ruby/hyper-state/hyper-state.gemspec index e6121cc27..000d0046e 100644 --- a/ruby/hyper-state/hyper-state.gemspec +++ b/ruby/hyper-state/hyper-state.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-component', Hyperstack::State::VERSION spec.add_development_dependency 'hyper-spec', Hyperstack::State::VERSION spec.add_development_dependency 'listen' - # spec.add_development_dependency 'mini_racer', '~> 0.2.4' + # spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency, '~> 0.2.4' spec.add_development_dependency 'opal-browser', '~> 0.2.0' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' diff --git a/ruby/hyper-store/hyper-store.gemspec b/ruby/hyper-store/hyper-store.gemspec index f5efb902e..922292445 100644 --- a/ruby/hyper-store/hyper-store.gemspec +++ b/ruby/hyper-store/hyper-store.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-component', Hyperstack::Legacy::Store::VERSION spec.add_development_dependency 'hyper-spec', Hyperstack::Legacy::Store::VERSION spec.add_development_dependency 'listen' - # spec.add_development_dependency 'mini_racer', '~> 0.2.6' + # spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency, '~> 0.2.6' spec.add_development_dependency 'opal-browser', '~> 0.2.0' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' From 9a6e46682720cd7359feb3e6bed1c9953a5ba945 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 13 Apr 2021 04:01:10 -0400 Subject: [PATCH 13/49] updated readme investigate intermittent spec failure --- docs/hyper-state/README.md | 2 +- ruby/hyper-model/spec/batch3/has_and_belongs_to_many_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/hyper-state/README.md b/docs/hyper-state/README.md index 0f3131d14..863afa1eb 100644 --- a/docs/hyper-state/README.md +++ b/docs/hyper-state/README.md @@ -2,7 +2,7 @@ ### Revisiting the Tic Tac Toe Game -The easiest way to understand HyperState is by example. If you you did not see the Tic-Tac-Toe example, then **[please review it now](client-dsl/interlude-tic-tac-toe.md)**, as we are going to use this to demonstrate how to use the `Hyperstack::State::Observable` module. +The easiest way to understand HyperState is by example. If you you did not see the Tic-Tac-Toe example, then **[please review it now](/client-dsl/interlude-tic-tac-toe.md)**, as we are going to use this to demonstrate how to use the `Hyperstack::State::Observable` module. In our original Tic-Tac-Toe implementation the state of the game was stored in the `DisplayGame` component. State was updated by "bubbling up" events from lower level components up to `DisplayGame` where the event handler updated the state. diff --git a/ruby/hyper-model/spec/batch3/has_and_belongs_to_many_spec.rb b/ruby/hyper-model/spec/batch3/has_and_belongs_to_many_spec.rb index 6b2e2d073..be2fc20e7 100644 --- a/ruby/hyper-model/spec/batch3/has_and_belongs_to_many_spec.rb +++ b/ruby/hyper-model/spec/batch3/has_and_belongs_to_many_spec.rb @@ -88,6 +88,7 @@ class Patient < ActiveRecord::Base expect { Physician.first.patients.count }.on_client_to eq(1) Patient.create(name: 'Spock').physicians << mccoy + sleep 0.2 expect { Hyperstack::Model.load { Physician.first.patients.count } }.on_client_to eq(2) on_client { Patient.create(name: 'Uhuru') } From 4334ccf422f88789668cb26848d6cd3653bec42b Mon Sep 17 00:00:00 2001 From: adamcreekroad Date: Tue, 13 Apr 2021 16:16:21 -0400 Subject: [PATCH 14/49] Mimic ruby handling of send(nil), includes spec --- .../active_record/class_methods.rb | 10 ++++++--- .../active_record/class_methods_spec.rb | 21 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 ruby/hyper-model/spec/batch1/active_record/class_methods_spec.rb diff --git a/ruby/hyper-model/lib/reactive_record/active_record/class_methods.rb b/ruby/hyper-model/lib/reactive_record/active_record/class_methods.rb index 4e7a75b79..e4977b83e 100644 --- a/ruby/hyper-model/lib/reactive_record/active_record/class_methods.rb +++ b/ruby/hyper-model/lib/reactive_record/active_record/class_methods.rb @@ -197,14 +197,18 @@ def alias_attribute(new_name, old_name) ] def method_missing(name, *args, &block) - if name == 'human_attribute_name' + # In MRI Ruby we would never get to this point with a nil name argument, + # but currently in Opal we do, so we will mimic MRI Ruby and throw a TypeError. + raise TypeError, "nil is not a symbol nor a string" if name.nil? + + if name == "human_attribute_name" opts = args[1] || {} opts[:default] || args[0] elsif args.count == 1 && name.start_with?("find_by_") && !block - find_by(name.sub(/^find_by_/, '') => args[0]) + find_by(name.sub(/^find_by_/, "") => args[0]) elsif [].respond_to?(name) all.send(name, *args, &block) - elsif name.end_with?('!') + elsif name.end_with?("!") send(name.chop, *args, &block).send(:reload_from_db) rescue nil elsif !SERVER_METHODS.include?(name) raise "#{self.name}.#{name}(#{args}) (called class method missing)" diff --git a/ruby/hyper-model/spec/batch1/active_record/class_methods_spec.rb b/ruby/hyper-model/spec/batch1/active_record/class_methods_spec.rb new file mode 100644 index 000000000..a33a52b85 --- /dev/null +++ b/ruby/hyper-model/spec/batch1/active_record/class_methods_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require "spec_helper" + +describe "ActiveRecord::ClassMethods", js: true do + context "method_missing" do + it "should return a TypeError if name is nil" do + expect_evaluate_ruby do + error = nil + + begin + User.send(nil) + rescue StandardError => e + error = e + end + + error + end.to eq("nil is not a symbol nor a string") + end + end +end From c130b09577951501b1390ac14bba4c80ce59996f Mon Sep 17 00:00:00 2001 From: catmando Date: Mon, 1 May 2023 14:49:58 -0400 Subject: [PATCH 15/49] testing jammy CI environment --- .travis.yml | 2 +- ruby/hyper-spec/Gemfile | 1 + ruby/hyper-spec/hyper-spec.gemspec | 2 +- ruby/hyper-spec/lib/hyper-spec.rb | 8 +++++--- ruby/hyper-spec/spec/spec_helper.rb | 1 + ruby/rails-hyperstack/.ruby-version | 1 - ruby/rails-hyperstack/Gemfile | 1 + .../lib/hyperstack/server_side_auto_require.rb | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 ruby/rails-hyperstack/.ruby-version diff --git a/.travis.yml b/.travis.yml index 3da3e22aa..268ae1288 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: jammy addons: apt: diff --git a/ruby/hyper-spec/Gemfile b/ruby/hyper-spec/Gemfile index c0e97c691..12fbd76fc 100644 --- a/ruby/hyper-spec/Gemfile +++ b/ruby/hyper-spec/Gemfile @@ -4,4 +4,5 @@ gem 'hyper-store', path: '../hyper-store' gem 'hyper-state', path: '../hyper-state' gem 'hyperstack-config', path: '../hyperstack-config' #gem 'unparser', path: '../../../unparser' +gem 'opal', '1.0.5' gemspec diff --git a/ruby/hyper-spec/hyper-spec.gemspec b/ruby/hyper-spec/hyper-spec.gemspec index 0b1d645f5..a635ddb88 100644 --- a/ruby/hyper-spec/hyper-spec.gemspec +++ b/ruby/hyper-spec/hyper-spec.gemspec @@ -40,7 +40,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.add_development_dependency 'opal-rails', '>= 0.9.4' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' spec.add_development_dependency 'rake' spec.add_development_dependency 'react-rails', '>= 2.3.0', '< 2.5.0' diff --git a/ruby/hyper-spec/lib/hyper-spec.rb b/ruby/hyper-spec/lib/hyper-spec.rb index ba89a70e5..fdb14556d 100644 --- a/ruby/hyper-spec/lib/hyper-spec.rb +++ b/ruby/hyper-spec/lib/hyper-spec.rb @@ -84,9 +84,11 @@ module Selenium module WebDriver module Chrome module Bridge - COMMANDS = remove_const(:COMMANDS).dup - COMMANDS[:get_log] = [:post, 'session/:session_id/log'] - COMMANDS.freeze + if const_defined?(:COMMANDS) + COMMANDS = remove_const(:COMMANDS).dup + COMMANDS[:get_log] = [:post, 'session/:session_id/log'] + COMMANDS.freeze + end def log(type) data = execute :get_log, {}, type: type.to_s diff --git a/ruby/hyper-spec/spec/spec_helper.rb b/ruby/hyper-spec/spec/spec_helper.rb index 2ed740a54..f6d1f3ebf 100644 --- a/ruby/hyper-spec/spec/spec_helper.rb +++ b/ruby/hyper-spec/spec/spec_helper.rb @@ -1,4 +1,5 @@ require 'hyper-spec' +require 'webdrivers' require 'pry' require 'opal-browser' diff --git a/ruby/rails-hyperstack/.ruby-version b/ruby/rails-hyperstack/.ruby-version deleted file mode 100644 index 37c2961c2..000000000 --- a/ruby/rails-hyperstack/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.2 diff --git a/ruby/rails-hyperstack/Gemfile b/ruby/rails-hyperstack/Gemfile index cbc05abe0..bb2b68734 100644 --- a/ruby/rails-hyperstack/Gemfile +++ b/ruby/rails-hyperstack/Gemfile @@ -8,4 +8,5 @@ gem 'hyper-router', path: '../hyper-router' gem 'hyper-spec', path: '../hyper-spec' gem 'webpacker' # TODO: figure out why these two are necessary! gem 'turbolinks' +gem "selenium-webdriver", '3.142.7' gemspec diff --git a/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb b/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb index a3388d127..3d382eeaa 100644 --- a/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb +++ b/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb @@ -1,4 +1,4 @@ -Rails.configuration.autoloader = :classic +Rails.configuration.autoloader = :classic #:zeitwerk module ActiveSupport module Dependencies From 80531d8530d2275f5552c74cce1845ecc1e4ff45 Mon Sep 17 00:00:00 2001 From: catmando Date: Mon, 1 May 2023 15:17:18 -0400 Subject: [PATCH 16/49] trying focal for CI build environment --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 268ae1288..60b688678 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: jammy +dist: focal addons: apt: From f69765a065c216279282902f0b5c713c43a53432 Mon Sep 17 00:00:00 2001 From: catmando Date: Mon, 1 May 2023 15:46:11 -0400 Subject: [PATCH 17/49] keep puma at <= 5.4.0 during test --- ruby/hyper-component/hyper-component.gemspec | 2 +- ruby/hyper-i18n/hyper-i18n.gemspec | 2 +- ruby/hyper-model/hyper-model.gemspec | 2 +- ruby/hyper-operation/hyper-operation.gemspec | 2 +- ruby/hyper-router/hyper-router.gemspec | 2 +- ruby/hyper-state/hyper-state.gemspec | 2 +- ruby/hyper-store/hyper-store.gemspec | 2 +- ruby/hyperstack-config/hyperstack-config.gemspec | 2 +- ruby/rails-hyperstack/rails-hyperstack.gemspec | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index 8239235dc..ea1c05d3c 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' spec.add_development_dependency 'rails-controller-testing' spec.add_development_dependency 'rake' diff --git a/ruby/hyper-i18n/hyper-i18n.gemspec b/ruby/hyper-i18n/hyper-i18n.gemspec index 492638eed..19cf6e290 100644 --- a/ruby/hyper-i18n/hyper-i18n.gemspec +++ b/ruby/hyper-i18n/hyper-i18n.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0.0' spec.add_development_dependency 'pry' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec' spec.add_development_dependency 'rspec-rails' diff --git a/ruby/hyper-model/hyper-model.gemspec b/ruby/hyper-model/hyper-model.gemspec index 1cb213c15..0fb086592 100644 --- a/ruby/hyper-model/hyper-model.gemspec +++ b/ruby/hyper-model/hyper-model.gemspec @@ -35,7 +35,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'pusher' spec.add_development_dependency 'pusher-fake' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' diff --git a/ruby/hyper-operation/hyper-operation.gemspec b/ruby/hyper-operation/hyper-operation.gemspec index 1f8b4bdab..7b138a51d 100644 --- a/ruby/hyper-operation/hyper-operation.gemspec +++ b/ruby/hyper-operation/hyper-operation.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'pusher' spec.add_development_dependency 'pusher-fake' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' diff --git a/ruby/hyper-router/hyper-router.gemspec b/ruby/hyper-router/hyper-router.gemspec index 6332a7485..941377c60 100644 --- a/ruby/hyper-router/hyper-router.gemspec +++ b/ruby/hyper-router/hyper-router.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec-collection_matchers' diff --git a/ruby/hyper-state/hyper-state.gemspec b/ruby/hyper-state/hyper-state.gemspec index 000d0046e..9f0650513 100644 --- a/ruby/hyper-state/hyper-state.gemspec +++ b/ruby/hyper-state/hyper-state.gemspec @@ -29,7 +29,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' spec.add_development_dependency 'rake' spec.add_development_dependency 'react-rails', '>= 2.4.0', '< 2.5.0' diff --git a/ruby/hyper-store/hyper-store.gemspec b/ruby/hyper-store/hyper-store.gemspec index 922292445..fbdfa72e3 100644 --- a/ruby/hyper-store/hyper-store.gemspec +++ b/ruby/hyper-store/hyper-store.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' spec.add_development_dependency 'rake' spec.add_development_dependency 'react-rails', '>= 2.4.0', '< 2.5.0' diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index c6955534b..d938c8e34 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -33,7 +33,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rails', ENV['RAILS_VERSION'] || '>= 5.0.0', '< 7.0' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec', '~> 3.7.0' diff --git a/ruby/rails-hyperstack/rails-hyperstack.gemspec b/ruby/rails-hyperstack/rails-hyperstack.gemspec index f42541c2d..ebcc5176c 100644 --- a/ruby/rails-hyperstack/rails-hyperstack.gemspec +++ b/ruby/rails-hyperstack/rails-hyperstack.gemspec @@ -70,7 +70,7 @@ You can control how much of the stack gets installed as well: spec.add_development_dependency 'chromedriver-helper' spec.add_development_dependency 'hyper-spec', Hyperstack::VERSION spec.add_development_dependency 'pry' - spec.add_development_dependency 'puma' + spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'bootsnap' spec.add_development_dependency 'rspec-rails' spec.add_development_dependency 'rubocop' #, '~> 0.51.0' From 09cbae68744ba5d5bea8a9dac25a57b31bf49967 Mon Sep 17 00:00:00 2001 From: catmando Date: Mon, 1 May 2023 17:31:17 -0400 Subject: [PATCH 18/49] more fixes to get things working again --- .travis.yml | 4 ++-- ruby/hyper-component/Gemfile | 6 +++--- ruby/hyper-spec/lib/hyper-spec.rb | 2 ++ ruby/hyper-spec/spec/spec_helper.rb | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60b688678..60988ffa1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,12 @@ addons: - sourceline: 'deb http://dl.google.com/linux/chrome/deb/ stable main' key_url: 'https://dl-ssl.google.com/linux/linux_signing_key.pub' packages: - - postgresql-11 + - postgresql-12 - chromium-chromedriver - google-chrome-stable - yarn - redis-server - postgresql: '11' + postgresql: '12' _test_gem_pg: &_test_gem_pg stage: test diff --git a/ruby/hyper-component/Gemfile b/ruby/hyper-component/Gemfile index 7bb59f443..052aad50c 100644 --- a/ruby/hyper-component/Gemfile +++ b/ruby/hyper-component/Gemfile @@ -4,9 +4,9 @@ gem 'hyper-spec', path: '../hyper-spec' gem 'hyperstack-config', path: '../hyperstack-config' gem 'hyper-store', path: '../hyper-store' gem 'hyper-state', path: '../hyper-state' -unless ENV['OPAL_VERSION']&.match("0.11") - gem 'opal-browser', git: 'https://github.com/opal/opal-browser' -end +# unless ENV['OPAL_VERSION']&.match("0.11") +# gem 'opal-browser', git: 'https://github.com/opal/opal-browser' +# end gem 'hyper-trace', path: '../hyper-trace' #gem 'puma', '~> 3.11.0' # As of adding, version 3.12.0 isn't working so we are locking diff --git a/ruby/hyper-spec/lib/hyper-spec.rb b/ruby/hyper-spec/lib/hyper-spec.rb index fdb14556d..d566bb878 100644 --- a/ruby/hyper-spec/lib/hyper-spec.rb +++ b/ruby/hyper-spec/lib/hyper-spec.rb @@ -4,6 +4,8 @@ require 'unparser' require 'method_source' require 'filecache' +require 'webdrivers' + require 'capybara/rspec' require 'hyper-spec/internal/client_execution' diff --git a/ruby/hyper-spec/spec/spec_helper.rb b/ruby/hyper-spec/spec/spec_helper.rb index f6d1f3ebf..2ed740a54 100644 --- a/ruby/hyper-spec/spec/spec_helper.rb +++ b/ruby/hyper-spec/spec/spec_helper.rb @@ -1,5 +1,4 @@ require 'hyper-spec' -require 'webdrivers' require 'pry' require 'opal-browser' From 95c60cb424816f592e4c531d4d7da728909f1d70 Mon Sep 17 00:00:00 2001 From: catmando Date: Mon, 1 May 2023 17:48:18 -0400 Subject: [PATCH 19/49] updating postgresql round 2 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60988ffa1..b8ad05631 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,10 +26,10 @@ _test_gem_pg: &_test_gem_pg before_install: - echo 'installing postgresql' - - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/11/main/postgresql.conf - - sudo cp /etc/postgresql/{9.6,11}/main/pg_hba.conf + - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf + - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf - sudo service postgresql stop - - sudo service postgresql start 11 + - sudo service postgresql start 12 - postgres --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 From 704818640d6296305c465f16acb9708557df2dcf Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 10:56:32 -0400 Subject: [PATCH 20/49] trying to get postgresql working again --- .travis.yml | 215 +++++++++++++++++++++++++++------------------------- 1 file changed, 110 insertions(+), 105 deletions(-) diff --git a/.travis.yml b/.travis.yml index b8ad05631..5a7d32c4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,10 @@ addons: - sourceline: 'deb http://dl.google.com/linux/chrome/deb/ stable main' key_url: 'https://dl-ssl.google.com/linux/linux_signing_key.pub' packages: - - postgresql-12 - chromium-chromedriver - google-chrome-stable - yarn - redis-server - postgresql: '12' _test_gem_pg: &_test_gem_pg stage: test @@ -24,13 +22,17 @@ _test_gem_pg: &_test_gem_pg directories: - node_modules # NPM packages + services: + - postgresql + + before_install: - - echo 'installing postgresql' - - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf - - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf - - sudo service postgresql stop - - sudo service postgresql start 12 - - postgres --version + # - echo 'installing postgresql' + # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf + # - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf + # - sudo service postgresql stop + # - sudo service postgresql start 12 + # - postgres --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 - rvm install 2.6.3 # was 2.5.1 @@ -42,6 +44,8 @@ _test_gem_pg: &_test_gem_pg - echo before_script $COMPONENT - echo updating chrome driver - cd ruby/$COMPONENT + - echo creating psql database + - psql -c 'create database hyper_mesh_test_db;' -U postgres - bundle install --jobs=3 --retry=3 - bundle exec ruby -e 'require "webdrivers"; Webdrivers::Chromedriver.update; puts Webdrivers::Chromedriver.current_version' - ls -la ~/.webdrivers @@ -78,6 +82,7 @@ _test_gem: &_test_gem mariadb: '10.3' services: - redis-server +\ before_install: - echo installing $COMPONENT # yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package @@ -117,106 +122,106 @@ _deploy_gem: &_deploy_gem jobs: include: - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 - - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - - <<: *_deploy_gem - env: COMPONENT=hyper-i18n - - <<: *_deploy_gem - env: COMPONENT=hyper-trace - - <<: *_deploy_gem - env: COMPONENT=hyper-state - - <<: *_deploy_gem - env: COMPONENT=hyper-component - - <<: *_deploy_gem - env: COMPONENT=hyper-model - - <<: *_deploy_gem - env: COMPONENT=hyper-operation - - <<: *_deploy_gem - env: COMPONENT=hyper-router - - <<: *_deploy_gem - env: COMPONENT=hyper-spec - - <<: *_deploy_gem - env: COMPONENT=hyper-store - - <<: *_deploy_gem - env: COMPONENT=rails-hyperstack - - <<: *_deploy_gem - env: COMPONENT=hyperstack-config + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 + + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + + # - <<: *_deploy_gem + # env: COMPONENT=hyper-i18n + # - <<: *_deploy_gem + # env: COMPONENT=hyper-trace + # - <<: *_deploy_gem + # env: COMPONENT=hyper-state + # - <<: *_deploy_gem + # env: COMPONENT=hyper-component + # - <<: *_deploy_gem + # env: COMPONENT=hyper-model + # - <<: *_deploy_gem + # env: COMPONENT=hyper-operation + # - <<: *_deploy_gem + # env: COMPONENT=hyper-router + # - <<: *_deploy_gem + # env: COMPONENT=hyper-spec + # - <<: *_deploy_gem + # env: COMPONENT=hyper-store + # - <<: *_deploy_gem + # env: COMPONENT=rails-hyperstack + # - <<: *_deploy_gem + # env: COMPONENT=hyperstack-config From 32495c7ec49d7f74e7f15e8a9cbbef5e96bae482 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 11:13:57 -0400 Subject: [PATCH 21/49] removed some deprecation notices: --- .travis.yml | 2 +- .../spec/client_features/component_spec.rb | 8 ++++---- .../spec/client_features/dsl_spec.rb | 2 +- .../spec/client_features/native_library_spec.rb | 2 +- .../opal_jquery_extensions_spec.rb | 2 +- .../client_features/param_declaration_spec.rb | 12 ++++++------ .../spec/client_features/state_spec.rb | 2 +- .../param_declaration_legacy_spec.rb | 16 ++++++++-------- ruby/hyper-component/spec/spec_helper.rb | 8 ++++---- ruby/hyper-model/spec/spec_helper.rb | 4 ++-- ruby/hyper-operation/spec/spec_helper.rb | 2 +- 11 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a7d32c4d..49eaefbf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,6 @@ _test_gem_pg: &_test_gem_pg services: - postgresql - before_install: # - echo 'installing postgresql' # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf @@ -54,6 +53,7 @@ _test_gem_pg: &_test_gem_pg - google-chrome --version - which google-chrome - yarn install + script: - echo running script $COMPONENT - DRIVER=travis bundle exec rake $TASK diff --git a/ruby/hyper-component/spec/client_features/component_spec.rb b/ruby/hyper-component/spec/client_features/component_spec.rb index 8f469c40f..11093b475 100644 --- a/ruby/hyper-component/spec/client_features/component_spec.rb +++ b/ruby/hyper-component/spec/client_features/component_spec.rb @@ -542,7 +542,7 @@ class Lorem; end end Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, bar: 10, lorem: Lorem.new) end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nRequired prop `foo` was not specified\nProvided prop `bar` could not be converted to String/) end @@ -560,7 +560,7 @@ class Lorem; end end Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, foo: 10, bar: '10', lorem: Lorem.new) end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")).to_not match(/prop/) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")).to_not match(/prop/) end end @@ -597,7 +597,7 @@ class Foo Hyperstack::Component::ReactTestUtils.render_component_into_document(foo) end - expect(page.driver.browser.manage.logs.get(:browser) + expect(page.driver.browser.logs.get(:browser) .reject { |entry| entry.to_s.include?('Deprecated feature') } .reject { |entry| entry.to_s.include?('Object freezing is not supported by Opal')} .map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n").size) @@ -612,7 +612,7 @@ class Foo < Hyperloop::Component render { Foo } end end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/did you mean to say Foo()/) end end diff --git a/ruby/hyper-component/spec/client_features/dsl_spec.rb b/ruby/hyper-component/spec/client_features/dsl_spec.rb index 81aa0a60a..68daab280 100644 --- a/ruby/hyper-component/spec/client_features/dsl_spec.rb +++ b/ruby/hyper-component/spec/client_features/dsl_spec.rb @@ -182,7 +182,7 @@ class NestedComp < Hyperloop::Component class Comp; end end end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Comp does not appear to be a react component./) end diff --git a/ruby/hyper-component/spec/client_features/native_library_spec.rb b/ruby/hyper-component/spec/client_features/native_library_spec.rb index 2b1f17f3c..1d54d80ba 100644 --- a/ruby/hyper-component/spec/client_features/native_library_spec.rb +++ b/ruby/hyper-component/spec/client_features/native_library_spec.rb @@ -171,7 +171,7 @@ class Foo < Hyperstack::Component::NativeLibrary rename "MispelledComponent" => "Bar" end end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/NativeLibrary.MispelledComponent is undefined/) # TODO was testing for cannot import, but that message gets trunkated end diff --git a/ruby/hyper-component/spec/client_features/opal_jquery_extensions_spec.rb b/ruby/hyper-component/spec/client_features/opal_jquery_extensions_spec.rb index 62d7637ed..089333340 100644 --- a/ruby/hyper-component/spec/client_features/opal_jquery_extensions_spec.rb +++ b/ruby/hyper-component/spec/client_features/opal_jquery_extensions_spec.rb @@ -90,7 +90,7 @@ class Foo < Hyperloop::Component Element[JS.call(:eval, "(function () { return window; })();")] true end.to be_truthy - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .not_to match(/Exception|Error/) end diff --git a/ruby/hyper-component/spec/client_features/param_declaration_spec.rb b/ruby/hyper-component/spec/client_features/param_declaration_spec.rb index 40befc90b..7d159fb2a 100644 --- a/ruby/hyper-component/spec/client_features/param_declaration_spec.rb +++ b/ruby/hyper-component/spec/client_features/param_declaration_spec.rb @@ -125,7 +125,7 @@ class Foo < Hyperloop::Component end end expect(page.body[-60..-19]).to include('
12-string
') - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo1` could not be converted to String/) end @@ -155,7 +155,7 @@ class Foo2 < Hyperloop::Component Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo2, bar: 10, lorem: Lorem.new) end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo2`\nRequired prop `foo` was not specified\nProvided prop `bar` could not be converted to String/) end @@ -171,7 +171,7 @@ class Foo < Hyperloop::Component end Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, foo: 10, bar: '10', lorem: Lorem.new) end - expect(page.driver.browser.manage.logs.get(:browser).reject { |m| m.message =~ /(D|d)eprecated/ }.map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).reject { |m| m.message =~ /(D|d)eprecated/ }.map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .not_to match(/Warning|Error/) end @@ -191,7 +191,7 @@ class Foo < Hyperloop::Component param :bar, type: [] end end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo` could not be converted to Array/) end @@ -202,7 +202,7 @@ class Foo < Hyperloop::Component param :bar, type: [String] end end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo`\[0\] could not be converted to String/) end @@ -227,7 +227,7 @@ def self._react_param_conversion(json, validate_only) end end expect(page.body[-60..-19]).to include('1, 2') - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo` could not be converted to BazWoggle/) end diff --git a/ruby/hyper-component/spec/client_features/state_spec.rb b/ruby/hyper-component/spec/client_features/state_spec.rb index e3dacde8f..29d0b9b40 100644 --- a/ruby/hyper-component/spec/client_features/state_spec.rb +++ b/ruby/hyper-component/spec/client_features/state_spec.rb @@ -40,7 +40,7 @@ class << self end expect_evaluate_ruby("MARKUP").to eq('Boom') expect_evaluate_ruby("StateTest.boom").to be_falsy - expect(page.driver.browser.manage.logs.get(:browser).reject { |entry| + expect(page.driver.browser.logs.get(:browser).reject { |entry| entry_s = entry.to_s entry_s.include?("Deprecated feature") || entry_s.include?("Mount() on the server. This is a no-op.") || diff --git a/ruby/hyper-component/spec/deprecated_features/param_declaration_legacy_spec.rb b/ruby/hyper-component/spec/deprecated_features/param_declaration_legacy_spec.rb index a7156e80b..d767b7b1b 100644 --- a/ruby/hyper-component/spec/deprecated_features/param_declaration_legacy_spec.rb +++ b/ruby/hyper-component/spec/deprecated_features/param_declaration_legacy_spec.rb @@ -49,7 +49,7 @@ def setup element = Hyperstack::Component::ReactAPI.create_element(Foo).on(:foo_submit) { 'bar' } Hyperstack::Component::ReactTestUtils.render_into_document(element) end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to_not match(/Exception raised/) end @@ -73,7 +73,7 @@ def setup element = Hyperstack::Component::ReactAPI.create_element(Foo).on(:foo_invoked) { return [1,2,3], 'bar' } Hyperstack::Component::ReactTestUtils.render_into_document(element) end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to_not match(/Exception raised/) end end @@ -199,7 +199,7 @@ class Foo < Hyperloop::Component end end expect(page.body[-60..-19]).to include('
12-string
') - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo1` could not be converted to String/) end @@ -216,7 +216,7 @@ class Foo2 < Hyperloop::Component Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo2, bar: 10, lorem: Lorem.new) end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo2`\nRequired prop `foo` was not specified\nProvided prop `bar` could not be converted to String/) end @@ -233,7 +233,7 @@ class Foo < Hyperloop::Component end Hyperstack::Component::ReactTestUtils.render_component_into_document(Foo, foo: 10, bar: '10', lorem: Lorem.new) end - expect(page.driver.browser.manage.logs.get(:browser).reject { |m| m.message =~ /(D|d)eprecated/ }.map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).reject { |m| m.message =~ /(D|d)eprecated/ }.map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .not_to match(/Warning|Error/) end @@ -254,7 +254,7 @@ class Foo < Hyperloop::Component param :bar, type: [] end end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo` could not be converted to Array/) end @@ -265,7 +265,7 @@ class Foo < Hyperloop::Component param :bar, type: [String] end end - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo`\[0\] could not be converted to String/) end @@ -290,7 +290,7 @@ def self._react_param_conversion(json, validate_only) end end expect(page.body[-60..-19]).to include('1, 2') - expect(page.driver.browser.manage.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) + expect(page.driver.browser.logs.get(:browser).map { |m| m.message.gsub(/\\n/, "\n") }.to_a.join("\n")) .to match(/Warning: Failed prop( type|Type): In component `Foo`\nProvided prop `foo` could not be converted to BazWoggle/) end diff --git a/ruby/hyper-component/spec/spec_helper.rb b/ruby/hyper-component/spec/spec_helper.rb index 47c233658..13de69f35 100644 --- a/ruby/hyper-component/spec/spec_helper.rb +++ b/ruby/hyper-component/spec/spec_helper.rb @@ -51,13 +51,13 @@ # Fail tests on JavaScript errors in Chrome Headless class JavaScriptError < StandardError; end - config.after(:each, js: true) do |spec| - logs = page.driver.browser.manage.logs.get(:browser) + config.after(:each, js: true) do + logs = page.driver.browser.logs.get(:browser) errors = logs.select { |e| e.level == "SEVERE" && e.message.present? } - .map { |m| m.message.gsub(/\\n/, "\n") }.to_a + .map { |m| m.message.gsub(/\\n/, "\n") }.to_a if client_options[:deprecation_warnings] == :on warnings = logs.select { |e| e.level == "WARNING" && e.message.present? } - .map { |m| m.message.gsub(/\\n/, "\n") }.to_a + .map { |m| m.message.gsub(/\\n/, "\n") }.to_a puts "\033[0;33;1m\nJavascript client console warnings:\n\n" + warnings.join("\n\n") + "\033[0;30;21m" if warnings.present? end unless client_options[:raise_on_js_errors] == :off diff --git a/ruby/hyper-model/spec/spec_helper.rb b/ruby/hyper-model/spec/spec_helper.rb index b860162e1..30273e7b9 100644 --- a/ruby/hyper-model/spec/spec_helper.rb +++ b/ruby/hyper-model/spec/spec_helper.rb @@ -176,7 +176,7 @@ def finished_all_ajax_requests? module CheckErrors def check_errors - logs = page.driver.browser.manage.logs.get(:browser) + logs = page.driver.browser.logs.get(:browser) errors = logs.select { |e| e.level == "SEVERE" && e.message.present? } .map { |m| m.message.gsub(/\\n/, "\n") }.to_a puts "WARNING - FOUND UNEXPECTED ERRORS #{errors}" if errors.present? @@ -308,7 +308,7 @@ class << self class JavaScriptError < StandardError; end config.after(:each, js: true) do |spec| - logs = page.driver.browser.manage.logs.get(:browser) + logs = page.driver.browser.logs.get(:browser) if spec.exception all_messages = logs.select { |e| e.message.present? } .map { |m| m.message.gsub(/\\n/, "\n") }.to_a diff --git a/ruby/hyper-operation/spec/spec_helper.rb b/ruby/hyper-operation/spec/spec_helper.rb index c773c3b06..c6d3924da 100644 --- a/ruby/hyper-operation/spec/spec_helper.rb +++ b/ruby/hyper-operation/spec/spec_helper.rb @@ -125,7 +125,7 @@ def self.on_server? # class JavaScriptError < StandardError; end # config.after(:each, js: true) do |spec| - # errors = page.driver.browser.manage.logs.get(:browser) + # errors = page.driver.browser.logs.get(:browser) # .select { |e| e.level == "SEVERE" && e.message.present? } # #.map { |m| m.message.gsub(/\\n/, "\n") }.to_a # #.reject { |e| e =~ /Unexpected response code: 200/ } From bd01d38ca53a49d7ae68c5e7e4caea323000397b Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 11:29:36 -0400 Subject: [PATCH 22/49] fixed parse error in yaml file --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 49eaefbf2..36ca42851 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,7 +82,7 @@ _test_gem: &_test_gem mariadb: '10.3' services: - redis-server -\ + before_install: - echo installing $COMPONENT # yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package From 698ec629c3dc94b3c61cb1ed8641ea7177cbe9fe Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 11:42:05 -0400 Subject: [PATCH 23/49] postgresql 3 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36ca42851..a00982df3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,9 @@ addons: - google-chrome-stable - yarn - redis-server +services: + - postgresql + _test_gem_pg: &_test_gem_pg stage: test @@ -22,9 +25,6 @@ _test_gem_pg: &_test_gem_pg directories: - node_modules # NPM packages - services: - - postgresql - before_install: # - echo 'installing postgresql' # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf From b6cead671f6aaea7cfcf89e06853708d3e0c76fe Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 11:55:45 -0400 Subject: [PATCH 24/49] postgresql 4 --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a00982df3..1a2314949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,9 @@ addons: - redis-server services: - postgresql +env: + global: + - PGPORT=5433 _test_gem_pg: &_test_gem_pg @@ -30,7 +33,7 @@ _test_gem_pg: &_test_gem_pg # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf # - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf # - sudo service postgresql stop - # - sudo service postgresql start 12 + # - sudo service postgresql start 12 -p 5433 # - postgres --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 From 2242fc37b4bf00d1742ef1a5211c3f6cba4f99cc Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 12:01:49 -0400 Subject: [PATCH 25/49] postgresql 5 --- .travis.yml | 6 +++--- ruby/hyper-component/spec/client_features/component_spec.rb | 1 + .../lib/hyperstack/native_wrapper_compatibility.rb | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1a2314949..770552208 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,11 +12,11 @@ addons: - google-chrome-stable - yarn - redis-server -services: - - postgresql env: global: - - PGPORT=5433 + - PGPORT=5433 +services: + - postgresql _test_gem_pg: &_test_gem_pg diff --git a/ruby/hyper-component/spec/client_features/component_spec.rb b/ruby/hyper-component/spec/client_features/component_spec.rb index 11093b475..6b3009913 100644 --- a/ruby/hyper-component/spec/client_features/component_spec.rb +++ b/ruby/hyper-component/spec/client_features/component_spec.rb @@ -597,6 +597,7 @@ class Foo Hyperstack::Component::ReactTestUtils.render_component_into_document(foo) end + binding.pry expect(page.driver.browser.logs.get(:browser) .reject { |entry| entry.to_s.include?('Deprecated feature') } .reject { |entry| entry.to_s.include?('Object freezing is not supported by Opal')} diff --git a/ruby/hyperstack-config/lib/hyperstack/native_wrapper_compatibility.rb b/ruby/hyperstack-config/lib/hyperstack/native_wrapper_compatibility.rb index fbb775f19..b8dc25507 100644 --- a/ruby/hyperstack-config/lib/hyperstack/native_wrapper_compatibility.rb +++ b/ruby/hyperstack-config/lib/hyperstack/native_wrapper_compatibility.rb @@ -1,7 +1,7 @@ # allows hyperstack to include Native::Wrapper even if running Opal 0.11 module Native module Wrapper - def self.included(klass) + def self.includedx(klass) if Native.instance_methods.include? :to_n klass.include Native else From c357a4c4e1a9fb72a94894f8674495fe67074c2f Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 12:09:10 -0400 Subject: [PATCH 26/49] postgresql 6 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 770552208..079fe2356 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,9 +32,9 @@ _test_gem_pg: &_test_gem_pg # - echo 'installing postgresql' # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf # - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf - # - sudo service postgresql stop - # - sudo service postgresql start 12 -p 5433 - # - postgres --version + - sudo service postgresql stop + - sudo service postgresql start 12 -p 5433 + - postgres --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 - rvm install 2.6.3 # was 2.5.1 From 51ebec9ea8641e0c2832ede6092c9d0495f67ea9 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 12:12:21 -0400 Subject: [PATCH 27/49] postgresql 7 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 079fe2356..8ca6d08ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ _test_gem_pg: &_test_gem_pg # - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf - sudo service postgresql stop - sudo service postgresql start 12 -p 5433 - - postgres --version + #- postgres --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 - rvm install 2.6.3 # was 2.5.1 From a5adf04092da3f227388ed819c7788355d750ad8 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 12:25:51 -0400 Subject: [PATCH 28/49] postgresql 8 --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ca6d08ff..99710415a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ addons: - redis-server env: global: - - PGPORT=5433 + - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE services: - postgresql @@ -32,9 +32,9 @@ _test_gem_pg: &_test_gem_pg # - echo 'installing postgresql' # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf # - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf - - sudo service postgresql stop - - sudo service postgresql start 12 -p 5433 - #- postgres --version + - sudo service postgresql stop # NOTE ADDING THESE TWO LINES MAKES NO DIFFERENCE + - sudo service postgresql start 12 -p 5433 # + - postgresql --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 - rvm install 2.6.3 # was 2.5.1 From ff76a4e1acce1a03b1b38cfb72f992d11e2701fd Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 12:39:12 -0400 Subject: [PATCH 29/49] postgresql 9 --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 99710415a..511a5d980 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,9 @@ addons: - google-chrome-stable - yarn - redis-server -env: - global: - - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE +# env: +# global: +# - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE services: - postgresql @@ -32,9 +32,9 @@ _test_gem_pg: &_test_gem_pg # - echo 'installing postgresql' # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf # - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf - - sudo service postgresql stop # NOTE ADDING THESE TWO LINES MAKES NO DIFFERENCE - - sudo service postgresql start 12 -p 5433 # - - postgresql --version + # - sudo service postgresql stop # NOTE ADDING THESE TWO LINES MAKES NO DIFFERENCE + # - sudo service postgresql start 12 -p 5433 # + # - postgresql --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 - rvm install 2.6.3 # was 2.5.1 From 64f6a0458e84ab54928e85e50590f3673196614c Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 13:35:38 -0400 Subject: [PATCH 30/49] postgresql 10 --- .travis.yml | 13 ++++++++----- ruby/hyper-model/spec/spec_helper.rb | 2 +- ruby/hyper-spec/lib/hyper-spec.rb | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 511a5d980..365c29b4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,12 @@ dist: focal +env: + global: + - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE + + addons: + postgresql: "11" apt: sources: - sourceline: 'deb http://dl.yarnpkg.com/debian/ stable main' @@ -12,11 +18,8 @@ addons: - google-chrome-stable - yarn - redis-server -# env: -# global: -# - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE -services: - - postgresql + - postgresql-11 + - postgresql-client-11 _test_gem_pg: &_test_gem_pg diff --git a/ruby/hyper-model/spec/spec_helper.rb b/ruby/hyper-model/spec/spec_helper.rb index 30273e7b9..28c895a47 100644 --- a/ruby/hyper-model/spec/spec_helper.rb +++ b/ruby/hyper-model/spec/spec_helper.rb @@ -336,7 +336,7 @@ class JavaScriptError < StandardError; end # Capybara.register_driver :chrome do |app| # #caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"excludeSwitches" => [ "ignore-certificate-errors" ]}) # caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => [ "--window-size=200,200" ]}) - # Capybara::Selenium::Driver.new(app, :browser => :chrome, :desired_capabilities => caps) + # Capybara::Selenium::Driver.new(app, :browser => :chrome, :capabilities => caps) # end # Use legacy hyper-spec on_client behavior diff --git a/ruby/hyper-spec/lib/hyper-spec.rb b/ruby/hyper-spec/lib/hyper-spec.rb index d566bb878..a02b03ede 100644 --- a/ruby/hyper-spec/lib/hyper-spec.rb +++ b/ruby/hyper-spec/lib/hyper-spec.rb @@ -205,7 +205,7 @@ def self.on_server? capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( chromeOptions: options, 'goog:loggingPrefs' => { browser: 'ALL' } ) - Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities) + Capybara::Selenium::Driver.new(app, browser: :chrome)#, capabilities: capabilities) end Capybara.register_driver :firefox do |app| From c44776f383edc865681c8f12cee1b48a38dcf1a8 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 14:06:27 -0400 Subject: [PATCH 31/49] postgresql 11 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 365c29b4b..3c65c112d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ env: global: - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE +services: + - postgresql addons: postgresql: "11" From af5fabc6250c7771a360da4284cb85f02f52657e Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 14:17:54 -0400 Subject: [PATCH 32/49] postgresql 12 --- .travis.yml | 6 ++--- ruby/hyper-spec/lib/hyper-spec.rb | 45 ++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3c65c112d..993639e12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ services: - postgresql addons: - postgresql: "11" + postgresql: "12.2" apt: sources: - sourceline: 'deb http://dl.yarnpkg.com/debian/ stable main' @@ -20,8 +20,8 @@ addons: - google-chrome-stable - yarn - redis-server - - postgresql-11 - - postgresql-client-11 + - postgresql-12.2 + - postgresql-client-12.2 _test_gem_pg: &_test_gem_pg diff --git a/ruby/hyper-spec/lib/hyper-spec.rb b/ruby/hyper-spec/lib/hyper-spec.rb index a02b03ede..f1ab52569 100644 --- a/ruby/hyper-spec/lib/hyper-spec.rb +++ b/ruby/hyper-spec/lib/hyper-spec.rb @@ -195,19 +195,44 @@ def self.on_server? Capybara.default_max_wait_time = 10 - Capybara.register_driver :chrome do |app| - options = {} - options.merge!( - w3c: false, - args: %w[auto-open-devtools-for-tabs] + Capybara.register_driver :chrome_undocked do |app| + opts = Selenium::WebDriver::Chrome::Options.new(args: %w[auto-open-devtools-for-tabs]) + opts.add_preference( + 'devtools', + 'preferences' => { + 'currentDockState' => '"undocked"', # Or '"bottom"', '"right"', etc. + 'panel-selectedTab' => '"console"' + } ) - options['mobileEmulation'] = { 'deviceName' => ENV['DEVICE'].tr('-', ' ') } if ENV['DEVICE'] - capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( - chromeOptions: options, 'goog:loggingPrefs' => { browser: 'ALL' } + caps = Selenium::WebDriver::Remote::Capabilities.chrome + caps["goog:loggingPrefs"] = { browser: 'ALL' } + + Capybara::Selenium::Driver.new(app, browser: :chrome, options: opts, desired_capabilities: caps) + end + + Capybara.register_driver :chrome_docked do |app| + opts = Selenium::WebDriver::Chrome::Options.new(args: %w[auto-open-devtools-for-tabs]) + opts.add_preference( + 'devtools', + 'preferences' => { + 'currentDockState' => '"right"', # Or '"bottom"', '"undocked"', etc. + 'panel-selectedTab' => '"console"' + } ) - Capybara::Selenium::Driver.new(app, browser: :chrome)#, capabilities: capabilities) + caps = Selenium::WebDriver::Remote::Capabilities.chrome + caps["goog:loggingPrefs"] = { browser: 'ALL' } + + Capybara::Selenium::Driver.new(app, browser: :chrome, options: opts, desired_capabilities: caps) end + Capybara.register_driver :chrome do |app| + caps = Selenium::WebDriver::Remote::Capabilities.chrome + + caps["goog:loggingPrefs"] = { browser: 'ALL' } # if ENV['LOG_JS'] + + Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: caps) + end + Capybara.register_driver :firefox do |app| Capybara::Selenium::Driver.new(app, browser: :firefox) end @@ -242,6 +267,8 @@ def self.on_server? Capybara.javascript_driver = case ENV['DRIVER'] when 'beheaded' then :firefox_headless + when 'chrome_undocked' then :chrome_undocked + when 'chrome_docked' then :chrome_docked when 'chrome' then :chrome when 'ff' then :selenium_with_firebug when 'firefox' then :firefox From 58c7396f3aa542eedefb22f6e0f23f08fd30a60a Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 14:22:13 -0400 Subject: [PATCH 33/49] postgresql 13 --- .travis.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 993639e12..dd9f6e6e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,10 @@ dist: focal -env: - global: - - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE - -services: - - postgresql +# env: +# global: +# - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE addons: - postgresql: "12.2" apt: sources: - sourceline: 'deb http://dl.yarnpkg.com/debian/ stable main' @@ -20,13 +16,12 @@ addons: - google-chrome-stable - yarn - redis-server - - postgresql-12.2 - - postgresql-client-12.2 - _test_gem_pg: &_test_gem_pg stage: test + services: postgresql + language: ruby cache: bundler: true From 7f61a2295877c2e94e8b816753e3d90881cf1bcf Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 14:26:36 -0400 Subject: [PATCH 34/49] postgresql 14 --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd9f6e6e0..c5af74721 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ dist: focal -# env: -# global: -# - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE +env: + global: + - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE addons: apt: From 270fb62f2ab44290da59a7afc66251db63d33165 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 17:55:01 -0400 Subject: [PATCH 35/49] fixed a few more issues, but postgresql still not running in CI --- ruby/hyper-component/hyper-component.gemspec | 1 + ruby/hyper-component/spec/client_features/component_spec.rb | 3 +-- ruby/hyper-component/spec/spec_helper.rb | 3 ++- .../spec/test_app/app/hyperstack/components/components.rb | 3 +++ .../spec/test_app/config/initializers/hyperstack.rb | 4 ++++ ruby/hyper-spec/hyper-spec.gemspec | 2 +- ruby/hyperstack-config/hyperstack-config.gemspec | 2 +- ruby/hyperstack-config/lib/hyperstack-config.rb | 6 ++++-- 8 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index ea1c05d3c..91c5e9274 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -30,6 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'mime-types' spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'nokogiri' + spec.add_development_dependency 'opal-browser', '~> 0.3.0' spec.add_development_dependency 'opal-jquery' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' diff --git a/ruby/hyper-component/spec/client_features/component_spec.rb b/ruby/hyper-component/spec/client_features/component_spec.rb index 6b3009913..adeca9003 100644 --- a/ruby/hyper-component/spec/client_features/component_spec.rb +++ b/ruby/hyper-component/spec/client_features/component_spec.rb @@ -594,10 +594,9 @@ class Foo foo.class_eval do render { "hello" } end - + Hyperstack::Component::ReactTestUtils.render_component_into_document(foo) end - binding.pry expect(page.driver.browser.logs.get(:browser) .reject { |entry| entry.to_s.include?('Deprecated feature') } .reject { |entry| entry.to_s.include?('Object freezing is not supported by Opal')} diff --git a/ruby/hyper-component/spec/spec_helper.rb b/ruby/hyper-component/spec/spec_helper.rb index 13de69f35..b84faf057 100644 --- a/ruby/hyper-component/spec/spec_helper.rb +++ b/ruby/hyper-component/spec/spec_helper.rb @@ -3,6 +3,8 @@ require 'opal' #require 'opal-rspec' require 'opal-jquery' +require 'opal-browser' + begin require File.expand_path('../test_app/config/environment', __FILE__) @@ -12,7 +14,6 @@ require 'rspec/rails' require 'hyper-spec' require 'pry' -require 'opal-browser' require 'timecop' diff --git a/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb b/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb index 87bfdc23a..d3873ad35 100644 --- a/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb +++ b/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb @@ -10,6 +10,9 @@ require 'js' # require 'hyper-store' require 'hyperstack/internal/component/haml' +require 'promise' +require 'browser/delay' +require 'browser/interval' # these mechanisms are deprecated in favor of using the features of hyper-spec. However # in order to expedite getting Hyperstack 1.0 released we are just leaving these methods diff --git a/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb b/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb index e2d0f5642..a483bd561 100644 --- a/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb +++ b/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb @@ -9,3 +9,7 @@ Hyperstack.import 'react-server', js_import: true, at_head: true, client_only: true Hyperstack.import 'hyperstack/component/jquery', client_only: true Hyperstack.import 'hyperstack/component/server' +Hyperstack.import 'promise', client_only: true +Hyperstack.import 'browser', client_only: true +Hyperstack.import 'browser/delay', client_only: true + diff --git a/ruby/hyper-spec/hyper-spec.gemspec b/ruby/hyper-spec/hyper-spec.gemspec index 3489f92c5..66f36d164 100644 --- a/ruby/hyper-spec/hyper-spec.gemspec +++ b/ruby/hyper-spec/hyper-spec.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.add_development_dependency 'bundler' spec.add_development_dependency 'hyper-component', HyperSpec::VERSION spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency - spec.add_development_dependency 'opal-browser', '~> 0.2.0' + spec.add_development_dependency 'opal-browser', '~> 0.3.0' spec.add_development_dependency 'opal-rails', '>= 0.9.4' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index d938c8e34..8ce8f2934 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'listen', '~> 3.0' # for hot loader # spec.add_dependency 'mini_racer', '~> 0.2.6' spec.add_dependency 'opal', ENV['OPAL_VERSION'] || '>= 0.11.0', '< 2.0' - spec.add_dependency 'opal-browser', '~> 0.2.0' + #spec.add_dependency 'opal-browser', '~> 0.3.0' spec.add_dependency 'uglifier' spec.add_dependency 'websocket' # for hot loader diff --git a/ruby/hyperstack-config/lib/hyperstack-config.rb b/ruby/hyperstack-config/lib/hyperstack-config.rb index a10902fe6..6562ab696 100644 --- a/ruby/hyperstack-config/lib/hyperstack-config.rb +++ b/ruby/hyperstack-config/lib/hyperstack-config.rb @@ -15,9 +15,10 @@ def self.naming_convention require 'hyperstack/active_support_string_inquirer.rb' require 'hyperstack_env' require 'hyperstack/hotloader/stub' + # require 'promise' REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? else require 'opal' - require 'opal-browser' + # require 'opal-browser' REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? # We need opal-rails to be loaded for Gem code to be properly included by sprockets. begin require 'opal-rails' if defined? Rails @@ -41,7 +42,8 @@ def self.naming_convention Hyperstack.define_setting :hotloader_ping, nil Hyperstack.define_setting :hotloader_ignore_callback_mapping, false Hyperstack.import 'opal', gem: true - Hyperstack.import 'browser', client_only: true + # Hyperstack.import 'promise', client_only: true REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? + # Hyperstack.import 'browser', client_only: true REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? Hyperstack.import 'hyperstack-config', gem: true Hyperstack.import 'hyperstack/autoloader' Hyperstack.import 'hyperstack/autoloader_starter' From 3aca99c5ae8a3dccd0929b85ebdd25491895d349 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 2 May 2023 17:59:41 -0400 Subject: [PATCH 36/49] turned rest of specs back on --- .travis.yml | 194 ++++++++++++++++++++++++++-------------------------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5af74721..c4367873c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -125,106 +125,106 @@ _deploy_gem: &_deploy_gem jobs: include: - # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db - # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 - - # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - # - <<: *_deploy_gem - # env: COMPONENT=hyper-i18n - # - <<: *_deploy_gem - # env: COMPONENT=hyper-trace - # - <<: *_deploy_gem - # env: COMPONENT=hyper-state - # - <<: *_deploy_gem - # env: COMPONENT=hyper-component - # - <<: *_deploy_gem - # env: COMPONENT=hyper-model - # - <<: *_deploy_gem - # env: COMPONENT=hyper-operation - # - <<: *_deploy_gem - # env: COMPONENT=hyper-router - # - <<: *_deploy_gem - # env: COMPONENT=hyper-spec - # - <<: *_deploy_gem - # env: COMPONENT=hyper-store - # - <<: *_deploy_gem - # env: COMPONENT=rails-hyperstack - # - <<: *_deploy_gem - # env: COMPONENT=hyperstack-config + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 + + - <<: *_test_gem + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + + - <<: *_test_gem + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + + - <<: *_deploy_gem + env: COMPONENT=hyper-i18n + - <<: *_deploy_gem + env: COMPONENT=hyper-trace + - <<: *_deploy_gem + env: COMPONENT=hyper-state + - <<: *_deploy_gem + env: COMPONENT=hyper-component + - <<: *_deploy_gem + env: COMPONENT=hyper-model + - <<: *_deploy_gem + env: COMPONENT=hyper-operation + - <<: *_deploy_gem + env: COMPONENT=hyper-router + - <<: *_deploy_gem + env: COMPONENT=hyper-spec + - <<: *_deploy_gem + env: COMPONENT=hyper-store + - <<: *_deploy_gem + env: COMPONENT=rails-hyperstack + - <<: *_deploy_gem + env: COMPONENT=hyperstack-config From 65fb090c9f89916de2872deb488891c3bc5d51ce Mon Sep 17 00:00:00 2001 From: catmando Date: Wed, 3 May 2023 16:14:34 -0400 Subject: [PATCH 37/49] some fixes but no prerendering busted --- ruby/hyper-component/hyper-component.gemspec | 1 - ruby/hyper-component/spec/spec_helper.rb | 4 --- .../app/hyperstack/components/components.rb | 13 ---------- .../config/initializers/hyperstack.rb | 4 --- ruby/hyper-i18n/spec/hyper_i18n_spec.rb | 26 ++++++++++--------- .../hyper-operation/transport/hyperstack.rb | 2 +- .../spec/test_app/config/application.rb | 1 + ruby/hyper-router/hyper-router.gemspec | 1 - ruby/hyper-spec/hyper-spec.gemspec | 1 - ruby/hyper-spec/spec/spec_helper.rb | 1 - .../hyperstack-config.gemspec | 2 +- .../lib/hyperstack-config.rb | 17 +++++++++--- 12 files changed, 30 insertions(+), 43 deletions(-) diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index 91c5e9274..ea1c05d3c 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -30,7 +30,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'mime-types' spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'nokogiri' - spec.add_development_dependency 'opal-browser', '~> 0.3.0' spec.add_development_dependency 'opal-jquery' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' diff --git a/ruby/hyper-component/spec/spec_helper.rb b/ruby/hyper-component/spec/spec_helper.rb index b84faf057..2c3f55c5c 100644 --- a/ruby/hyper-component/spec/spec_helper.rb +++ b/ruby/hyper-component/spec/spec_helper.rb @@ -1,10 +1,7 @@ ENV["RAILS_ENV"] ||= 'test' require 'opal' -#require 'opal-rspec' require 'opal-jquery' -require 'opal-browser' - begin require File.expand_path('../test_app/config/environment', __FILE__) @@ -16,7 +13,6 @@ require 'pry' require 'timecop' - RSpec.configure do |config| config.color = true config.fail_fast = ENV['FAIL_FAST'] || false diff --git a/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb b/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb index d3873ad35..edac28d18 100644 --- a/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb +++ b/ruby/hyper-component/spec/test_app/app/hyperstack/components/components.rb @@ -1,18 +1,5 @@ -# require 'hyper-component' -# if Hyperstack::Component::IsomorphicHelpers.on_opal_client? -# require 'browser' -# require 'browser/delay' -# #require 'react/ext/opal-jquery/element' -# require 'hyperstack/component/jquery' -# end -# require 'hyperstack/component/server' -# require 'hyperstack/component/auto-import' require 'js' -# require 'hyper-store' require 'hyperstack/internal/component/haml' -require 'promise' -require 'browser/delay' -require 'browser/interval' # these mechanisms are deprecated in favor of using the features of hyper-spec. However # in order to expedite getting Hyperstack 1.0 released we are just leaving these methods diff --git a/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb b/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb index a483bd561..e2d0f5642 100644 --- a/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb +++ b/ruby/hyper-component/spec/test_app/config/initializers/hyperstack.rb @@ -9,7 +9,3 @@ Hyperstack.import 'react-server', js_import: true, at_head: true, client_only: true Hyperstack.import 'hyperstack/component/jquery', client_only: true Hyperstack.import 'hyperstack/component/server' -Hyperstack.import 'promise', client_only: true -Hyperstack.import 'browser', client_only: true -Hyperstack.import 'browser/delay', client_only: true - diff --git a/ruby/hyper-i18n/spec/hyper_i18n_spec.rb b/ruby/hyper-i18n/spec/hyper_i18n_spec.rb index 6a85d00c4..2da168f78 100644 --- a/ruby/hyper-i18n/spec/hyper_i18n_spec.rb +++ b/ruby/hyper-i18n/spec/hyper_i18n_spec.rb @@ -10,26 +10,28 @@ class TestComponent include Hyperstack::Component include Hyperstack::I18n render(DIV) do - DIV(id: :tp1) { t(:the_key) } - DIV(id: :tp2) { I18n.t(:hello) } - DIV(id: :tp3) { l(Time.parse('1/1/2018 12:45')) } - DIV(id: :tp4) { l(Time.parse('1/1/2018 12:45'), '%B %d, %Y at %l:%M %P') } - DIV(id: :tp5) { MyModel.model_name.human } - DIV(id: :tp6) { MyModel.human_attribute_name('the_attribute') } + DIV(id: :tp1) { 'I am a key' } + # DIV(id: :tp1) { t(:the_key) } + # DIV(id: :tp2) { I18n.t(:hello) } + # DIV(id: :tp3) { l(Time.parse('1/1/2018 12:45')) } + # DIV(id: :tp4) { l(Time.parse('1/1/2018 12:45'), '%B %d, %Y at %l:%M %P') } + # DIV(id: :tp5) { MyModel.model_name.human } + # DIV(id: :tp6) { MyModel.human_attribute_name('the_attribute') } end end end end end - [['component rendering', :client_only], ['prerendering', :server_only]].each do |mode, flag| + [['prerendering', :server_only]].each do |mode, flag| # ['component rendering', :client_only], it "will translate during #{mode}", prerendering_on: flag == :server_only do mount 'Components::TestComponent', {}, render_on: flag + binding.pry expect(find('#tp1')).to have_content('I am a key') - expect(find('#tp2')).to have_content('Hello world') - expect(find('#tp3')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'))) - expect(find('#tp4')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'), format: '%B %d, %Y at %l:%M %P')) - expect(find('#tp5')).to have_content('My Model') - expect(find('#tp6')).to have_content('The Attribute') + # expect(find('#tp2')).to have_content('Hello world') + # expect(find('#tp3')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'))) + # expect(find('#tp4')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'), format: '%B %d, %Y at %l:%M %P')) + # expect(find('#tp5')).to have_content('My Model') + # expect(find('#tp6')).to have_content('The Attribute') end end end diff --git a/ruby/hyper-operation/lib/hyper-operation/transport/hyperstack.rb b/ruby/hyper-operation/lib/hyper-operation/transport/hyperstack.rb index 1d78cc26b..31de6917e 100644 --- a/ruby/hyper-operation/lib/hyper-operation/transport/hyperstack.rb +++ b/ruby/hyper-operation/lib/hyper-operation/transport/hyperstack.rb @@ -70,7 +70,7 @@ def self.reset_operations if connection[:adapter] == :redis require 'redis' - connection[:redis_url] ||= 'redis://127.0.0.1:6379/hyperstack' + connection[:redis_url] ||= 'redis://127.0.0.1:6379/0' end end diff --git a/ruby/hyper-operation/spec/test_app/config/application.rb b/ruby/hyper-operation/spec/test_app/config/application.rb index 424c42ada..b763a19e4 100644 --- a/ruby/hyper-operation/spec/test_app/config/application.rb +++ b/ruby/hyper-operation/spec/test_app/config/application.rb @@ -23,6 +23,7 @@ class Application < Rails::Application config.opal.enable_specs = true config.opal.spec_location = 'spec-opal' config.hyperstack.auto_config = false + config.active_record.yaml_column_permitted_classes = [Symbol, ActiveSupport::HashWithIndifferentAccess] config.assets.cache_store = :null_store # Settings in config/environments/* take precedence over those specified here. diff --git a/ruby/hyper-router/hyper-router.gemspec b/ruby/hyper-router/hyper-router.gemspec index 941377c60..638e801a5 100644 --- a/ruby/hyper-router/hyper-router.gemspec +++ b/ruby/hyper-router/hyper-router.gemspec @@ -17,7 +17,6 @@ Gem::Specification.new do |spec| spec.add_dependency 'hyper-component', HyperRouter::VERSION spec.add_dependency 'hyper-state', HyperRouter::VERSION - spec.add_dependency 'opal-browser', '~> 0.2.0' spec.add_development_dependency 'bundler' spec.add_development_dependency 'chromedriver-helper' diff --git a/ruby/hyper-spec/hyper-spec.gemspec b/ruby/hyper-spec/hyper-spec.gemspec index 66f36d164..2e11da315 100644 --- a/ruby/hyper-spec/hyper-spec.gemspec +++ b/ruby/hyper-spec/hyper-spec.gemspec @@ -37,7 +37,6 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.add_development_dependency 'bundler' spec.add_development_dependency 'hyper-component', HyperSpec::VERSION spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency - spec.add_development_dependency 'opal-browser', '~> 0.3.0' spec.add_development_dependency 'opal-rails', '>= 0.9.4' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' diff --git a/ruby/hyper-spec/spec/spec_helper.rb b/ruby/hyper-spec/spec/spec_helper.rb index 2ed740a54..deee6f270 100644 --- a/ruby/hyper-spec/spec/spec_helper.rb +++ b/ruby/hyper-spec/spec/spec_helper.rb @@ -1,6 +1,5 @@ require 'hyper-spec' require 'pry' -require 'opal-browser' ENV["RAILS_ENV"] ||= 'test' require File.expand_path('../test_app/config/environment', __FILE__) diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index 8ce8f2934..66a567de0 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'listen', '~> 3.0' # for hot loader # spec.add_dependency 'mini_racer', '~> 0.2.6' spec.add_dependency 'opal', ENV['OPAL_VERSION'] || '>= 0.11.0', '< 2.0' - #spec.add_dependency 'opal-browser', '~> 0.3.0' + spec.add_dependency 'opal-browser' # this is needed everywhere else so its loaded here spec.add_dependency 'uglifier' spec.add_dependency 'websocket' # for hot loader diff --git a/ruby/hyperstack-config/lib/hyperstack-config.rb b/ruby/hyperstack-config/lib/hyperstack-config.rb index 6562ab696..9e8701416 100644 --- a/ruby/hyperstack-config/lib/hyperstack-config.rb +++ b/ruby/hyperstack-config/lib/hyperstack-config.rb @@ -15,10 +15,14 @@ def self.naming_convention require 'hyperstack/active_support_string_inquirer.rb' require 'hyperstack_env' require 'hyperstack/hotloader/stub' - # require 'promise' REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? + # because promises and features in opal-browsers are used everywhere we load them here + require 'promise' + require 'opal-browser' else require 'opal' - # require 'opal-browser' REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? + # because promises and features in opal-browsers are used everywhere we load them here + require 'opal-browser' + # We need opal-rails to be loaded for Gem code to be properly included by sprockets. begin require 'opal-rails' if defined? Rails @@ -42,8 +46,13 @@ def self.naming_convention Hyperstack.define_setting :hotloader_ping, nil Hyperstack.define_setting :hotloader_ignore_callback_mapping, false Hyperstack.import 'opal', gem: true - # Hyperstack.import 'promise', client_only: true REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? - # Hyperstack.import 'browser', client_only: true REMOVED DURING UPGRADE TO Opal 1.7 WHY WAS THIS HERE? + + # because promises and features in opal-browsers are used everywhere we load them here + Hyperstack.import 'promise', client_only: true + Hyperstack.import 'browser', client_only: true + Hyperstack.import 'browser/delay', client_only: true + Hyperstack.import 'browser/interval', client_only: true + Hyperstack.import 'hyperstack-config', gem: true Hyperstack.import 'hyperstack/autoloader' Hyperstack.import 'hyperstack/autoloader_starter' From 15856ad6de488c5a6e807dac77881db89560cb90 Mon Sep 17 00:00:00 2001 From: catmando Date: Wed, 3 May 2023 17:49:27 -0400 Subject: [PATCH 38/49] prerendering working again after fixing merge mess --- ruby/hyperstack-config/lib/hyperstack-config.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ruby/hyperstack-config/lib/hyperstack-config.rb b/ruby/hyperstack-config/lib/hyperstack-config.rb index 9e8701416..bf5cf9aa3 100644 --- a/ruby/hyperstack-config/lib/hyperstack-config.rb +++ b/ruby/hyperstack-config/lib/hyperstack-config.rb @@ -15,9 +15,9 @@ def self.naming_convention require 'hyperstack/active_support_string_inquirer.rb' require 'hyperstack_env' require 'hyperstack/hotloader/stub' - # because promises and features in opal-browsers are used everywhere we load them here - require 'promise' - require 'opal-browser' + # uncommenting these lines breaks prerendering + # require 'promise' + # require 'opal-browser' else require 'opal' # because promises and features in opal-browsers are used everywhere we load them here From 75d3d131c88cad9f70ca79c9d7b363c5ae497a17 Mon Sep 17 00:00:00 2001 From: catmando Date: Thu, 4 May 2023 10:37:21 -0400 Subject: [PATCH 39/49] working on pg again --- .travis.yml | 194 +++++++++++++++++++++++++++------------------------- 1 file changed, 101 insertions(+), 93 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4367873c..ff047e65c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,12 @@ dist: focal env: global: - - PGPORT=5433 # NOTE ADDING THIS MAKES NO DIFFERENCE + - PGUSER=postgres + - PGPORT=5432 + - PGHOST=localhost addons: + postgresql: '12' apt: sources: - sourceline: 'deb http://dl.yarnpkg.com/debian/ stable main' @@ -16,11 +19,12 @@ addons: - google-chrome-stable - yarn - redis-server + - postgresql-12 _test_gem_pg: &_test_gem_pg stage: test - services: postgresql + # services: postgresql language: ruby cache: @@ -35,6 +39,10 @@ _test_gem_pg: &_test_gem_pg # - sudo service postgresql stop # NOTE ADDING THESE TWO LINES MAKES NO DIFFERENCE # - sudo service postgresql start 12 -p 5433 # # - postgresql --version + - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf + - sudo service postgresql restart + - sleep 1 + - postgres --version - sudo rm -f /usr/local/bin/yarn - nvm install 10 - rvm install 2.6.3 # was 2.5.1 @@ -125,106 +133,106 @@ _deploy_gem: &_deploy_gem jobs: include: - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 - - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 + + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - - <<: *_deploy_gem - env: COMPONENT=hyper-i18n - - <<: *_deploy_gem - env: COMPONENT=hyper-trace - - <<: *_deploy_gem - env: COMPONENT=hyper-state - - <<: *_deploy_gem - env: COMPONENT=hyper-component - - <<: *_deploy_gem - env: COMPONENT=hyper-model - - <<: *_deploy_gem - env: COMPONENT=hyper-operation - - <<: *_deploy_gem - env: COMPONENT=hyper-router - - <<: *_deploy_gem - env: COMPONENT=hyper-spec - - <<: *_deploy_gem - env: COMPONENT=hyper-store - - <<: *_deploy_gem - env: COMPONENT=rails-hyperstack - - <<: *_deploy_gem - env: COMPONENT=hyperstack-config + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + + # - <<: *_deploy_gem + # env: COMPONENT=hyper-i18n + # - <<: *_deploy_gem + # env: COMPONENT=hyper-trace + # - <<: *_deploy_gem + # env: COMPONENT=hyper-state + # - <<: *_deploy_gem + # env: COMPONENT=hyper-component + # - <<: *_deploy_gem + # env: COMPONENT=hyper-model + # - <<: *_deploy_gem + # env: COMPONENT=hyper-operation + # - <<: *_deploy_gem + # env: COMPONENT=hyper-router + # - <<: *_deploy_gem + # env: COMPONENT=hyper-spec + # - <<: *_deploy_gem + # env: COMPONENT=hyper-store + # - <<: *_deploy_gem + # env: COMPONENT=rails-hyperstack + # - <<: *_deploy_gem + # env: COMPONENT=hyperstack-config From 09df6fa198ef40cbe7d791f3a1e662587618ccd0 Mon Sep 17 00:00:00 2001 From: catmando Date: Thu, 4 May 2023 12:25:35 -0400 Subject: [PATCH 40/49] rails-hyperstack and hyper-i18n working --- .travis.yml | 190 +++++++++--------- ruby/hyper-i18n/spec/hyper_i18n_spec.rb | 26 ++- ruby/hyper-operation/hyper-operation.gemspec | 2 +- ruby/hyper-state/hyper-state.gemspec | 2 +- ruby/rails-hyperstack/Rakefile | 3 + .../rails-hyperstack/rails-hyperstack.gemspec | 5 +- 6 files changed, 110 insertions(+), 118 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff047e65c..481f869f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,6 @@ addons: _test_gem_pg: &_test_gem_pg stage: test - # services: postgresql - language: ruby cache: bundler: true @@ -33,12 +31,6 @@ _test_gem_pg: &_test_gem_pg - node_modules # NPM packages before_install: - # - echo 'installing postgresql' - # - sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/12/main/postgresql.conf - # - sudo cp /etc/postgresql/{9.6,12}/main/pg_hba.conf - # - sudo service postgresql stop # NOTE ADDING THESE TWO LINES MAKES NO DIFFERENCE - # - sudo service postgresql start 12 -p 5433 # - # - postgresql --version - sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf - sudo service postgresql restart - sleep 1 @@ -133,106 +125,106 @@ _deploy_gem: &_deploy_gem jobs: include: - # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db - # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 - - # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 + + - <<: *_test_gem + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - <<: *_test_gem_pg env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - # - <<: *_deploy_gem - # env: COMPONENT=hyper-i18n - # - <<: *_deploy_gem - # env: COMPONENT=hyper-trace - # - <<: *_deploy_gem - # env: COMPONENT=hyper-state - # - <<: *_deploy_gem - # env: COMPONENT=hyper-component - # - <<: *_deploy_gem - # env: COMPONENT=hyper-model - # - <<: *_deploy_gem - # env: COMPONENT=hyper-operation - # - <<: *_deploy_gem - # env: COMPONENT=hyper-router - # - <<: *_deploy_gem - # env: COMPONENT=hyper-spec - # - <<: *_deploy_gem - # env: COMPONENT=hyper-store - # - <<: *_deploy_gem - # env: COMPONENT=rails-hyperstack - # - <<: *_deploy_gem - # env: COMPONENT=hyperstack-config + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + + - <<: *_test_gem + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + + - <<: *_deploy_gem + env: COMPONENT=hyper-i18n + - <<: *_deploy_gem + env: COMPONENT=hyper-trace + - <<: *_deploy_gem + env: COMPONENT=hyper-state + - <<: *_deploy_gem + env: COMPONENT=hyper-component + - <<: *_deploy_gem + env: COMPONENT=hyper-model + - <<: *_deploy_gem + env: COMPONENT=hyper-operation + - <<: *_deploy_gem + env: COMPONENT=hyper-router + - <<: *_deploy_gem + env: COMPONENT=hyper-spec + - <<: *_deploy_gem + env: COMPONENT=hyper-store + - <<: *_deploy_gem + env: COMPONENT=rails-hyperstack + - <<: *_deploy_gem + env: COMPONENT=hyperstack-config diff --git a/ruby/hyper-i18n/spec/hyper_i18n_spec.rb b/ruby/hyper-i18n/spec/hyper_i18n_spec.rb index 2da168f78..6a85d00c4 100644 --- a/ruby/hyper-i18n/spec/hyper_i18n_spec.rb +++ b/ruby/hyper-i18n/spec/hyper_i18n_spec.rb @@ -10,28 +10,26 @@ class TestComponent include Hyperstack::Component include Hyperstack::I18n render(DIV) do - DIV(id: :tp1) { 'I am a key' } - # DIV(id: :tp1) { t(:the_key) } - # DIV(id: :tp2) { I18n.t(:hello) } - # DIV(id: :tp3) { l(Time.parse('1/1/2018 12:45')) } - # DIV(id: :tp4) { l(Time.parse('1/1/2018 12:45'), '%B %d, %Y at %l:%M %P') } - # DIV(id: :tp5) { MyModel.model_name.human } - # DIV(id: :tp6) { MyModel.human_attribute_name('the_attribute') } + DIV(id: :tp1) { t(:the_key) } + DIV(id: :tp2) { I18n.t(:hello) } + DIV(id: :tp3) { l(Time.parse('1/1/2018 12:45')) } + DIV(id: :tp4) { l(Time.parse('1/1/2018 12:45'), '%B %d, %Y at %l:%M %P') } + DIV(id: :tp5) { MyModel.model_name.human } + DIV(id: :tp6) { MyModel.human_attribute_name('the_attribute') } end end end end end - [['prerendering', :server_only]].each do |mode, flag| # ['component rendering', :client_only], + [['component rendering', :client_only], ['prerendering', :server_only]].each do |mode, flag| it "will translate during #{mode}", prerendering_on: flag == :server_only do mount 'Components::TestComponent', {}, render_on: flag - binding.pry expect(find('#tp1')).to have_content('I am a key') - # expect(find('#tp2')).to have_content('Hello world') - # expect(find('#tp3')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'))) - # expect(find('#tp4')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'), format: '%B %d, %Y at %l:%M %P')) - # expect(find('#tp5')).to have_content('My Model') - # expect(find('#tp6')).to have_content('The Attribute') + expect(find('#tp2')).to have_content('Hello world') + expect(find('#tp3')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'))) + expect(find('#tp4')).to have_content(::I18n.l(Time.parse('1/1/2018 12:45'), format: '%B %d, %Y at %l:%M %P')) + expect(find('#tp5')).to have_content('My Model') + expect(find('#tp6')).to have_content('The Attribute') end end end diff --git a/ruby/hyper-operation/hyper-operation.gemspec b/ruby/hyper-operation/hyper-operation.gemspec index 7b138a51d..773db7ab8 100644 --- a/ruby/hyper-operation/hyper-operation.gemspec +++ b/ruby/hyper-operation/hyper-operation.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'database_cleaner' spec.add_development_dependency 'hyper-spec', Hyperstack::Operation::VERSION spec.add_development_dependency 'mysql2' - spec.add_development_dependency 'opal-browser', '~> 0.2.0' + # spec.add_development_dependency 'opal-browser', '~> 0.2.0' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' diff --git a/ruby/hyper-state/hyper-state.gemspec b/ruby/hyper-state/hyper-state.gemspec index 9f0650513..c1e0802c0 100644 --- a/ruby/hyper-state/hyper-state.gemspec +++ b/ruby/hyper-state/hyper-state.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-spec', Hyperstack::State::VERSION spec.add_development_dependency 'listen' # spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency, '~> 0.2.4' - spec.add_development_dependency 'opal-browser', '~> 0.2.0' + # spec.add_development_dependency 'opal-browser', '~> 0.2.0' spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' diff --git a/ruby/rails-hyperstack/Rakefile b/ruby/rails-hyperstack/Rakefile index 70271475f..0ced07979 100644 --- a/ruby/rails-hyperstack/Rakefile +++ b/ruby/rails-hyperstack/Rakefile @@ -21,6 +21,9 @@ namespace :spec do sh('spring stop') sh('bundle exec rails g hyperstack:install') sh('bundle exec rails generate model Sample name:string description:text') + sleep 1 + sh('pwd') + sh('ls app/models') sh('mv app/models/sample.rb app/hyperstack/models/sample.rb') sh("cat ../server_side_sample.rb >> app/models/sample.rb") sh('bundle exec rake db:migrate') diff --git a/ruby/rails-hyperstack/rails-hyperstack.gemspec b/ruby/rails-hyperstack/rails-hyperstack.gemspec index ebcc5176c..498118adc 100644 --- a/ruby/rails-hyperstack/rails-hyperstack.gemspec +++ b/ruby/rails-hyperstack/rails-hyperstack.gemspec @@ -58,9 +58,8 @@ You can control how much of the stack gets installed as well: spec.add_dependency 'hyper-model', Hyperstack::VERSION spec.add_dependency 'hyper-router', Hyperstack::ROUTERVERSION spec.add_dependency 'hyperstack-config', Hyperstack::VERSION - spec.add_dependency 'opal-rails' #, '~> 2.0' - - spec.add_dependency 'opal-browser', '~> 0.2.0' + spec.add_dependency 'opal-rails' + spec.add_dependency 'opal', ENV['OPAL_VERSION'] || '>= 0.11.0', '< 1.1' spec.add_dependency 'react-rails', '>= 2.4.0', '< 2.5.0' # spec.add_dependency 'mini_racer', '~> 0.2.6' # spec.add_dependency 'libv8', '~> 7.3.492.27.1' From 958691c196550fc324ecc4d3c2644ccc30ae10aa Mon Sep 17 00:00:00 2001 From: catmando Date: Thu, 4 May 2023 14:25:15 -0400 Subject: [PATCH 41/49] added promise back in to hyperstack-config now playing with travis --- .travis.yml | 204 +++++++++--------- .../lib/hyperstack-config.rb | 2 +- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/.travis.yml b/.travis.yml index 481f869f8..6251a5c91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -126,105 +126,105 @@ _deploy_gem: &_deploy_gem jobs: include: - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 - - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' - - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - - - <<: *_deploy_gem - env: COMPONENT=hyper-i18n - - <<: *_deploy_gem - env: COMPONENT=hyper-trace - - <<: *_deploy_gem - env: COMPONENT=hyper-state - - <<: *_deploy_gem - env: COMPONENT=hyper-component - - <<: *_deploy_gem - env: COMPONENT=hyper-model - - <<: *_deploy_gem - env: COMPONENT=hyper-operation - - <<: *_deploy_gem - env: COMPONENT=hyper-router - - <<: *_deploy_gem - env: COMPONENT=hyper-spec - - <<: *_deploy_gem - env: COMPONENT=hyper-store - - <<: *_deploy_gem - env: COMPONENT=rails-hyperstack - - <<: *_deploy_gem - env: COMPONENT=hyperstack-config + env: DISABLE_SPRING=true COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 + + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + + # - <<: *_test_gem + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # - <<: *_test_gem_pg + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # - <<: *_test_gem + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + + # - <<: *_deploy_gem + # env: COMPONENT=hyper-i18n + # - <<: *_deploy_gem + # env: COMPONENT=hyper-trace + # - <<: *_deploy_gem + # env: COMPONENT=hyper-state + # - <<: *_deploy_gem + # env: COMPONENT=hyper-component + # - <<: *_deploy_gem + # env: COMPONENT=hyper-model + # - <<: *_deploy_gem + # env: COMPONENT=hyper-operation + # - <<: *_deploy_gem + # env: COMPONENT=hyper-router + # - <<: *_deploy_gem + # env: COMPONENT=hyper-spec + # - <<: *_deploy_gem + # env: COMPONENT=hyper-store + # - <<: *_deploy_gem + # env: COMPONENT=rails-hyperstack + # - <<: *_deploy_gem + # env: COMPONENT=hyperstack-config diff --git a/ruby/hyperstack-config/lib/hyperstack-config.rb b/ruby/hyperstack-config/lib/hyperstack-config.rb index bf5cf9aa3..f7bca1555 100644 --- a/ruby/hyperstack-config/lib/hyperstack-config.rb +++ b/ruby/hyperstack-config/lib/hyperstack-config.rb @@ -15,8 +15,8 @@ def self.naming_convention require 'hyperstack/active_support_string_inquirer.rb' require 'hyperstack_env' require 'hyperstack/hotloader/stub' + require 'promise' # uncommenting these lines breaks prerendering - # require 'promise' # require 'opal-browser' else require 'opal' From a760fa7c3e075d8bae5931ab18001f11d4e823cc Mon Sep 17 00:00:00 2001 From: catmando Date: Thu, 4 May 2023 14:45:28 -0400 Subject: [PATCH 42/49] trying to get rails-hyperstack passing on travis --- .travis.yml | 2 +- ruby/hyper-component/hyper-component.gemspec | 2 +- ruby/hyper-component/spec/active_support_spec.rb | 1 + ruby/hyperstack-config/hyperstack-config.gemspec | 2 +- ruby/rails-hyperstack/Rakefile | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6251a5c91..61860bdaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -126,7 +126,7 @@ _deploy_gem: &_deploy_gem jobs: include: - <<: *_test_gem - env: DISABLE_SPRING=true COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 # - <<: *_test_gem # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 # - <<: *_test_gem diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index ea1c05d3c..3eedaaa27 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'nokogiri' spec.add_development_dependency 'opal-jquery' - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' #, '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyper-component/spec/active_support_spec.rb b/ruby/hyper-component/spec/active_support_spec.rb index 8d0546730..1fdc08834 100644 --- a/ruby/hyper-component/spec/active_support_spec.rb +++ b/ruby/hyper-component/spec/active_support_spec.rb @@ -18,6 +18,7 @@ def payments GenericEnumerable.new([ Payment.new(5), Payment.new(15), Payment.new(10) ]) end end + binding.pry expect_evaluate_ruby do { Payment.new(5) => 5, Payment.new(15) => 15, Payment.new(10) => 10 } == payments.index_with(&:price) end.to be_truthy diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index 66a567de0..2c59a1cbb 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'listen', '~> 3.0' # for hot loader # spec.add_dependency 'mini_racer', '~> 0.2.6' - spec.add_dependency 'opal', ENV['OPAL_VERSION'] || '>= 0.11.0', '< 2.0' + spec.add_dependency 'opal', ENV['OPAL_VERSION'] || '>= 0.11.0', '< 1.1' spec.add_dependency 'opal-browser' # this is needed everywhere else so its loaded here spec.add_dependency 'uglifier' spec.add_dependency 'websocket' # for hot loader diff --git a/ruby/rails-hyperstack/Rakefile b/ruby/rails-hyperstack/Rakefile index 0ced07979..9e31d53fd 100644 --- a/ruby/rails-hyperstack/Rakefile +++ b/ruby/rails-hyperstack/Rakefile @@ -29,6 +29,7 @@ namespace :spec do sh('bundle exec rake db:migrate') sh('RAILS_ENV=test bundle exec rake db:setup') # sh('bundle exec rails dev:cache') # not tested yet... + sh('RAILS_ENV=test bundle exec rails webpacker:compile') end end end From 7f21d93b69002bb8093458817ee8d557ee0b7535 Mon Sep 17 00:00:00 2001 From: catmando Date: Thu, 4 May 2023 15:38:31 -0400 Subject: [PATCH 43/49] still working rails-hyperstack CI issue --- .travis.yml | 2 +- ruby/hyperstack-config/hyperstack-config.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61860bdaa..8e8c4a02e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -91,7 +91,7 @@ _test_gem: &_test_gem # yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package # must remove this zombie for new yarn to work - sudo rm -f /usr/local/bin/yarn - - nvm install 10 + - nvm install 14 - rvm install 2.6.3 # was 2.5.1 - gem install bundler - echo 'install completed' diff --git a/ruby/hyperstack-config/hyperstack-config.gemspec b/ruby/hyperstack-config/hyperstack-config.gemspec index 2c59a1cbb..584a25fd2 100644 --- a/ruby/hyperstack-config/hyperstack-config.gemspec +++ b/ruby/hyperstack-config/hyperstack-config.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler' spec.add_development_dependency 'chromedriver-helper' - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' #, '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' From 5efd1a9fe0855849a6e8f7802e17805d9c73f66b Mon Sep 17 00:00:00 2001 From: catmando Date: Thu, 4 May 2023 18:06:43 -0400 Subject: [PATCH 44/49] testing Rails 6.1 now --- ruby/hyper-component/hyper-component.gemspec | 2 +- .../spec/active_support_spec.rb | 2 +- .../test_app/app/assets/config/manifest.js | 1 + .../app/xxxjavascript/packs/client_only.js | 7 + ruby/hyper-i18n/hyper-i18n.gemspec | 2 +- ruby/hyper-model/hyper-model.gemspec | 2 +- .../test_app/app/assets/config/manifest.js | 2 + ruby/hyper-model/spec/test_app/db/schema.rb | 122 ------ ruby/hyper-operation/hyper-operation.gemspec | 2 +- .../test_app/app/assets/config/manifest.js | 2 + ruby/hyper-router/hyper-router.gemspec | 3 +- .../test_app/app/assets/config/manifest.js | 3 + .../component_test_helpers working.rbx | 365 ++++++++++++++++++ ruby/hyper-state/hyper-state.gemspec | 2 +- ruby/hyper-store/hyper-store.gemspec | 2 +- .../test_app/app/assets/config/manifest.js | 1 + 16 files changed, 390 insertions(+), 130 deletions(-) create mode 100644 ruby/hyper-component/spec/test_app/app/xxxjavascript/packs/client_only.js create mode 100644 ruby/hyper-model/spec/test_app/app/assets/config/manifest.js delete mode 100644 ruby/hyper-model/spec/test_app/db/schema.rb create mode 100644 ruby/hyper-operation/spec/test_app/app/assets/config/manifest.js create mode 100644 ruby/hyper-router/spec/test_app/app/assets/config/manifest.js create mode 100644 ruby/hyper-spec/lib/hyper-spec/component_test_helpers working.rbx create mode 100644 ruby/hyperstack-config/spec/test_app/app/assets/config/manifest.js diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index 3eedaaa27..cd29a4f2d 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'nokogiri' spec.add_development_dependency 'opal-jquery' - spec.add_development_dependency 'opal-rails' #, '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' , '>= 0.9.4', '< 2.0' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyper-component/spec/active_support_spec.rb b/ruby/hyper-component/spec/active_support_spec.rb index 1fdc08834..a7614ba5f 100644 --- a/ruby/hyper-component/spec/active_support_spec.rb +++ b/ruby/hyper-component/spec/active_support_spec.rb @@ -18,7 +18,7 @@ def payments GenericEnumerable.new([ Payment.new(5), Payment.new(15), Payment.new(10) ]) end end - binding.pry + expect_evaluate_ruby do { Payment.new(5) => 5, Payment.new(15) => 15, Payment.new(10) => 10 } == payments.index_with(&:price) end.to be_truthy diff --git a/ruby/hyper-component/spec/test_app/app/assets/config/manifest.js b/ruby/hyper-component/spec/test_app/app/assets/config/manifest.js index b16e53d6d..27de0df30 100644 --- a/ruby/hyper-component/spec/test_app/app/assets/config/manifest.js +++ b/ruby/hyper-component/spec/test_app/app/assets/config/manifest.js @@ -1,3 +1,4 @@ //= link_tree ../images //= link_directory ../javascripts .js +//= link application.css //= link_directory ../stylesheets .css diff --git a/ruby/hyper-component/spec/test_app/app/xxxjavascript/packs/client_only.js b/ruby/hyper-component/spec/test_app/app/xxxjavascript/packs/client_only.js new file mode 100644 index 000000000..52f446dd4 --- /dev/null +++ b/ruby/hyper-component/spec/test_app/app/xxxjavascript/packs/client_only.js @@ -0,0 +1,7 @@ +//app/javascript/packs/client_only.js +// add any requires for packages that will run client side only +ReactDOM = require('react-dom'); // react-js client side code +jQuery = require('jquery'); // remove if you don't need jQuery +// to add additional NPM packages call run yarn add package-name@version +// then add the require here. + diff --git a/ruby/hyper-i18n/hyper-i18n.gemspec b/ruby/hyper-i18n/hyper-i18n.gemspec index 19cf6e290..304b20aa0 100644 --- a/ruby/hyper-i18n/hyper-i18n.gemspec +++ b/ruby/hyper-i18n/hyper-i18n.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-model', Hyperstack::I18n::VERSION spec.add_development_dependency 'hyper-spec', Hyperstack::I18n::VERSION spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0.0' + spec.add_development_dependency 'opal-rails' spec.add_development_dependency 'pry' spec.add_development_dependency 'puma', '<= 5.4.0' spec.add_development_dependency 'rake', '~> 10.0' diff --git a/ruby/hyper-model/hyper-model.gemspec b/ruby/hyper-model/hyper-model.gemspec index 0fb086592..e20545e48 100644 --- a/ruby/hyper-model/hyper-model.gemspec +++ b/ruby/hyper-model/hyper-model.gemspec @@ -32,7 +32,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-trace', HyperModel::VERSION spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'pg' - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyper-model/spec/test_app/app/assets/config/manifest.js b/ruby/hyper-model/spec/test_app/app/assets/config/manifest.js new file mode 100644 index 000000000..9c361e667 --- /dev/null +++ b/ruby/hyper-model/spec/test_app/app/assets/config/manifest.js @@ -0,0 +1,2 @@ + //= link_directory ../javascripts .js + //= link_directory ../stylesheets .css \ No newline at end of file diff --git a/ruby/hyper-model/spec/test_app/db/schema.rb b/ruby/hyper-model/spec/test_app/db/schema.rb deleted file mode 100644 index 82639473f..000000000 --- a/ruby/hyper-model/spec/test_app/db/schema.rb +++ /dev/null @@ -1,122 +0,0 @@ -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# This file is the source Rails uses to define your schema when running `rails -# db:schema:load`. When creating a new database, `rails db:schema:load` tends to -# be faster and is potentially less error prone than running all of your -# migrations from scratch. Old migrations may fail to apply correctly if those -# migrations use external dependencies or application code. -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 2021_02_28_200459) do - - # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" - - create_table "addresses", force: :cascade do |t| - t.string "street" - t.string "city" - t.string "state" - t.string "zip" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "bones", force: :cascade do |t| - t.integer "dog_id" - end - - create_table "child_models", force: :cascade do |t| - t.string "child_attribute" - t.bigint "test_model_id" - t.index ["test_model_id"], name: "index_child_models_on_test_model_id" - end - - create_table "comments", force: :cascade do |t| - t.text "comment" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.bigint "todo_id" - t.bigint "author_id" - t.integer "user_id" - t.integer "todo_item_id" - t.index ["author_id"], name: "index_comments_on_author_id" - t.index ["todo_id"], name: "index_comments_on_todo_id" - end - - create_table "hyperstack_connections", force: :cascade do |t| - t.string "channel" - t.string "session" - t.datetime "created_at" - t.datetime "expires_at" - t.datetime "refresh_at" - end - - create_table "hyperstack_queued_messages", force: :cascade do |t| - t.text "data" - t.integer "connection_id" - end - - create_table "pets", force: :cascade do |t| - t.integer "owner_id" - end - - create_table "scratching_posts", force: :cascade do |t| - t.integer "cat_id" - end - - create_table "test_models", force: :cascade do |t| - t.string "test_attribute" - t.boolean "completed" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - create_table "todo_items", force: :cascade do |t| - t.string "title" - t.text "description" - t.boolean "complete" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "user_id" - t.integer "comment_id" - end - - create_table "todos", force: :cascade do |t| - t.string "title" - t.text "description" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "completed", default: false, null: false - t.bigint "created_by_id" - t.bigint "owner_id" - t.index ["created_by_id"], name: "index_todos_on_created_by_id" - t.index ["owner_id"], name: "index_todos_on_owner_id" - end - - create_table "users", force: :cascade do |t| - t.string "role" - t.bigint "manager_id" - t.string "first_name" - t.string "last_name" - t.string "email" - t.datetime "created_at" - t.datetime "updated_at" - t.string "address_street" - t.string "address_city" - t.string "address_state" - t.string "address_zip" - t.integer "address_id" - t.string "address2_street" - t.string "address2_city" - t.string "address2_state" - t.string "address2_zip" - t.string "data_string" - t.integer "data_times" - t.integer "test_enum" - t.index ["manager_id"], name: "index_users_on_manager_id" - end - -end diff --git a/ruby/hyper-operation/hyper-operation.gemspec b/ruby/hyper-operation/hyper-operation.gemspec index 773db7ab8..98358a6d8 100644 --- a/ruby/hyper-operation/hyper-operation.gemspec +++ b/ruby/hyper-operation/hyper-operation.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-spec', Hyperstack::Operation::VERSION spec.add_development_dependency 'mysql2' # spec.add_development_dependency 'opal-browser', '~> 0.2.0' - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyper-operation/spec/test_app/app/assets/config/manifest.js b/ruby/hyper-operation/spec/test_app/app/assets/config/manifest.js new file mode 100644 index 000000000..9c361e667 --- /dev/null +++ b/ruby/hyper-operation/spec/test_app/app/assets/config/manifest.js @@ -0,0 +1,2 @@ + //= link_directory ../javascripts .js + //= link_directory ../stylesheets .css \ No newline at end of file diff --git a/ruby/hyper-router/hyper-router.gemspec b/ruby/hyper-router/hyper-router.gemspec index 638e801a5..c6d186d38 100644 --- a/ruby/hyper-router/hyper-router.gemspec +++ b/ruby/hyper-router/hyper-router.gemspec @@ -24,7 +24,8 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'hyper-store', HyperRouter::VERSION spec.add_development_dependency 'listen' spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0.0' + spec.add_development_dependency 'opal-rails' + spec.add_development_dependency 'opal-jquery' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyper-router/spec/test_app/app/assets/config/manifest.js b/ruby/hyper-router/spec/test_app/app/assets/config/manifest.js new file mode 100644 index 000000000..92bfa3059 --- /dev/null +++ b/ruby/hyper-router/spec/test_app/app/assets/config/manifest.js @@ -0,0 +1,3 @@ + //= link_tree ../images + //= link_directory ../javascripts .js + //= link_directory ../stylesheets .css \ No newline at end of file diff --git a/ruby/hyper-spec/lib/hyper-spec/component_test_helpers working.rbx b/ruby/hyper-spec/lib/hyper-spec/component_test_helpers working.rbx new file mode 100644 index 000000000..f41fbe740 --- /dev/null +++ b/ruby/hyper-spec/lib/hyper-spec/component_test_helpers working.rbx @@ -0,0 +1,365 @@ +# see component_test_helpers_spec.rb for examples +require 'parser/current' +require 'unparser' +require 'hyper-spec/unparser_patch' +require 'method_source' +require_relative '../../lib/hyper-spec/time_cop.rb' + +Parser::Builders::Default.emit_procarg0 = true + +module HyperSpec + module ComponentTestHelpers + TOP_LEVEL_COMPONENT_PATCH = + Opal.compile(File.read(File.expand_path('../../sources/top_level_rails_component.rb', __FILE__))) + TIME_COP_CLIENT_PATCH = + Opal.compile(File.read(File.expand_path('../../hyper-spec/time_cop.rb', __FILE__))) + + "\n#{File.read(File.expand_path('../../sources/lolex.js', __FILE__))}" + + class << self + attr_accessor :current_example + attr_accessor :description_displayed + + def display_example_description + "" + end + end + + def build_test_url_for(controller) + unless controller + unless defined?(::HyperstackTestController) + Object.const_set('HyperstackTestController', Class.new(::ActionController::Base)) + end + + controller = ::HyperstackTestController + end + + route_root = controller.name.gsub(/Controller$/, '').underscore + + unless controller.method_defined?(:test) + controller.class_eval do + define_method(:test) do + route_root = self.class.name.gsub(/Controller$/, '').underscore + test_params = ::Rails.cache.read("/#{route_root}/#{params[:id]}") + @component_name = test_params[0] + @component_params = test_params[1] + render_params = test_params[2] + render_on = render_params.delete(:render_on) || :client_only + _mock_time = render_params.delete(:mock_time) + style_sheet = render_params.delete(:style_sheet) + javascript = render_params.delete(:javascript) + code = render_params.delete(:code) + + page = '<%= react_component @component_name, @component_params, '\ + "{ prerender: #{render_on != :client_only} } %>" + unless render_on == :server_only + page = "\n#{page}" + page = "\n#{page}" if code + end + + if render_on != :server_only || Lolex.initialized? + page = "\n#{page}" + end + + if (render_on != :server_only && !render_params[:layout]) || javascript + page = "<%= javascript_include_tag '#{javascript || 'application'}' %>\n#{page}" + end + + if !render_params[:layout] || style_sheet + page = "<%= stylesheet_link_tag '#{style_sheet || 'application'}' %>\n#{page}" + end + page = "\n#{page}" + + title = view_context.escape_javascript(ComponentTestHelpers.current_example.description) + title = "#{title}...continued." if ComponentTestHelpers.description_displayed + + page = "\n#{page}" + + ComponentTestHelpers.description_displayed = true + render_params[:inline] = page + render render_params + end + end + + begin + routes = ::Rails.application.routes + routes.disable_clear_and_finalize = true + routes.clear! + routes.draw do + get "/#{route_root}/:id", to: "#{route_root}#test" + end + ::Rails.application.routes_reloader.paths.each { |path| load(path) } + routes.finalize! + ActiveSupport.on_load(:action_controller) { routes.finalize! } + ensure + routes.disable_clear_and_finalize = false + end + end + + "/#{route_root}/#{@test_id = (@test_id || 0) + 1}" + end + + def isomorphic(&block) + yield + on_client(&block) + end + + def evaluate_ruby(str = '', opts = {}, &block) + insure_mount + if block + str = "#{str}\n#{Unparser.unparse Parser::CurrentRuby.parse(block.source).children.last}" + end + js = Opal.compile(str).gsub("// Prepare super implicit arguments\n", "") + .delete("\n").gsub('(Opal);', '(Opal)') + # workaround for firefox 58 and geckodriver 0.19.1, because firefox is unable to find .$to_json: + # JSON.parse(evaluate_script("(function(){var a=Opal.Array.$new(); a[0]=#{js}; return a.$to_json();})();"), opts).first + JSON.parse(evaluate_script("[#{js}].$to_json()"), opts).first + end + + def expect_evaluate_ruby(str = '', opts = {}, &block) + insure_mount + expect(evaluate_ruby(add_opal_block(str, block), opts)) + end + + def add_opal_block(str, block) + # big assumption here is that we are going to follow this with a .to + # hence .children.first followed by .children.last + # probably should do some kind of "search" to make this work nicely + return str unless block + "#{str}\n"\ + "#{Unparser.unparse Parser::CurrentRuby.parse(block.source).children.first.children.last}" + end + + def evaluate_promise(str = '', opts = {}, &block) + insure_mount + str = "#{str}\n#{Unparser.unparse Parser::CurrentRuby.parse(block.source).children.last}" if block + str = "#{str}.then { |args| args = [args]; `window.hyper_spec_promise_result = args` }" + js = Opal.compile(str).gsub("\n","").gsub("(Opal);","(Opal)") + page.evaluate_script("window.hyper_spec_promise_result = false") + page.execute_script(js) + Timeout.timeout(Capybara.default_max_wait_time) do + loop do + sleep 0.25 + break if page.evaluate_script("!!window.hyper_spec_promise_result") + end + end + JSON.parse(page.evaluate_script("window.hyper_spec_promise_result.$to_json()"), opts).first + end + + def expect_promise(str = '', opts = {}, &block) + insure_mount + expect(evaluate_promise(add_opal_block(str, block), opts)) + end + + def ppr(str) + js = Opal.compile(str).delete("\n").gsub('(Opal);', '(Opal)') + execute_script("console.log(#{js})") + end + + def on_client(&block) + @client_code = + "#{@client_code}#{Unparser.unparse Parser::CurrentRuby.parse(block.source).children.last}\n" + end + + def debugger + `debugger` + nil + end + + def insure_mount + # rescue in case page is not defined... + mount unless page.instance_variable_get('@hyper_spec_mounted') + end + + def client_option(opts = {}) + @client_options ||= {} + @client_options.merge! opts + end + + alias client_options client_option + + def mount(component_name = nil, params = nil, opts = {}, &block) + unless params + params = opts + opts = {} + end + + opts = client_options opts + test_url = build_test_url_for(opts.delete(:controller)) + + if block || @client_code || component_name.nil? + block_with_helpers = <<-code + module ComponentHelpers + def self.js_eval(s) + `eval(s)` + end + def self.dasherize(s) + res = %x{ + s.replace(/[-_\\s]+/g, '-') + .replace(/([A-Z\\d]+)([A-Z][a-z])/g, '$1-$2') + .replace(/([a-z\\d])([A-Z])/g, '$1-$2') + .toLowerCase() + } + res + end + def self.add_class(class_name, styles={}) + style = styles.collect { |attr, value| "\#{dasherize(attr)}:\#{value}" }.join("; ") + cs = class_name.to_s + %x{ + var style_el = document.createElement("style"); + var css = "." + cs + " { " + style + " }"; + style_el.type = "text/css"; + if (style_el.styleSheet){ + style_el.styleSheet.cssText = css; + } else { + style_el.appendChild(document.createTextNode(css)); + } + document.head.appendChild(style_el); + } + end + end + class Hyperstack::Internal::Component::TestDummy + include Hyperstack::Component + render {} + end + #{@client_code} + #{Unparser.unparse(Parser::CurrentRuby.parse(block.source).children.last) if block} + code + opts[:code] = Opal.compile(block_with_helpers) + end + + component_name ||= 'Hyperstack::Internal::Component::TestDummy' + ::Rails.cache.write(test_url, [component_name, params, opts]) + test_code_key = "hyper_spec_prerender_test_code.js" + @@original_server_render_files ||= ::Rails.configuration.react.server_renderer_options[:files] + if opts[:render_on] == :both || opts[:render_on] == :server_only + unless opts[:code].blank? + ::Rails.cache.write(test_code_key, opts[:code]) + ::Rails.configuration.react.server_renderer_options[:files] = @@original_server_render_files + [test_code_key] + ::React::ServerRendering.reset_pool # make sure contexts are reloaded so they dont use code from cache, as the rails filewatcher doesnt look for cache changes + else + ::Rails.cache.delete(test_code_key) + ::Rails.configuration.react.server_renderer_options[:files] = @@original_server_render_files + ::React::ServerRendering.reset_pool # make sure contexts are reloaded so they dont use code from cache, as the rails filewatcher doesnt look for cache changes + end + end + visit test_url + wait_for_ajax unless opts[:no_wait] + page.instance_variable_set('@hyper_spec_mounted', true) + Lolex.init(self, client_options[:time_zone], client_options[:clock_resolution]) + end + + [:callback_history_for, :last_callback_for, :clear_callback_history_for, + :event_history_for, :last_event_for, :clear_event_history_for].each do |method| + define_method(method) do |event_name| + evaluate_ruby("Hyperstack::Internal::Component::TopLevelRailsComponent.#{method}('#{event_name}')") + end + end + + def run_on_client(&block) + script = Opal.compile(Unparser.unparse(Parser::CurrentRuby.parse(block.source).children.last)) + execute_script(script) + end + + def add_class(class_name, style) + @client_code = "#{@client_code}ComponentHelpers.add_class('#{class_name}', #{style})\n" + end + + def open_in_chrome + if false && ['linux', 'freebsd'].include?(`uname`.downcase) + `google-chrome http://#{page.server.host}:#{page.server.port}#{page.current_path}` + else + `open http://#{page.server.host}:#{page.server.port}#{page.current_path}` + end + + while true + sleep 1.hour + end + end + + def pause(message = nil) + if message + puts message + page.evaluate_script "console.log('#{message} (type go() to continue)')" + end + + page.evaluate_script('window.hyper_spec_waiting_for_go = true') + page.evaluate_script('go = function() {window.hyper_spec_waiting_for_go = false}') + loop do + sleep 0.25 + break unless page.evaluate_script('window.hyper_spec_waiting_for_go') + end + end + + def wait_for_size(width, height) + start_time = Capybara::Helpers.monotonic_time + stable_count_w = 0 + stable_count_h = 0 + prev_size = [0, 0] + begin + sleep 0.05 + curr_size = Capybara.current_session.current_window.size + return if [width, height] == curr_size + # some maximum or minimum is reached and size doesnt change anymore + stable_count_w += 1 if prev_size[0] == curr_size[0] + stable_count_h += 1 if prev_size[1] == curr_size[1] + return if stable_count_w > 2 || stable_count_h > 2 + prev_size = curr_size + end while (Capybara::Helpers.monotonic_time - start_time) < Capybara.current_session.config.default_max_wait_time + raise Capybara::WindowError, "Window size not stable within #{Capybara.current_session.config.default_max_wait_time} seconds." + end + + def size_window(width = nil, height = nil) + # return if @window_cannot_be_resized + # original_width = evaluate_script('window.innerWidth') + # original_height = evaluate_script('window.innerHeight') + width, height = [height, width] if width == :portrait + width, height = width if width.is_a? Array + portrait = true if height == :portrait + + case width + when :small + width, height = [480, 320] + when :mobile + width, height = [640, 480] + when :tablet + width, height = [960, 640] + when :large + width, height = [1920, 6000] + when :default, nil + width, height = [1024, 768] + end + + width, height = [height, width] if portrait + + unless RSpec.configuration.debugger_width + Capybara.current_session.current_window.resize_to(1000, 500) + wait_for_size(1000, 500) + inner_width = evaluate_script('window.innerWidth') + RSpec.configuration.debugger_width = 1000 - inner_width + end + Capybara.current_session.current_window + .resize_to(width + RSpec.configuration.debugger_width, height) + wait_for_size(width + RSpec.configuration.debugger_width, height) + end + end + + RSpec.configure do |config| + config.before(:each) do |example| + ComponentTestHelpers.current_example = example + ComponentTestHelpers.description_displayed = false + end + + if defined?(ActiveRecord) + config.before(:all) do + ActiveRecord::Base.class_eval do + def attributes_on_client(page) + page.evaluate_ruby("#{self.class.name}.find(#{id}).attributes", symbolize_names: true) + end + end + end + end + end +end diff --git a/ruby/hyper-state/hyper-state.gemspec b/ruby/hyper-state/hyper-state.gemspec index c1e0802c0..1917a787a 100644 --- a/ruby/hyper-state/hyper-state.gemspec +++ b/ruby/hyper-state/hyper-state.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'listen' # spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency, '~> 0.2.4' # spec.add_development_dependency 'opal-browser', '~> 0.2.0' - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyper-store/hyper-store.gemspec b/ruby/hyper-store/hyper-store.gemspec index fbdfa72e3..7fb885a73 100644 --- a/ruby/hyper-store/hyper-store.gemspec +++ b/ruby/hyper-store/hyper-store.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'listen' # spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency, '~> 0.2.6' spec.add_development_dependency 'opal-browser', '~> 0.2.0' - spec.add_development_dependency 'opal-rails', '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyperstack-config/spec/test_app/app/assets/config/manifest.js b/ruby/hyperstack-config/spec/test_app/app/assets/config/manifest.js new file mode 100644 index 000000000..6f71952ea --- /dev/null +++ b/ruby/hyperstack-config/spec/test_app/app/assets/config/manifest.js @@ -0,0 +1 @@ + //= link_directory ../javascripts .js From 256feb05898a72a1abc34f738a355014d86f8a66 Mon Sep 17 00:00:00 2001 From: catmando Date: Thu, 4 May 2023 18:13:53 -0400 Subject: [PATCH 45/49] turned on first batch of tests back on --- .travis.yml | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e8c4a02e..113998892 100644 --- a/.travis.yml +++ b/.travis.yml @@ -127,30 +127,30 @@ jobs: include: - <<: *_test_gem env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 - # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db - # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db - # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 # - <<: *_test_gem # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' From 6f7ff47da70d9f05e3f9d6dd3a91f8ec2dcf0165 Mon Sep 17 00:00:00 2001 From: catmando Date: Fri, 5 May 2023 11:28:54 -0400 Subject: [PATCH 46/49] fixed spec for hyper-component and rails 6.1 --- .travis.yml | 27 +++++++++++++++++++ ruby/hyper-component/hyper-component.gemspec | 2 +- .../spec/test_app/config/application.rb | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 113998892..e839c6349 100644 --- a/.travis.yml +++ b/.travis.yml @@ -179,6 +179,33 @@ jobs: # - <<: *_test_gem # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + - <<: *_test_gem + env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part1 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part2 DB=hyper_mesh_test_db + - <<: *_test_gem_pg + env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part3 DB=hyper_mesh_test_db + - <<: *_test_gem + env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + # - <<: *_test_gem # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' # - <<: *_test_gem diff --git a/ruby/hyper-component/hyper-component.gemspec b/ruby/hyper-component/hyper-component.gemspec index cd29a4f2d..9c1c773c4 100644 --- a/ruby/hyper-component/hyper-component.gemspec +++ b/ruby/hyper-component/hyper-component.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'mini_racer', '< 0.4.0' # something is busted with 0.4.0 and its libv8-node dependency spec.add_development_dependency 'nokogiri' spec.add_development_dependency 'opal-jquery' - spec.add_development_dependency 'opal-rails' , '>= 0.9.4', '< 2.0' + spec.add_development_dependency 'opal-rails' spec.add_development_dependency 'pry-rescue' spec.add_development_dependency 'pry-stack_explorer' spec.add_development_dependency 'puma', '<= 5.4.0' diff --git a/ruby/hyper-component/spec/test_app/config/application.rb b/ruby/hyper-component/spec/test_app/config/application.rb index 383ddfaec..1b198059e 100644 --- a/ruby/hyper-component/spec/test_app/config/application.rb +++ b/ruby/hyper-component/spec/test_app/config/application.rb @@ -5,7 +5,7 @@ # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups(assets: %w(development test))) -# require 'jquery-rails' +require 'jquery-rails' # require 'opal' # require 'opal-jquery' # require 'opal-browser' From e118e8c0a3be24ceded83c75f6c659923f34124c Mon Sep 17 00:00:00 2001 From: catmando Date: Mon, 8 May 2023 13:42:45 -0400 Subject: [PATCH 47/49] now working with zeitwerk loader --- .../hyperstack/server_side_auto_require.rb | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb b/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb index 3d382eeaa..ee500361c 100644 --- a/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb +++ b/ruby/rails-hyperstack/lib/hyperstack/server_side_auto_require.rb @@ -1,4 +1,17 @@ -Rails.configuration.autoloader = :classic #:zeitwerk +# require "hyperstack/server_side_auto_require.rb" in your hyperstack initializer +# to autoload shadowed server side files that match files +# in the hyperstack directory + +if Rails.configuration.try(:autoloader) == :zeitwerk + Rails.autoloaders.each do |loader| + loader.on_load do |_cpath, _value, abspath| + ActiveSupport::Dependencies.add_server_side_dependency(abspath) do |load_path| + loader.send(:log, "Hyperstack loading server side shadowed file: #{load_path}") if loader&.logger + require("#{load_path}.rb") + end + end + end +end module ActiveSupport module Dependencies @@ -11,7 +24,7 @@ class << self # and add that as a dependency def require_or_load(file_name, const_path = nil) - add_server_side_dependency(file_name) + add_server_side_dependency(file_name) { |load_path| require_dependency load_path } original_require_or_load(file_name, const_path) end @@ -20,7 +33,7 @@ def require_or_load(file_name, const_path = nil) # the filename, and if a ruby file exists at that location then # add it as a dependency - def add_server_side_dependency(file_name) + def add_server_side_dependency(file_name, loader = nil) path = File.expand_path(file_name.chomp(".rb")) .split(File::SEPARATOR).reverse hs_index = path.find_index(HYPERSTACK_DIR) @@ -32,7 +45,7 @@ def add_server_side_dependency(file_name) return unless File.exist? "#{load_path}.rb" - require_dependency load_path + yield load_path end end end From 687582d6a1395065b1647e2a66d78bd68062369d Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 16 May 2023 14:28:58 -0400 Subject: [PATCH 48/49] trying to get travis working again --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index e839c6349..90250a8f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,6 +88,13 @@ _test_gem: &_test_gem before_install: - echo installing $COMPONENT + - sudo apt-get remove --purge mysql-server mysql-client mysql-common + - sudo apt-get autoremove + - sudo apt-get autoclean + - sudo rm -rf /var/lib/mysql + - sudo rm -rf /etc/mysql + - sudo apt install mariadb-server mariadb-client -y + # yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package # must remove this zombie for new yarn to work - sudo rm -f /usr/local/bin/yarn From 52a06b26d3ab81520bd9c5667367e880dbe90e99 Mon Sep 17 00:00:00 2001 From: catmando Date: Tue, 16 May 2023 14:44:56 -0400 Subject: [PATCH 49/49] trying to get travis working round 2 --- .travis.yml | 205 ++++++++++++++++++++++++++-------------------------- 1 file changed, 103 insertions(+), 102 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90250a8f7..fc3867f3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,6 +94,7 @@ _test_gem: &_test_gem - sudo rm -rf /var/lib/mysql - sudo rm -rf /etc/mysql - sudo apt install mariadb-server mariadb-client -y + - sudo apt-get install libmysqlclient-dev # yarn is in /usr/local/bin/yarn version 1.3.2 and is not a package # must remove this zombie for new yarn to work @@ -132,133 +133,133 @@ _deploy_gem: &_deploy_gem jobs: include: - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 - - # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 + - <<: *_test_gem + env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part1 DB=hyper_mesh_test_db # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part2 DB=hyper_mesh_test_db # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 TASK=part3 DB=hyper_mesh_test_db # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 - - <<: *_test_gem - env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem - env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part1 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part2 DB=hyper_mesh_test_db - - <<: *_test_gem_pg - env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part3 DB=hyper_mesh_test_db - - <<: *_test_gem - env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + # # - <<: *_test_gem + # # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' + # # - <<: *_test_gem_pg + # # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # # - <<: *_test_gem_pg + # # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # # - <<: *_test_gem_pg + # # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # # - <<: *_test_gem + # # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 OPAL_VERSION='~>0.11' RAILS_VERSION='~>5.0' # - <<: *_test_gem - # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem - # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part1 DB=hyper_mesh_test_db # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part2 DB=hyper_mesh_test_db # - <<: *_test_gem_pg - # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' TASK=part3 DB=hyper_mesh_test_db # - <<: *_test_gem - # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>6.0.0' + + # # - <<: *_test_gem + # # env: COMPONENT=rails-hyperstack RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-spec RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-trace RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyperstack-config RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-state RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-component RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-router RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-store RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem + # # env: COMPONENT=hyper-operation RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' + # # - <<: *_test_gem_pg + # # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part1 DB=hyper_mesh_test_db + # # - <<: *_test_gem_pg + # # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part2 DB=hyper_mesh_test_db + # # - <<: *_test_gem_pg + # # env: COMPONENT=hyper-model RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' TASK=part3 DB=hyper_mesh_test_db + # # - <<: *_test_gem + # # env: COMPONENT=hyper-i18n RUBY_VERSION=2.5.1 RAILS_VERSION='~>5.0' - # - <<: *_deploy_gem - # env: COMPONENT=hyper-i18n - # - <<: *_deploy_gem - # env: COMPONENT=hyper-trace - # - <<: *_deploy_gem - # env: COMPONENT=hyper-state - # - <<: *_deploy_gem - # env: COMPONENT=hyper-component - # - <<: *_deploy_gem - # env: COMPONENT=hyper-model - # - <<: *_deploy_gem - # env: COMPONENT=hyper-operation - # - <<: *_deploy_gem - # env: COMPONENT=hyper-router - # - <<: *_deploy_gem - # env: COMPONENT=hyper-spec - # - <<: *_deploy_gem - # env: COMPONENT=hyper-store - # - <<: *_deploy_gem - # env: COMPONENT=rails-hyperstack - # - <<: *_deploy_gem - # env: COMPONENT=hyperstack-config + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-i18n + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-trace + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-state + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-component + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-model + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-operation + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-router + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-spec + # # - <<: *_deploy_gem + # # env: COMPONENT=hyper-store + # # - <<: *_deploy_gem + # # env: COMPONENT=rails-hyperstack + # # - <<: *_deploy_gem + # # env: COMPONENT=hyperstack-config