Hi all,
I'm putting up a 2.3a snapshot for evaluation at http://beta4.com/seaside2/downloads/Seaside2-3a.st. I made a number of fairly large changes recently, and I've been feeling antsy that they're only available to the (non-existant?) minority of users that track CVS. This code isn't totally complete, but please do try it out.
The changes include:
- HtmlRenderer now builds a DOM tree rather than directly printing HTML to a stream. This provides a greater amount of flexibility in various places, without (surprisingly) seeming to impact performance. A more minor change (stolen from Cees) is the ability to use either strings of blocks pretty much anywhere, ie,
html bold: 'foo'. html bold: [html text: 'foo'].
- The StateHolder mechanism has been generalized so that any object can be registered to have the values of its instance variables backtracked. For example, in WABrowser>>model:, you'll see
self session registerObjectForBacktracking: model.
This means that the state of the Browser instance will be snapshotted each time it changes, and using the back button in the web-based browser will have correct behavior.
Component classes that previously used StateHolders for all (or most) of their instance variables can now simply register themselves for backtracking at #initialize time.
Yes, this can eat memory quickly if abused. A "profile memory" link has been added to the toolbar to keep tabs on this.
- The fairly complex Container model has been replaced with a much simpler notion of delegated components. Each component has a 'delegate' StateHolder. When a component is asked to #call: another component, it stores that component as its delegate. When the #call: returns, 'delegate' will be cleared. When asked to render itself, a component with an active delegate will forward the render request to the delegate. This means that a component will appear to be replaced, in place, by whichever component it calls. This behavior is roughly equivalent to having each child component created with #containerFor: in 2.2.
The "inspect" link now presents a view of the current component tree, showing delegation, so that you can pick which component you want to inspect. This can be useful for understanding the new model.
- The codebase has been massively restructured and more cleanly layered. Some semi-coherent notes: The "Base" layer consists of Request, Response, and a completely new URL handling mechanism, the WARegistry. This knows nothing about Sessions, but flexibly manages request handlers that map either to static urls or to unique, generated keys. If a unique key exists in the url but there is no active handler for it, the registry will fall back to the closest static handler. The "Session" layer adds continuations and state backtracking. It knows nothing about Components. The "Component" layer includes the delegation and embedding model. For now, it largely shields user code from the changes to the other layers (#registerAsApplication: still works, for example). It also includes all the development and configuration tools. The "Rendering" layer is mostly orthogonal to all of this; it provides the callback scheme and HtmlRenderer.
Known issues:
- The Wiki example is currently broken. - The new HtmlRenderer does not yet support pretty-printing. - Usage patterns for Application, Session, and Registry have to be more fully worked out (where does the current notion of preferences go? Is it still appropiate to subclass Session? etc).
A couple of days ago I rebuilt my development image from scratch, and installed Seaside 2.3 instead of 2.21. Within a few more days I expect to have my wife's site (http://www.bountifulbaby.com) entirely converted to Seaside 2.3. A few days before before working with 2.3, I had started the conversion of the site to Seaside 2.21, but fell into old web habits that were not optimal for Seaside, and didn't exploit Seaside as it should. So, I started over, but with 2.3 this time. Here are a few quick notes on what I found:
1. Seaside 2.3 seems to be quite stable.
2. Not surprisingly, some of the API has changed (I suppose in any upgrade this is to be expected). However, due to my own lack of understanding of the Seaside internals, it wasn't immediately apparant what the equivalent 2.3 functionality was. Over the last few days, you can find a number of my posts to this list that illustrate.
3. I find that the simple enhancement of being able to do html bold: 'foo' instead of: html bold: [html text: 'foo'] to be extremely useful. This one enhancement alone makes the switch from 2.21 to 2.3 worth it.
4. The lack of a pretty-printer for the html builder is annoying. To me, this is probably the single biggest downside of moving from 2.21 to 2.3.
5. The way that 2.3 builds a DOM tree rather than directly printing HTML is intriguing. However, from my perspective (building the bountifulbaby.com site), it really doesn't seem to change anything. No apparant advantages, nor apparant disadvantages. From the perspective of my #render... methods, everything seems to be working the same (other than the enhancement stated in #3, above). But, realizing that there is a DOM tree behind the scenes garners a vague suspicion that there ought to be ways to exploit the DOM tree that I haven't thought of yet, and that using a DOM tree is potentially a huge win. I just don't know where the win is, though.
6. Many of the old examples are either completely broken, or partially broken. This will make it harder for new folks to start with 2.3 than if they started with 2.21. For me, this is a downside of 2.3, but a smaller downside than the lack of html pretty-printer is.
7. As I think about how Seaside works, I have a vague suspicion that Seaside is not really suitable for high-volume sites. However, as I say this, let me also add that I think many folks/companies are overly concerned about performance. In my case, my pipe to the internet is *by far* the biggest bottleneck, and I suspect that is true of most other folks/companies. And in any case, I also suspect that Seaside produces a better performing web site than most Java-driven sites have (Java servlets and various Java frameworks-- like Struts, for example-- are not that particularly performant). But, Seaside definitely has a higher back-end overhead than stateless (Smalltalk-driven) approaches have (such as raw Comanche modules, etc.).
8. Most of the bountifulbaby.com site right now is static pages. Seaside produces *no* benefits at all for a purely static web site. Indeed, it even has a rather large downside for purely static sites, by not easily allowing "roundtripping" of page creation from, say, Dreamweaver, to Seaside, and back. And, no, CSS doesn't seem to cut it as a complete designers tool, so losing the "roundtripping" is a huge loss for static-only sites. However, the more dynamic the site, the more advantages Seaside yields. For a completely dynamic site, I think Seaside is unparalleled in it's excellence.
Overall, I am very satisfied with 2.3, and wish to congratulate the Seaside folks for their very fine work, and their very fine help on this list. And, like I mentioned above, there should soon be another public Seaside-driven web site online (at http://www.bountifulbaby.com).
Thanks,
Nevin
Avi Bryant wrote:
Hi all,
I'm putting up a 2.3a snapshot for evaluation at http://beta4.com/seaside2/downloads/Seaside2-3a.st. I made a number of fairly large changes recently, and I've been feeling antsy that they're only available to the (non-existant?) minority of users that track CVS. This code isn't totally complete, but please do try it out.
The changes include:
- HtmlRenderer now builds a DOM tree rather than directly printing HTML to
a stream. This provides a greater amount of flexibility in various places, without (surprisingly) seeming to impact performance. A more minor change (stolen from Cees) is the ability to use either strings of blocks pretty much anywhere, ie,
html bold: 'foo'. html bold: [html text: 'foo'].
- The StateHolder mechanism has been generalized so that any object can be
registered to have the values of its instance variables backtracked. For example, in WABrowser>>model:, you'll see
self session registerObjectForBacktracking: model.
This means that the state of the Browser instance will be snapshotted each time it changes, and using the back button in the web-based browser will have correct behavior.
Component classes that previously used StateHolders for all (or most) of their instance variables can now simply register themselves for backtracking at #initialize time.
Yes, this can eat memory quickly if abused. A "profile memory" link has been added to the toolbar to keep tabs on this.
- The fairly complex Container model has been replaced with a much simpler
notion of delegated components. Each component has a 'delegate' StateHolder. When a component is asked to #call: another component, it stores that component as its delegate. When the #call: returns, 'delegate' will be cleared. When asked to render itself, a component with an active delegate will forward the render request to the delegate. This means that a component will appear to be replaced, in place, by whichever component it calls. This behavior is roughly equivalent to having each child component created with #containerFor: in 2.2.
The "inspect" link now presents a view of the current component tree, showing delegation, so that you can pick which component you want to inspect. This can be useful for understanding the new model.
- The codebase has been massively restructured and more cleanly layered.
Some semi-coherent notes: The "Base" layer consists of Request, Response, and a completely new URL handling mechanism, the WARegistry. This knows nothing about Sessions, but flexibly manages request handlers that map either to static urls or to unique, generated keys. If a unique key exists in the url but there is no active handler for it, the registry will fall back to the closest static handler. The "Session" layer adds continuations and state backtracking. It knows nothing about Components. The "Component" layer includes the delegation and embedding model. For now, it largely shields user code from the changes to the other layers (#registerAsApplication: still works, for example). It also includes all the development and configuration tools. The "Rendering" layer is mostly orthogonal to all of this; it provides the callback scheme and HtmlRenderer.
Known issues:
- The Wiki example is currently broken.
- The new HtmlRenderer does not yet support pretty-printing.
- Usage patterns for Application, Session, and Registry have to be more
fully worked out (where does the current notion of preferences go? Is it still appropiate to subclass Session? etc).
Seaside mailing list Seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/seaside
Nevin,
Many thanks for taking the time to write up these comments.
On Thu, 27 Mar 2003, Nevin Pratt wrote:
- Seaside 2.3 seems to be quite stable.
I've just had a report of some problems with interactions with the debugger in 2.3, so it's definitely not 100% stable yet. But good to know that you didn't run into any issues.
- Not surprisingly, some of the API has changed (I suppose in any
upgrade this is to be expected). However, due to my own lack of understanding of the Seaside internals, it wasn't immediately apparant what the equivalent 2.3 functionality was. Over the last few days, you can find a number of my posts to this list that illustrate.
Are there any of these changes on which you're still unclear?
- I find that the simple enhancement of being able to do html bold: 'foo' instead of: html bold: [html text: 'foo'] to be extremely useful. This one enhancement alone makes the switch
from 2.21 to 2.3 worth it.
Thanks go to Cees for that one.
- The lack of a pretty-printer for the html builder is annoying. To
me, this is probably the single biggest downside of moving from 2.21 to 2.3.
I hear you. It shouldn't be hard to add a pretty printer that's as good as the one in 2.2 (which is to say, not very - it adds extra space inside textareas, for example). Doing it "right" is a harder problem that probably won't be solved before the 2.3 release.
But, realizing that there is a DOM tree behind the scenes garners a vague suspicion that there ought to be ways to exploit the DOM tree that I haven't thought of yet, and that using a DOM tree is potentially a huge win.
I agree. This was explicitly done with the attitude of "add the feature now, figure out how to take advantage of it later".
- Many of the old examples are either completely broken, or partially
broken. This will make it harder for new folks to start with 2.3 than if they started with 2.21.
Which examples, broken in which ways?
- As I think about how Seaside works, I have a vague suspicion that
Seaside is not really suitable for high-volume sites.
No argument here. Seaside maintains a fair amount of state per user session (I've found 1MB or so is not uncommon, although if you're careful you can keep it lower than that). Partly that's because there's been essentially no work done to optimize it (a smarter implementation of Continuation, for example, would go a long way). Party it's just that the approach is inherently resource hungry. Either way, you don't wanna be deploying the next Yahoo using it.
But there are a lot of useful, lucrative problems to solve that don't require thousands of concurrent sessions per server.
- Most of the bountifulbaby.com site right now is static pages.
Seaside produces *no* benefits at all for a purely static web site.
Also agreed.
Thanks again for the comments. Avi
Avi Bryant wrote:
Nevin,
Many thanks for taking the time to write up these comments.
I've just had a report of some problems with interactions with the debugger in 2.3, so it's definitely not 100% stable yet. But good to know that you didn't run into any issues.
You mean the web interface to the debugger (via the 'Debug' link)?
Ah, yes. I also ran into that. Annoying, but at least it still displays the stack, and so lets me know where to place a 'self halt' for "normal" debugging.
And yes, that's something I completely forgot to mention.
- Not surprisingly, some of the API has changed (I suppose in any
upgrade this is to be expected). However, due to my own lack of understanding of the Seaside internals, it wasn't immediately apparant what the equivalent 2.3 functionality was. Over the last few days, you can find a number of my posts to this list that illustrate.
Are there any of these changes on which you're still unclear?
I'm beginning to feel pretty comfortable with them, but I'm sure I will have more questions later :-).
- The lack of a pretty-printer for the html builder is annoying. To
me, this is probably the single biggest downside of moving from 2.21 to 2.3.
I hear you. It shouldn't be hard to add a pretty printer that's as good as the one in 2.2 (which is to say, not very - it adds extra space inside textareas, for example). Doing it "right" is a harder problem that probably won't be solved before the 2.3 release.
I've never seen an html pretty-printer, for any product, that was perfect. I personally think "close" is good enough. After all, you don't particularly care to do very much mucking around directly with the html, do you?
I thought the 2.2 pretty-printer was just fine. In fact, I thought it was *better* than many pretty-printers I've used/seen in the past, with other products.
- Many of the old examples are either completely broken, or partially
broken. This will make it harder for new folks to start with 2.3 than if they started with 2.21.
Which examples, broken in which ways?
Perhaps "missing" would be a better word. But, if you try to move the old "missing" example from the 2.2 sources, it then would qualify as "broken", which also explains why it is "missing" in the 2.3 sources.
As for partially broken, I think the config app itself qualifies. In your own words (from a previous post):
The configuration app (and, really, WAApplication) haven't kept pace with the flexibility offered by the new url management scheme. So, yes, for the time being that's true. Eventually the config app will evolve to better support current system.
Thanks again for excellent work.
Nevin
On Thu, 27 Mar 2003, Nevin Pratt wrote:
You mean the web interface to the debugger (via the 'Debug' link)?
Ah, yes. I also ran into that. Annoying, but at least it still displays the stack, and so lets me know where to place a 'self halt' for "normal" debugging.
Yes, although apparently even after placing a "self halt", backtracking gets messed up to some degree.
I hope to get a chance to look at this later today/tonight.
I thought the 2.2 pretty-printer was just fine. In fact, I thought it was *better* than many pretty-printers I've used/seen in the past, with other products.
Well, ideally the pretty printer wouldn't actually change the meaning of the HTML, which the 2.2 one could (subtly) do in some cases. You're usually only going to have it on during development anyway, however (why waste the bandwidth on whitespace?), so I agree it's not critical.
Perhaps "missing" would be a better word. But, if you try to move the old "missing" example from the 2.2 sources, it then would qualify as "broken", which also explains why it is "missing" in the 2.3 sources.
Hmm. What actually I did was bundle up a bunch of examples inside a tab panel and have it not be loaded by default. If you add an application with "WATestTabs" as the entry point, you should see the same examples back again (I think of those examples more as regression tests for me than as genuinely useful to users, but obviously they weren't useless if you missed having them).
Avi Bryant wrote:
Hmm. What actually I did was bundle up a bunch of examples inside a tab panel and have it not be loaded by default. If you add an application with "WATestTabs" as the entry point, you should see the same examples back again (I think of those examples more as regression tests for me than as genuinely useful to users, but obviously they weren't useless if you missed having them).
Ah, I see. I completely missed this.
Anyway, because of the dearth of Seaside documentation, the examples are quite helpful.
Nevin
Hiya,
With the following code:
html table: [ items do: [:each | html tableRowWith: [html render: each]. ]. ].
The ending tr tags all show up together at the end of the table, and the </table> tag doesn't get rendered at all. Any thoughts?
I'm using Seaside from CVS, but haven't updated in 4 or 5 days...
Brian
On Mon, 7 Apr 2003, Brian Brown wrote:
html table: [ items do: [:each | html tableRowWith: [html render: each]. ]. ].
The ending tr tags all show up together at the end of the table, and the
</table> tag doesn't get rendered at all. Any thoughts?
That's odd. I tried the exact same code (with "1 to: 10" instead of "items") and it looked perfectly normal, with </tr> and </table> where I'd expect them to be.
I also tried your <img> example from before, and I got the </img> and </a> close tags in the right place.
Can you try updating from CVS? Have you been hacking the Renderer at all? Can you send me a complete example that reproduces either of these (related, I think) bugs? Something's clearly not right with whatever code you're using.
Avi
Brian Brown wrote:
Hiya,
With the following code:
html table: [ items do: [:each | html tableRowWith: [html render: each]. ]. ].
The ending tr tags all show up together at the end of the table, and the
</table> tag doesn't get rendered at all. Any thoughts?
I have quite a bit of code similar to that (Seaside 2.3b), and I've never noticed any problem.
Nevin
On Monday 07 April 2003 05:01 pm, Nevin Pratt wrote:
Brian Brown wrote:
Hiya,
With the following code:
html table: [ items do: [:each | html tableRowWith: [html render: each]. ]. ].
The ending tr tags all show up together at the end of the table, and the
</table> tag doesn't get rendered at all. Any thoughts?
I have quite a bit of code similar to that (Seaside 2.3b), and I've never noticed any problem.
... and I hadn't either... this started once I started using images in my content within tables...
Nevin
Seaside mailing list Seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/seaside
Brian Brown wrote:
On Monday 07 April 2003 05:01 pm, Nevin Pratt wrote:
Brian Brown wrote:
Hiya,
With the following code:
html table: [ items do: [:each | html tableRowWith: [html render: each]. ]. ].
The ending tr tags all show up together at the end of the table, and the
</table> tag doesn't get rendered at all. Any thoughts?
I have quite a bit of code similar to that (Seaside 2.3b), and I've never noticed any problem.
... and I hadn't either... this started once I started using images in my content within tables...
I bet this is related to the other message you posted about image tags in anchors.
The problem seems to be that #tag:do: calls "self close" which closes the top tag on the stack, no matter what it is. We used to have a #close: method that closed everything up to the first tag with the given name. Perhaps we need to add that back in?
Avi, can you fix this? I'm not sure whether we're supposed to be exclusively committing to the MC version now or if you're keeping them in synch or what - and I haven't built an MC image yet.
Also, Brian, on a side note, you may not be aware, but you should avoid starting new threads by replying to old ones. This causes your mail client to include a References: header and people who use threaded mail clients see your new message as a reply several levels deep in the middle of another conversation :)
Cheers,
Julian
On Mon, 7 Apr 2003, Julian Fitzell wrote:
The problem seems to be that #tag:do: calls "self close" which closes the top tag on the stack, no matter what it is. We used to have a #close: method that closed everything up to the first tag with the given name. Perhaps we need to add that back in?
As long as people aren't directly using #openTag: or #close, this should never be a problem (all other methods ensure exactly as many closes as opens). Now, #openAnchorWithAction: is clearly an exception to this, I suspect that somehow that's causing the issue. Unfortunately I managed to hose my Debian installation last night so I'm using Emma's iBook right now - but I'll be able to look at this and fix things that need fixing later today ;).
Avi, can you fix this? I'm not sure whether we're supposed to be exclusively committing to the MC version now or if you're keeping them in synch or what - and I haven't built an MC image yet.
I think we should be committing to the Monticello version of the package, yes. We'll still export .st files as snapshots.
You shouldn't need to build a new image for MC, just load Monticello.st into your existing one.
Avi
Avi Bryant wrote:
Yes, this can eat memory quickly if abused. A "profile memory" link has been added to the toolbar to keep tabs on this.
Hmm, I don't normally have the toolbar activated. However, I just turned it on and-- it doesn't work. The toolbar isn't showing up. Not sure why. Never noticed it before because I don't generally run with the toolbar activated.
This is on Seaside 2.3, of course.
Nevin
On Thu, 27 Mar 2003, Nevin Pratt wrote:
Hmm, I don't normally have the toolbar activated. However, I just turned it on and-- it doesn't work. The toolbar isn't showing up. Not sure why. Never noticed it before because I don't generally run with the toolbar activated.
Thanks. That's fixed in CVS.
seaside@lists.squeakfoundation.org