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

Feature: Reactive Soy #26

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8376118
Feature: Soy Views Renderer
sgammon Aug 22, 2019
fd35a07
Support for SoySauce-based rendering
sgammon Aug 22, 2019
dbaff2b
Upgrade PRNG to faster implementation
sgammon Aug 25, 2019
9914dca
Cleanup after PRNG switchover
sgammon Aug 25, 2019
86797e8
Remove Soy patch, upgrade -> 2019-09-03
sgammon Sep 4, 2019
49656f7
Cleanup docstrings, copyright headers
sgammon Sep 4, 2019
ce87dcf
Fix version tags for views-soy (since: 1.2.1)
sgammon Sep 4, 2019
a5392b8
Remove DSI util - rely on normal Random
sgammon Sep 4, 2019
7b8b8eb
Remove Soy patch in CI
sgammon Sep 4, 2019
b0bea4d
Remove Soy runtime dependencies
sgammon Sep 4, 2019
7e656ff
Add coverage to Travis via Codecov
sgammon Sep 4, 2019
33944d7
Invoke jacocoFullReport in CI
sgammon Sep 4, 2019
8094791
Remove custom repositories in views-soy
sgammon Sep 4, 2019
dec5d05
Add documentation for Soy with Micronaut
sgammon Sep 4, 2019
b6d70ba
Support injection of CSS/XID renaming maps
sgammon Aug 24, 2019
a0ba048
Finish up docs, general cleanup for Soy
sgammon Sep 5, 2019
90cc831
Add docs for CSP nonce generation
sgammon Sep 5, 2019
f471e3b
Add configurable `Random` engine, and flag to `forceSecureRandom`
sgammon Sep 5, 2019
336ec76
Fixup copyright in SoyNamingMapProvider
sgammon Sep 5, 2019
f5b55eb
Feature: Asynchronous Views
sgammon Aug 29, 2019
3a1ca78
Fix response type with cast
sgammon Sep 4, 2019
73577d2
Fix copyright headers in added files for async render
sgammon Sep 5, 2019
841ff99
Merge branch 'feature/soy'
sgammon Sep 5, 2019
6f94cc1
Merge branch 'feature/csp-nonce'
sgammon Sep 5, 2019
5a14275
Feature: Soy CSP Integration
sgammon Aug 22, 2019
c54490f
Merge branch 'feature/async'
sgammon Sep 5, 2019
e7bdafa
Convert to ByteBuf from Writable for chunked payloads
sgammon Sep 10, 2019
0f4f7bf
Feature: Reactive Soy
sgammon Nov 13, 2019
3e9cf5f
Merge branch 'master' into soy/async-chunked
sgammon Nov 13, 2019
c600bf8
Reject responses for Soy render that don't have status code 200
sgammon Nov 13, 2019
c3444f7
Merge branch 'soy/async-chunked' of github.com:bloombox/micronaut-vie…
sgammon Nov 13, 2019
8a82029
Bigger chunk sizes, swap chunk if write exceeds size
sgammon Nov 13, 2019
99470af
Remove buffer max
sgammon Nov 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup docstrings, copyright headers
sgammon committed Sep 4, 2019
commit 49656f785485fa2689b3141ee6a78992d89e2f30
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.views.soy;

import com.google.template.soy.jbcsrc.api.AdvisingAppendable;
@@ -9,24 +25,27 @@

/**
* Adapts {@link Appendable} to {@link Writable} for use when rendering Soy templates.
*
* @author Sam Gammon (sam@bloombox.io)
* @since 1.3.0
*/
public class AppendableToWritable implements Writable, Appendable, AdvisingAppendable {
private final StringBuilder builder = new StringBuilder();

@Override
public AdvisingAppendable append(CharSequence charSequence) throws IOException {
public AdvisingAppendable append(CharSequence charSequence) {
builder.append(charSequence);
return this;
}

@Override
public AdvisingAppendable append(CharSequence charSequence, int i, int i1) throws IOException {
public AdvisingAppendable append(CharSequence charSequence, int i, int i1) {
builder.append(charSequence, i, i1);
return this;
}

@Override
public AdvisingAppendable append(char c) throws IOException {
public AdvisingAppendable append(char c) {
builder.append(c);
return this;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
package io.micronaut.views.soy;
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.views.soy;

import com.google.template.soy.SoyFileSet;
import com.google.template.soy.jbcsrc.api.SoySauce;
@@ -11,7 +26,7 @@
/**
* Interface via DI to acquire a {@link SoyFileSet}.
*
* @author Sam Gammon
* @author Sam Gammon (sam@bloombox.io)
* @since 1.3.0
*/
public interface SoyFileSetProvider {
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.views.soy;

import com.google.template.soy.data.SoyValueProvider;
@@ -27,7 +43,7 @@
/**
* Renders views with a Soy Tofu-based engine.
*
* @author Sam Gammon
* @author Sam Gammon (sam@bloombox.io)
* @since 1.3.0
*/
@Produces(MediaType.TEXT_HTML)
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
package io.micronaut.views.soy;
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.views.soy;

import com.google.template.soy.tofu.SoyTofu;
import com.google.template.soy.tofu.SoyTofuException;
@@ -22,7 +37,7 @@
/**
* Renders views with a Soy Tofu-based engine.
*
* @author Sam Gammon
* @author Sam Gammon (sam@bloombox.io)
* @since 1.3.0
*/
@Produces(MediaType.TEXT_HTML)
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
package io.micronaut.views.soy;
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.views.soy;

import com.google.template.soy.SoyFileSet;
import com.google.template.soy.jbcsrc.api.SoySauce;
@@ -11,7 +26,7 @@
/**
* Configuration for {@link SoyTofuViewsRenderer}.
*
* @author Sam Gammon
* @author Sam Gammon (sam@bloombox.io)
* @since 1.3.0
*/
public interface SoyViewsRendererConfiguration extends Toggleable {
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
package io.micronaut.views.soy;
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.micronaut.views.soy;

import com.google.template.soy.SoyFileSet;
import com.google.template.soy.jbcsrc.api.SoySauce;
@@ -17,7 +32,7 @@
* Configured properties support a {@link SoyFileSet}, which is rendered via a from-source renderer. Template sources
* are provided via DI, using a {@link SoyFileSetProvider}.
*
* @author Sam Gammon
* @author Sam Gammon (sam@bloombox.io)
* @since 1.3.0
*/
@SuppressWarnings({"WeakerAccess", "unused"})
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
/**
* Contains classes specific to Views rendered with Soy.
*
* @author Sam Gammon
* @author Sam Gammon (sam@bloombox.io)
* @since 1.3.0
*/
@Configuration