Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Update project from gwtext 2

    Hello! I am currently working on a project that is created in gwtext 2 which has not been updated for many many years. It is no longer viable and I will need newer widgets / design as well as increased ease of maintenance. Is it even viable to update from gwtext 2 to a newer smartgwt version? I do not have a good understanding of gwt projects and is questioning if it is worth to update or remaking it from scratch in smartgwt or react. The backend is alright and does not need rework. What are your thoughts on this?

    Thanks for your insight!

    #2
    There's no meaningful way to "update" to SmartGWT, so this will be a rewrite, however, the code structure between a gwtext app and SmartGWT app is at least somewhat similar, so it's likely to be a fairly quick process.

    However, you mentioned React, so it sounds like you are open to JavaScript. Note that SmartClient, which is the framework under SmartGWT, can be used directly in JavaScript or via React JSX.

    As far as that decision, it looks like this:

    1) SmartGWT: UI definitions in procedural Java

    2) SmartClient: UI definitions in declarative JSON

    3) SmartClient w/React: UI definitions in declarative XML (React JSX) and declarative JSON

    As long as you aren't afraid of JavaScript, we would recommend #2 or #3, since GWT is not as popular now as it once was. There is a slight preference for #2 since JSON is more expressive and easier to read than XML.

    There's also Reify, our low code platform, which can be used to build screens which can then be used with any one of the 3 technologies above (Reify screens can be used as JSX, for example):

    http://reify.com

    Finally, if you want some help, we offer Consulting services. A good way to move quickly would be to give one of our engineers access to your app, and have them rebuild the basics of it in your chosen technology (this is something we can do very, very fast). Then in a hand-off session, you would be shown the structure of the code and the best practices that were used. We also offer training courses if you want that.

    What is the backend by the way, REST services built in Java?

    Comment


      #3
      Thank you for your time! I am leaning on rewriting the program using smartGWT. Do you have any tips on how to think / start the process? Is it possible to start rewriting smaller components and test or do I need to remake the whole app in order to test? Where could I find relevant information for this (which component is the best counterpart compared to gwtext)? For example to replace a panel or a button. The backend is made in REST php.

      I have downloaded smartGWT 13 (community edition). Which JAR files would be needed to import to my project as well as compile.cmd?
      Would "c:\source\stat\client\src;c:\source\stat\client\bin;C:\Users\bobby\Desktop\smartgwt-13.0p\smartgwt.jar;C:\Users\bobby\Desktop\gwt-2.10.0" be sufficient?
      Last edited by bobby123o; 4 Jul 2023, 05:43.

      Comment


        #4
        We would recommend replacing one entire screen at a time, so that you don't have to deal with weird layout issues that arise between the two component sets (gwtext2 was never particularly strong at hosting components from other frameworks, and is very old).

        In particular, start by creating a SmartGWT DataSource that can access your data services. The best way to do this would actually be to enhance your data services so they support the pre-built SmartGWT RestDataSource protocol (https://smartclient.com/smartgwt/jav...ataSource.html) since this protocol already handles everything that SmartGWT ListGrid or other component needs to do (send criteria, multi-level sort, save with validation and other errors, etc).

        As far as installation and getting started, make sure you read the QuickStart Guide first (and don't skim!).

        https://smartclient.com/smartgwt-rel...tart_Guide.pdf

        It has been a long time since anyone had trouble getting going with SmartGWT for any reason other than skipping the QuickStart!

        Comment


          #5
          Hi and thanks for input! I managed to run a very basic rewritten entry point which works. However, I had to manually rewrite the loadScriptTagFiles.js after compiling as the paths were wrong. Do you have any idea where this data is set before compiling since it does not feel good to manually alter it after building every time.

          Also, I read everything about this "DataSource" in the link and I have a few questions. Is this nessesary? We will most likely not do any more major development so would it be quicker to try to replicate the old strucuture of gwtext as closely as possible if that is possible?

          You also mentioned it is possible to run react with smartclient. If we were to upgrade one step further to full javascript / react in the future. Would this be easy if the same components / widgets exist in smart client?

          Best regards, Bobby
          Last edited by bobby123o; 5 Jul 2023, 05:28.

          Comment


            #6
            Originally posted by bobby123o View Post
            Hi and thanks for input! I managed to run a very basic rewritten entry point which works. However, I had to manually rewrite the loadScriptTagFiles.js after compiling as the paths were wrong. Do you have any idea where this data is set before compiling since it does not feel good to manually alter it after building every time.
            Please read the Debugging overview and in particular the sub-article regarding SuperDevMode:

            https://smartclient.com/smartgwtee-l...Debugging.html

            Also, I read everything about this "DataSource" in the link and I have a few questions. Is this nessesary? We will most likely not do any more major development so would it be quicker to try to replicate the old strucuture of gwtext as closely as possible if that is possible?
            DataSources are absolutely, 100% necessary, and they are also, by far, the simplest and easiest approach.

            If you try to write a system without DataSources, you will write 10x as much code, and your application will be brittle, slow, and far less functional.

            If you understand DataSources and use them as directed, your new codebase will likely be 1/2 to 1/3 the size of your old codebase, with more functionality and huge speed gains.

            You also mentioned it is possible to run react with smartclient. If we were to upgrade one step further to full javascript / react in the future. Would this be easy if the same components / widgets exist in smart client?
            Yes, the components and APIs are 1-to-1, the SmartGWT layer is literally generated from SmartClient's documentation.

            However, if you think you are going to end up with JavaScript / React, you should probably just do it now.

            Compare the source code of any two corresponding samples between the SmartClient and SmartGWT showcase:

            https://smartclient.com/smartclient/...igateNewSample
            https://smartclient.com/smartgwt/sho..._auto_navigate

            ... and you will see that the SmartClient code is shorter, clearer and easier to read.

            As far as specifically adding using SmartClient's support for React as opposed to just using SmartClient directly, we would recommend just starting with direct use of SmartClient. If you eventually find a use for React, the JavaScript code you write will work in React, unchanged.

            React doesn't add functionality to SmartClient, the main thing it does is add an additional syntax for declaring components (React's JSX XML format). In order to get this additional syntax, you have to set up a toolchain similar to GWT, with a transpiler, which means you lose the convenience & speed of the "just reload" development model and also have to debug transpiled code instead of your original code.

            Comment

            Working...
            X