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

Refactor docs #111

Merged
merged 3 commits into from
Jul 30, 2014
Merged

Refactor docs #111

merged 3 commits into from
Jul 30, 2014

Conversation

ddeboer
Copy link
Member

@ddeboer ddeboer commented Jul 20, 2014

Fix #94.

.. code-block:: bash

$ composer require sensio/framework-extra-bundle

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also give the line to instantiate the bundle in the kernel, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@dbu
Copy link
Contributor

dbu commented Jul 21, 2014

great work, this is coming good! added some comments so we see the open ends in the PR and some inputs.

Rules
=====

Configure the bundle under the ``fos_http_cache`` key. The configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first sentence is a general intro and does not belong here.

@dbu
Copy link
Contributor

dbu commented Jul 28, 2014

@ddeboer how is the state here? i think this is the last blocker for RC1 and i would love to release that this week. anything i can help with here?

@ddeboer
Copy link
Member Author

ddeboer commented Jul 28, 2014

I guess working on the same doc files together at the same time will only complicate things. I’ll push an update tonight, so if it would be most helpful if you could go through that and your criticism.

By the way, do you want to skip beta and go directly to RC?

@dbu
Copy link
Contributor

dbu commented Jul 28, 2014

ups, i thought we have a beta already. hm. lets tag a beta then and announce it, as soon as this PR is merged.

and agreed that editing in the same place is probably tricky. ping me when you pushed your update. and then lets try to wrap it up and maybe add some follow-up tickets for things that could be improved, so we can work separately on them.

@ddeboer
Copy link
Member Author

ddeboer commented Jul 28, 2014

Sounds like a plan!

@ddeboer
Copy link
Member Author

ddeboer commented Jul 28, 2014

Pushing some updates. A built version is available at http://foshttpcachebundle.readthedocs.org/en/refactor-docs/.

@ddeboer
Copy link
Member Author

ddeboer commented Jul 28, 2014

@dbu Not sure where this should go (removed it from the docs for now). Can you place it where it belongs?

    **TODO: MOVE** When using ESI, you will want to purge individual fragments. To generate the
    corresponding ``_internal`` route, inject the ``http_kernel`` into your controller and
    use HttpKernel::generateInternalUri with the parameters as in the twig
    ``render`` tag.

Also, can you do the Flash Message config chapter?

@ddeboer
Copy link
Member Author

ddeboer commented Jul 28, 2014

Still to do:

@dbu
Copy link
Contributor

dbu commented Jul 29, 2014

great. sure i can handle the flash message thingy. i will also look into some sort of common header for each feature chapter to say whether it needs the cache manager and varnish configuration or something like that. with the split between library and bundle, this is a bit tricky to see.

You can also use expressions_ in the route parameter values:

.. code-block:: php
You can also use expressions_ in the route parameter values::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is the expression in the next example? it looks very similar to the previous one to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does indeed. The difference is that latest does not come from the request attributes (it’s hard-coded) and id does. They look the same because the InvalidationSubscriber tries to evaluate each parameter as an expression against request attributes, and fails silently when it doesn’t seem to be an expression (as in the case of latest).

Do you have an idea as to how we could make this clearer? Should we make the behaviour more explicit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, so "id" is tried to be the expression looking for the value id and if that fails, it is the string "id"?

maybe add a note with what you just explained here. its valuable information, also when wanting a static expression that happens to match a parameter name...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. You could force a string, e.g. id, by giving "'id'" (extra quotes). This is different from how we do tags: @Tag("string") versus @Tag(expression="id"). I think I prefer this inconsistency over something like: @InvalidateRoute("route", params={"type" = {"expression": "id"}}) (is this even possible?). Do you agree? I’ll update the docs to make this clearer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theoretically you could do params_expression (or param_expressions?). and then even merge the two. if that is no big pain, we might actually want to do that to avoid that WTF moment when a name hits a parameter name. doing it later would be a BC problem...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would the syntax be like, in your proposal? I think just supplying one list of route params, and differentiating between them with a literal string versus key/value {"expression": "id"} is most user-friendly. Do you have time to open a PR for this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created #117, lets see. i think we should merge now, and then clean that bit up.

if you agree, can you squash and merge?

@dbu
Copy link
Contributor

dbu commented Jul 29, 2014

ftr: i decided to drop this ESI hint. its extremly specific and if anything would belong somewhere into the symfony cookbook, not here.


.. toctree::

helpers/flash-message
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need a separate Helpers chapter? Should more items be listed here, or do we expect any to pop up soon? What about just upgrading the Flash Message helper to a fully-fledged Feature chapter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what i like about this is that it makes this thing less prominent than the rest. it is less important. and we might turn up with other things too. but if you prefer, you can also move this, and we can restructure when/if we have more helpers turning up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong feelings about this. The helper just looks a bit lonely in there. 😉

@ddeboer
Copy link
Member Author

ddeboer commented Jul 30, 2014

Okay, pushed my last changes. One question remaining about the Flash Message chapter @dbu. We’ll revisit the tags config examples when #117 is merged. Otherwise, this is ready to be squashed and rebased.

ddeboer and others added 3 commits July 30, 2014 12:01
Fix #94.

Add bundle activation to installation

Improve @tag section in Annotations

Include match partial in invalidation chapter

Update user context docs

Fix typos

Add chapter intros

Add chapter headers

Add Debug config chapter

Add flash message chapter (todo)

Update proxy client chapter

Remove default config chapter

Add Configuration chapter header

Re-organise configuration chapters

Match is now linked to instead of included, and included in the TOC too.
* fix links to FOSHttpCache docs
* a little clean-up
@ddeboer
Copy link
Member Author

ddeboer commented Jul 30, 2014

Okay, squashed. If Travis is green you may press the big green button. 😄

@ddeboer ddeboer changed the title [WIP] Refactor docs Refactor docs Jul 30, 2014
dbu added a commit that referenced this pull request Jul 30, 2014
@dbu dbu merged commit 51bee50 into master Jul 30, 2014
@dbu dbu deleted the refactor-docs branch July 30, 2014 10:42
@dbu
Copy link
Contributor

dbu commented Jul 30, 2014

yay, great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

configuration reference
2 participants