Skip to content

Enable faster development loop #197

Open

Description

@milesfrain

The current development workflow with spago bundle-app adds a 15-second delay (on my system) between making changes and seeing the results in your browser.

There are other strategies to achieve near-instant page refreshes with saved changes, such as with webpack in #187 and #192.

Activity

  1. changed the title [-]Enable fast incremental rebuilds[/-] [+]Enable faster development loop[/+] on Aug 22, 2020
  2. natefaubion commented on Aug 23, 2020

    @natefaubion
    Contributor

    A few things to consider:

    • Most of bundle time is going to be spent in DCE. There should be a compiler option to skip DCE, which would make it much faster.
    • Is it 15-seconds on master, or 15-seconds against Halogen (which transitively pulls in most of the universe)? Do we need to prioritize dependency sizes and final bundle size?
    • I think that trypurs should always be buildable and shippable with stock-tooling, but I don't think it's necessarily bad that there's an alternative workflow for development if you want it.
  3. milesfrain commented on Aug 23, 2020

    @milesfrain
    ContributorAuthor

    Could someone point me to the compiler option to skip DCE? I'm not seeing it under purs compile --help or purs bundle --help.

    This is 15 seconds on master (technically on #198, but that's close to equivalent and halogen-free).

  4. natefaubion commented on Aug 23, 2020

    @natefaubion
    Contributor

    Could someone point me to the compiler option to skip DCE? I'm not seeing it under purs compile --help or purs bundle --help.

    Maybe I'm remembering a bygone era, or maybe I'm remembering a pulp option. If it's not in the help for purs bundle then it does not exist.

  5. hdgarrood commented on Aug 23, 2020

    @hdgarrood
    Collaborator

    I think you might be thinking of a pulp option; purs bundle doesn't have an option to run without DCE, but pulp does give you the ability to make a bundle without performing DCE via browserify, by running pulp browserify without the --optimise flag.

  6. thomashoneyman commented on Aug 23, 2020

    @thomashoneyman
    Member

    I think that trypurs should always be buildable and shippable with stock-tooling, but I don't think it's necessarily bad that there's an alternative workflow for development if you want it.

    I agree. I think it's acceptable to use Webpack for the development workflow -- as far as bundlers go it's damn near standard and it's not going anywhere. We can still build and ship via stock tooling.

  7. hdgarrood commented on Aug 23, 2020

    @hdgarrood
    Collaborator

    Webpack is damn near standard, but at the same time it's the source of a huge amount of grief. I'm still not sure how I feel about this.

  8. hdgarrood commented on Aug 23, 2020

    @hdgarrood
    Collaborator

    What about adding that option for purs bundle to skip DCE? That would be useful for everyone else developing an app in a similar way who has this problem.

  9. thomashoneyman commented on Aug 23, 2020

    @thomashoneyman
    Member

    @milesfrain Do you have an opinion? Would that enable the faster development loop you're envisioning?

  10. milesfrain commented on Aug 23, 2020

    @milesfrain
    ContributorAuthor

    The options:

    1. ES Modules with Snowpack.
      • My favorite.
      • Least amount of throw-away work.
      • Farthest-away option, but I can wait.
    2. Skip DCE with purs bundle
      • Unknown how much faster this will be.
      • Requires additional tinkering for automatic refresh and incorponating non-purs changes.
      • Not available today. Requires compiler changes and another release.
      • Doesn't seem like there's much demand for this.
    3. Webpack
      • Available now.
      • I don't like webpack either, and it caused me a lot of grief with this project too.
      • Dues are already paid for setting it up in this project though, so it should be smooth sailing to use.
  11. hdgarrood commented on Aug 24, 2020

    @hdgarrood
    Collaborator

    I would really love ES modules with no bundler at all, although we can discuss the merits of that approach versus ES modules with Snowpack when that's closer to being a reality. I suppose that since we do have a clear path to getting rid of Webpack (i.e. wait until ES modules are a thing) and that the initial work has already been done, using Webpack in the meantime should probably be fine.

  12. thomashoneyman commented on Aug 24, 2020

    @thomashoneyman
    Member

    That sounds like a good plan: use Webpack for now, with an issue and the understanding that we will remove it when the compiler supports ES Modules.

  13. JordanMartinez commented on Jun 18, 2022

    @JordanMartinez
    Contributor

    Is this still an issue? Running npm run serve:dev starts a web browser in ~6 seconds.

  14. thomashoneyman commented on Jun 18, 2022

    @thomashoneyman
    Member

    I think Miles was looking for something more like hot module replacement while doing development, supported by webpack, vite, etc.

  15. hdgarrood commented on Jun 18, 2022

    @hdgarrood
    Collaborator

    Now that ES modules have shipped, maybe it’d be worth looking into snowpack?

  16. thomashoneyman commented on Jun 18, 2022

    @thomashoneyman
    Member

    Snowpack is no longer maintained and they recommend Vite as an alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions