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

Client-side view rendering #116

Merged
merged 1 commit into from
Apr 2, 2015
Merged

Conversation

joanniclaborde
Copy link
Contributor

In order to render views on the client, the context preparation done in Solidus needs to be replicated in the browser. This is done by solidus-client.

This PR adds the ability to export the Solidus views to the browser, so solidus-client can use them. This is achieved with a custom Browserify transform, named solidify.

Simple example:

assets/scripts/index.js

var SolidusClient = require('solidus-client');
var view = require('solidus/views/my/view'); // Can end with .js, but not with .hbs

var solidus_client = new SolidusClient();
solidus_client
  .render(view)
  .end(function(html) {
    console.log(html);
  });

gruntfile.js

//...
    browserify: {
      scripts: {
        options: {
          transform: ['solidus/solidify', 'hbsfy']
        },
        files: {
          'assets/compiled/scripts.js': ['assets/scripts/index.js']
        }
      }
    },

//...
  grunt.registerTask( 'compilejs', ['browserify'] );

@joanniclaborde
Copy link
Contributor Author

Warning: rebased over #119, delete your local branch!

@joanniclaborde joanniclaborde removed this from the 1.0.0 alpha milestone Nov 25, 2014
@joanniclaborde joanniclaborde added this to the 2.0.0 milestone Nov 25, 2014
@joanniclaborde
Copy link
Contributor Author

Warning: rebased over 1.1.0, delete your local branch!

@joanniclaborde
Copy link
Contributor Author

Warning: rebased over 1.1.1, delete your local branch!

joanniclaborde added a commit that referenced this pull request Apr 2, 2015
@joanniclaborde joanniclaborde merged commit 93e467a into master Apr 2, 2015
@joanniclaborde joanniclaborde deleted the client-side-view-rendering branch February 5, 2016 15:44
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.

1 participant