Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle / build less development #355

Closed
1 of 5 tasks
thescientist13 opened this issue May 31, 2020 · 2 comments
Closed
1 of 5 tasks

bundle / build less development #355

thescientist13 opened this issue May 31, 2020 · 2 comments
Assignees
Labels
alpha.0 CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) RFC Proposal and changes to workflows, architecture, APIs, etc v0.10.0

Comments

@thescientist13
Copy link
Member

thescientist13 commented May 31, 2020

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

As part of explorations into #305, continued into #354, and inspired by projects like Vite, es-dev-server, and Snowpack, it would be of interest to investigate a way to move away from bundling by default for development. webpack could still be used for production builds maybe, or maybe even something that is more ESM friendly, like Rollup.

Note I tried Snowpack, but it has a hard dependency on bootstrapping from a package.json, as opposed to being just more of an opinionated dev server like Vite.

Details

This would definitely require a lot of new work, but in a ESM first world, there are so many advantages in that the entire site wouldn't need to be prebuilt / bundled, and transformations could just happen on the fly + on demand. Plus all syntax could just be standardized to use import for everything.

Not opposed to coming up something of our own, maybe as its own package? Also, simplifying this and using something like Rollup may allow us to not have to rely on having to webpack-ify everything, and also free up a ton a devDependencies in the @greenwood/cli package.

Would allow us to explore usage of import-maps as a possible solution (bare imports and routing in general), ex.

<script>
{
  "imports": {
    "lit-element": "./vendor/lit-element/lit-element.js",
    "lit-html": "./vendor/lit-html/lit-html.js",
    "lit-html/lit-html.js": "./vendor/lit-html/lit-html.js",
    "lit-html/lib/shady-render.js": "./vendor/lit-html/lib/shady-render.js",
    "lit-html/directives/unsafe-html.js": "./vendor/lit-html/directives/unsafe-html.js"
  }
}
</script>

Some more specific webpacky things that we use webpack for that would have to be redone:

  • dev server w/ live reload and file watching
  • NormalModuleReplacementPlugin for mapping imports to user directories
  • templating index.html
  • bundling (just use Rollup?)
@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) RFC Proposal and changes to workflows, architecture, APIs, etc CLI labels May 31, 2020
@thescientist13
Copy link
Member Author

Could even push it farther with web packaging for production

@thescientist13 thescientist13 self-assigned this Jun 30, 2020
@thescientist13 thescientist13 changed the title bundle-less for development bundle / build less for development Jul 13, 2020
@thescientist13 thescientist13 changed the title bundle / build less for development bundle / build less development Jul 18, 2020
@thescientist13
Copy link
Member Author

Started working on this, seeing this as a critical path forward on the project taking into consideration all the rest of the items in the Architectural Digest Project. Will demo some of my thoughts at our next weekly team meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha.0 CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) RFC Proposal and changes to workflows, architecture, APIs, etc v0.10.0
Projects
None yet
Development

No branches or pull requests

1 participant