-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
playing around with a component that has no Rails/AV dependency
- Loading branch information
1 parent
1f93769
commit af02ed5
Showing
3 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
class PerfTest::FastComponent # < Rbexy::Component | ||
# include ActionView::Context | ||
# TEMPLATE = "@output_buffer.safe_concat('<h1>Hello component</h1>'.freeze);@output_buffer.to_s;".freeze | ||
|
||
def initialize(view_context) | ||
# @compiled = Rbexy.compile(Rbexy::Template.new("<h1>Hello component</h1>")) | ||
# @runtime = Rbexy::Runtime.new | ||
@output_buffer = ActionView::OutputBuffer.new | ||
# @output_buffer = view_context.instance_variable_get(:@output_buffer) | ||
end | ||
|
||
def render_in | ||
# @runtime.evaluate(@compiled) | ||
# @compiled | ||
# instance_eval(TEMPLATE) | ||
template | ||
# instance_eval(@compiled) | ||
# "<h1>Hello component</h1>" | ||
# tag.h2 "Hello component" | ||
end | ||
|
||
def template | ||
@output_buffer.safe_concat('<h1>Hello component</h1>'.freeze);@output_buffer.to_s; | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters