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

Ability to build static sites (SSG mode) #65

Closed
Tracked by #10
sgammon opened this issue Nov 18, 2022 · 0 comments · Fixed by #81
Closed
Tracked by #10

Ability to build static sites (SSG mode) #65

sgammon opened this issue Nov 18, 2022 · 0 comments · Fixed by #81
Assignees
Labels
feature Large PRs or issues with full-blown features platform:jvm PRs and issues relating to JVM support. tools Issues and PRs related to tooling

Comments

@sgammon
Copy link
Member

sgammon commented Nov 18, 2022

We should add the ability to build Elide apps into static SSG-based sites. In this mode, requests are executed through @Page-annotated handlers at build time; their local assets are crawled, and the entire resulting set of web assets is considered the output.

This mode would enable Elide to be used as a framework for sites hosted on completely static systems, like Github Pages or Google Cloud Storage/S3.

To do this the right way, we'll need to scan for @Page annotations at build time; two options exist for this, namely, kapt and KSP. Because kapt is deprecated, we should build a KSP processor which produces the appropriate metadata for the SSG compiler.

Rough steps to finish this one:

  • Add KSP processor which scans for @Page-annotated handlers and produces an "app manifest," in binary-encoded proto, that describes each of the detected "endpoints."

  • Read manifest at build time from the Gradle plugin, when SSG is active, and use it as input to perform the following steps for each listed endpoint, if any (if no endpoints are present, this step is skipped, and an SSG build is not possible):

    • Synthesize a root-page request to the endpoint, save the output
    • Synthesize a request to each mounted asset endpoint, save the output
    • With above outputs, generate a virtual filesystem with index.html / assets
  • Write output to filesystem in a structure which mirrors the app

    • For each endpoint, write a folder or index.html or <page>.html
    • For each endpoint, write each asset
  • *Compress to tarball which can be uploaded / expanded to hosting systems

    • Best to use a tar.gz probably
@sgammon sgammon added feature Large PRs or issues with full-blown features platform:jvm PRs and issues relating to JVM support. tools Issues and PRs related to tooling labels Nov 18, 2022
@sgammon sgammon added this to the Release R1: Alpha 1 milestone Nov 18, 2022
@sgammon sgammon self-assigned this Nov 18, 2022
This was referenced Nov 18, 2022
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous benchmarking job
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous benchmarking job
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous micro-benchmarking job
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous micro-benchmarking job
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous micro-benchmarking job
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous micro-benchmarking job
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous micro-benchmarking job
sgammon added a commit that referenced this issue Nov 19, 2022
This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality
later down the road once the build flow is perfected. A number of
other important changes are also enclosed which prepare the lib for
an initial beta release.

Changes enclosed:
- Cleanup all workflow configs
- Add sharing of codebase-wide properties
- Add ABI check validation (fixes and closes #70), + build step
- Refactor convention plugins (relates to #71)
- Prep version catalog and platform releases (relates to #73)
- Prep for SSG compiler (relates to #65 and #76)
- Fix state sharing issue (fixes and closes #35)
- Fix benchmarks module, add continuous micro-benchmarking job
sgammon added a commit to elide-dev/plugin-gradle that referenced this issue Nov 19, 2022
This changeset adds support for the new SSG compiler, which is
configured via the Gradle plugin for applicable builds.

Changes enclosed:
- Bump version -> `1.0.0-beta13`
- New SSG settings block, within `server`
- Install new SSG task if enabled within config block

Changes pending:
- Read KSP-generated SSG manifest
- Build and start application, generate bundle from calls

Relates to upstream PR elide-dev/elide#81, and issue
elide-dev/elide#65.
sgammon added a commit to elide-dev/plugin-gradle that referenced this issue Nov 19, 2022
This changeset adds support for the new SSG compiler, which is
configured via the Gradle plugin for applicable builds.

Changes enclosed:
- Bump version -> `1.0.0-beta13`
- New SSG settings block, within `server`
- Install new SSG task if enabled within config block

Changes pending:
- Read KSP-generated SSG manifest
- Build and start application, generate bundle from calls

Relates to upstream PR elide-dev/elide#81, and issue
elide-dev/elide#65.
sgammon added a commit to elide-dev/plugin-gradle that referenced this issue Nov 19, 2022
This changeset adds support for the new SSG compiler, which is
configured via the Gradle plugin for applicable builds.

Changes enclosed:
- Bump version -> `1.0.0-beta13`
- New SSG settings block, within `server`
- Install new SSG task if enabled within config block

Changes pending:
- Read KSP-generated SSG manifest
- Build and start application, generate bundle from calls

Relates to upstream PR elide-dev/elide#81, and issue
elide-dev/elide#65.
sgammon added a commit to elide-dev/plugin-gradle that referenced this issue Nov 19, 2022
This changeset adds support for the new SSG compiler, which is
configured via the Gradle plugin for applicable builds.

Changes enclosed:
- Bump version -> `1.0.0-beta13`
- New SSG settings block, within `server`
- Install new SSG task if enabled within config block

Changes pending:
- Read KSP-generated SSG manifest
- Build and start application, generate bundle from calls

Relates to upstream PR elide-dev/elide#81, and issue
elide-dev/elide#65.
sgammon added a commit that referenced this issue Nov 23, 2022
- Introduce `AppLoader`, `AppStaticWriter`, `AppStaticReader`
- Write logic for initial compiler flow
- Write facade for CLI invocation of SSG compiler
- Write facade for programmatic invocation of SSG compiler
- Add ability to execute against HTTP server
- Add ability to execute against JAR (stubbed)

Relates to #65
@sgammon sgammon linked a pull request Nov 26, 2022 that will close this issue
34 tasks
sgammon added a commit that referenced this issue Nov 29, 2022
![Ready for
review](https://badgen.net/badge/Status/Ready%20for%20review/green)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=elide-dev&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->

This changeset restructures the build to provide more control over
Kotlin targets. Support is introduced for KSP processors and Kotlin
compiler plugins.

The plugins don't do much yet, but will host rich functionality later
down the road once the build flow is perfected. A number of other
important changes are also enclosed which prepare the lib for an initial
beta release.

### Related PRs
- elide-dev/plugin-gradle#74

## Changes enclosed
- [x] Cleanup all workflow configs
- [x] Add sharing of codebase-wide properties
- [x] Add ABI check validation (fixes and closes #70), + build step
- [x] Refactor convention plugins (relates to #71)
- [x] Prep version catalog and platform releases (relates to #73)
- [x] Prep for SSG compiler (relates to #65 and #76)
- [x] Fix state sharing issue (fixes and closes #35)
- [x] Continuous JMH benchmarks
- [x] Minimum JVM level -> `11`
- [x] Working initial set of compiler plugins
- [x] Invocation of SSG compiler from CLI and programmatically
- [x] SSG compiler implementation code
  - [x] Read manifest
  - [x] Generate requests
  - [x] Write to zip
  - [x] Write to tarball
  - [x] Write to directory
- [x] Final cleanup / known issues
  - [x] KotlinX add'l co-routine deps
  - [x] Fix issue with absolute archive paths
  - [x] Drop inline docs
  - [x] Drop inline protos
  - [x] Fix all Sonar warnings, etc
  - [x] Invocation of SSG compiler from Gradle plugin
  - [x] Check spawned requests for uniqueness
  - [x] Check written files for collisions
  - [x] ~~Compression for inner files?~~
  - [x] ~~JAR loading mode -- do we need a shadow JAR?~~ _note: yes_
  - [x] ~~Finish JAR loading mode~~
  - [x] TAR writing issues
  - [x] Finish implementing directory mode
  - [x] ~~Native distribution (maybe?)~~
  - [x] Curtail verbose logging before push
- [x] ~~URL rewriting issues (i.e. shut off rewriting on target app)~~
_note: kicked to issue #91_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Large PRs or issues with full-blown features platform:jvm PRs and issues relating to JVM support. tools Issues and PRs related to tooling
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant