Skip to content

[WIP] Update website docs to 1.0. - #90

Merged
fafhrd91 merged 69 commits into
actix:masterfrom
cldershem:update1.0
Jul 2, 2019
Merged

fafhrd91 merged 69 commits into
actix:masterfrom
cldershem:update1.0

Conversation

@cldershem

@cldershem cldershem commented Jun 12, 2019 •

Copy link
Copy Markdown
Member

This is a tracking issue for addressing #87, actix/actix-web#722, and actix/actix-web#901. The first round of updates will be just getting the code updated to run on v1.0. There will be further passes to address if the content is still accurate and the patterns are still best practices.

Sections

  • actix.rs/
    • basic example
    • flexible responders
    • powerful extractors
    • easy form handling
    • request routing
    • General Text
      • is "Feature Rich" section still accurate, specifically WebSockets?
  • community
  • code
  • translations
    • this is a completely separate site which is outside the scope of this PR
    • Should the link be removed completely until it is updated?
  • documentation
    • Intro
      • needs to be rewritten or the site changed to be only about actix-web
      • Welcome
        • actix-web is no longer really based on actix
      • What is Actix
        • minimum version for Rust
        • actix-web is no longer really based on actix
      • Installation
        • minimum version for actix-web
        • assumed version for guide
    • Basics
      • Getting Started
      • Application
        • mention Config
        • is note about Arc still accurate? If so examples/state needs to have better comments.
        • mentions websockets in first paragraph.
        • is multiple apps still possible? recommended? is this scope? service? config?
        • does registration order still matter?
        • State
          • state section mentions actors
          • combining state means different things depending on what 'multiple apps' means
          • App::boxed no longer exists and I'm unsure of what replaces it.
        • pred seems to be guard, but I'm unsure of what that has to do with virtual-hosting
        • App::filter() no longer exists, it appears to be automatic with guards.
      • Server
        • top section
          • states HttpServer is an actix actor.
          • is the signal/messaging section still accurate?
        • workers
        • ssl
          • needs to be checked for accuracy
          • unable to verify code works without working openssl
          • could probably make code snippet to create dummy keys just for example
        • keep alive
          • over my head - does it require actix-http to work now?
          • specifically the SO_KEEPALIVE option
        • graceful shutdown
      • Handlers
        • top section
          • code examples are hardcoded in markdown - likely should match the rest as their own crate
            • yes, first example would have never compiled.
          • Handler trait no longer exists?
          • Should the data/arc/mutex things be moved to the 'Extractors' section?
        • Responder trait
        • Async Handlers
        • Either
      • Extractors
        • code examples are hardcoded
        • "within handler functions" FromRequest json doesn't work.
        • Handler trait no longer exists
        • JsonConfg needs to be reworded since with is no longer a thing.
        • are forms still required to be url-encoded?
        • other extractors need to be updated.
    • Advanced
      • Errors
        • need to add an example of logging errors.
      • URL Dispatch
        • mentions Handler
        • there is no mention of service
        • FromParam is no more.
        • NormalizePath is potentially quite different v
        • need paragraph to explain app vs service vs route vs resource
        • this chapter has a lot of redundant content
        • urls example needs to be tested
      • Requests
        • HttpRequest::json() doesn't exist
        • HttpRequest::concat2 doesn't exist
        • multipart is now a separate crate
        • HttpRequest::urlencoded no longer exists
        • 'Streaming Requests' example is broken and I am getting nowhere
        • section is a little reduncant
      • Responses
        • how should middleware::BodyEncoding be used?
        • default encoding needs to be checked.
        • chunked section does not work
      • Testing
        • TestServer no longer exists - 'integration Testing' section needs to be rewritten.
        • streaming section needs to be rewritten
        • websockets section needs to be rewritten or removed
        • This section is a little shaky. Streaming is probably very wrong.
      • Middlewares
        • session no longer exists - should it be rewritten for actix-session?
        • 'session' needs to be rewritten
      • Static Files
        • StaticFileConfig is no longer a thing - section needs to be rewritten
    • Protocols
      • Websockets
        • websockets are no longer out of the box - page will need rewritten
      • HTTP/2.0
        • this compiles, but I'm not real sure how to test it.
    • Patterns
      • Autoreloading
      • Databases
        • DbExecutor is out - section needs to be rewritten
      • Sentry
        • Sentry isn't working with 1.0
    • API Documentation
      • actix
      • actix-web
        • should this link to docs.rs?
        • api docs should be removed from the repo and link against docs.rs. too easy for them to get out of sync.

@cldershem

cldershem commented Jun 12, 2019 •

Copy link
Copy Markdown
Member Author

Questions:

  • should examples include use?
    • Yes, whenever possible unless shown in a previous example immediately prior
  • should examples include HttpServer::new()?
  • should the main index be rewritten to pull in examples from working code like the rest of the site?
    • This is a bit of an undertaking, but would go a long way to making sure the site is easier to maintain.
  • Should examples use App::new().service() or App::new().route()?
    • undecided
  • Is returning HttpResponse the right thing or should it be impl Responder still?
    • impl Responder shows more flexibility
  • should example crate version match the release?
    • Yes, this will make it significantly easier to keep examples in sync
  • rustfmt is a pain for code examples
    • This will help a lot with readability in the code
  • code examples needs to be restructured a little to ensure each one gets built
    • cargo can't do nested workspaces - maybe each chapter is a workspace and each example a crate?
    • for now each chapter a crate, each example a module and marked as pub mod then added to the main workspace - pub main might make the examples slightly more cluttered, but it's the easiest solution for now.
  • Should we just make this 'acitx.rs/actix-web' and no worry about 'actix' at all for now.
    • A separate actix/actor book can be written as a separate thing.
  • Examples that use actix need to be updated to v0.8
  • Restructure
    • The whole docs could be restructured/reordered. Maybe starting with a simple example that uses all of the vocabulary would help.
  • Now that most middleware and a few features are separate crates, maybe we can put documenting them off until a later time. This will get this PR out the door much faster.
    • websockest
    • session
    • sentry
  • links in markdown should be [][] style with the key at the bottom. It's significantly easier to update them that way.

@robjtede

Copy link
Copy Markdown
Member

My twocents:

should examples include use?

Yes, the web module goes a long way to making imports concise imo.


should examples include HttpServer::new()?

Yes, I would expect that all examples are copy-paste runnable.


should the main index be rewritten to pull in examples from working code like the rest of the site?

If you mean the section showing the various features and syntax then maybe this section gets a pass on full-working-code-ness like the current site.


Should examples use App::new().service() or App::new().route()?

Service. Makes it easier to reason about the architecture of routing and transition to .configure.


Is returning HttpResponse the right thing or should it be impl Responder still?

impl Responder


should example crate version match the release?

its not clear to me what you mean by this

Comment thread content/docs/application.md Resolved
@0xpr03 0xpr03 mentioned this pull request Jun 14, 2019
6 tasks done
Comment thread content/docs/_index.md Resolved
Comment thread content/docs/application.md Resolved
Comment thread content/docs/application.md Resolved
@cldershem

cldershem commented Jun 28, 2019 •

Copy link
Copy Markdown
Member Author

I have everything as up-to-date as I can get without some outside help. I am by no means an actix expert, I just had some free time and wanted to stop reading the wrong examples myself. I have made a lot of notes (see above and below) about what needs to be checked. My goal with this PR is only to get the docs accurate for actix-web 1.0. I know there are many things that can be reworked to be better, but I think those should be the focus of another future rewrite.

  • All pages need to be checked
    • accurate for v1.0+
    • links work
    • code works
    • code formatted coherently
    • code examples are clear
  • actix.rs/index
  • community
  • code
  • translations
    • these may need to be removed until they can be updated
  • getting started
  • application
    • is Arc note still correct?
    • are multiple apps still possible?
      • should this be updated to be "multiple services"?
  • server
    • signals/messaging all needs to be checked by someone who knows this better
    • keep alive needs to be checked by someoene who knows this better
  • handlers
    • are forms still required to be url-encoded
  • errors
  • url-dispatch
    • maybe an example of service vs route vs resource
  • requests
    • should multipart have an example
  • responses
    • chunked encoding needs to be rewritten
    • is it a bug that you can use .encoding() without the middleware,
      but it doesn't actually change the encoding?
  • testing
    • is streaming section correct?
  • middlewares
  • static files
  • websockets
  • http/2.0
  • autoreloading
  • database
  • sentry
    • this should probably be removed until they updated to 1.0.

You can view a temporary rendered copy here. Please note that some of the link are broken because of the way the temp copy is hosted. If you get a bad one make sure the link is using "https://pinkhatbeard.gitlab.io/actix-website/" as the base url before you submit an issue.

@cldershem
cldershem marked this pull request as ready for review June 28, 2019 17:40
@fafhrd91

Copy link
Copy Markdown
Member

i'd just merge and continue to work in separate smaller PRs

@cldershem what do you think?

@fafhrd91
fafhrd91 merged commit 9fcd8c1 into actix:master Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants