Closed meh closed 4 years ago
The most important feature is Element
with $document.[]
method. Next one is events. All onclicks, keypresses etc. related to DOM.
Never used a builder that require paggio, so this one should be moved to separate module that is not required by default.
Otherwise this once I use frequently:
Agree with last comment that Builder and Paggio should be separate.
Not currently using canvas, screen, css, database or event classes (directly).
Most used of course is document and node/element.
For me too it's desirable to be able to leave out the DOM and CSSM DSLs, and maybe also make the events cherry-pickable, likely making them register themselves:
module Browser; class Event
class BeforeUnload < Event
handle :beforeunload
def self.supported?
Browser.supports? 'Event.BeforeUnload'
end
if Browser.supports? 'Event.constructor'
def self.construct(name, desc)
`new BeforeUnloadEvent(#{name}, #{desc})`
end
end if supported?
end
end; end
and
def self.class_for(name)
handlers[name] || Custom
end
I think I did something about the issue. I did what @elia suggested and I made 4 possible require paths.
[user@localhost opal-browser]# opal -O -I ./opal --gem paggio --compile opal/browser.rb | wc -c
1351620
[user@localhost opal-browser]# opal -O -I ./opal --compile opal/browser/setup/large.rb | wc -c
1115893
[user@localhost opal-browser]# opal -O -I ./opal --compile opal/browser/setup/mini.rb | wc -c
651352
[user@localhost opal-browser]# opal -O -I ./opal --compile opal/browser/setup/base.rb | wc -c
82138
[user@localhost opal-browser]#
"browser" is a traditional require path. It required what is required currently. "browser/setup/mini" doesn't include extraneous events, paggio (and native) "browser/setup/large" does what mini does, BUT it does require:
Since everyone wants a more cherry-pickable opal-browser, and so do I, can we get some discussion going on how granular the cherry-picking should be?
Which parts of opal-browser are you using and which parts are getting included that you don't care about?