![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
solidus-client
Advanced tools
Render your [Solidus](https://github.com/solidusjs/solidus) views in the browser! Just like Solidus, this library will:
Render your Solidus views in the browser! Just like Solidus, this library will:
Refer to the Solidus documentation to know more about those concepts.
Rendering a template starts with the render
function call, and ends with the end
callback. The various options can be passed directly to the render
method as a config object, or by chaining method calls on the returned object.
resources
- Object of named urls or options. The urls can have dynamic segments, which will be replaced by the matching params
. If an error occurs while fetching a resource, the template is not rendered, except if the resource's optional
option is true
.var resources = {
blogs: 'http://my-site.com/blogs?page={page}',
news: {
url: 'http://news-site.com/news',
proxy: true
}
}
};
Available options:
url
- Resource URL.query
- Object of query values to add to the resource URL.query_options
- Options passed to qs.stringify
, the function used to serialize the query
object. An additional option is available, objectFormat: 'json'
, which will encode query values of type object into JSON strings.headers
- Object of HTTP headers to add to the resource request.auth
- Object with user
and pass
values for HTTP Basic authentication.with_credentials
- Whether to send cookies from the origin. Defaults to false
.jsonp
- Whether to use jsonp instead of ajax for the request. Defaults to false
.proxy
- Whether to fetch the resource through Solidus, instead of directly hitting the resource URL. If true
, all other options are ignored. Defaults to false
.solidus_api_route
- Route to the Solidus resource.json
endpoint if proxy
is true
. Defaults to /api/
.timeout
- Maximum time to wait for the resource, in milliseconds. Defaults to 20,000.optional
- If true
and the resource cannot be fetched, the template is rendered anyway. Defaults to false
.Error conditions:
HTTP error, like a network error.
Timeout is exceeded.
Returned status code is not in the 2xx range.
Returned data is not valid JSON.
Returned data has a root property named status
with value error
.
params
- Object of named values. The values will be interpolated into the dynamic resource urls.
var params = {
page: 123
};
preprocessor
- Function that modifies the context. The preprocessor is run after the resources are fetched, but before the template is rendered. If an error occurs while running the preprocessor, the template is not rendered.// Sync
var preprocessor = function(context) {
context.blogs_count = context.resources.blogs.length;
return context;
};
// Async
var preprocessor = function(context, callback) {
context.blogs_count = context.resources.blogs.length;
if (context.resources.blog.some_condition) {
solidus_client.getResource('http://www.my-site.com/something', null, function(err, data) {
if (err) throw err;
context.more_data = data;
callback(context);
});
} else {
callback(context);
}
};
Return values:
object
- Modified context.
string
- URL to immediately redirect the browser to, instead of rendering the template.
array
- Item 0 is ignored, item 1 is URL to immediately redirect the browser to, instead of rendering the template.
Any other value results in a preprocessor error.
template
- Compiled Handlebars template.
var template = Handlebars.compile('{{blogs_count}} posts: <ul>{{#each resources.blogs}}<li>{{> blog}}</li>{{/each}}</ul>');
template_options
- Object of options to use when rendering the template: data
, helpers
and partials
.var template_options = {
helpers: {
uppercase: function(string) {
return string.toUpperCase();
}
},
partials: {
blog: Handlebars.compile('{{uppercase name}}');
}
};
var view = {
resources: resources,
params: params,
preprocessor: preprocessor,
template: template,
template_options: template_options
};
var solidus_client = new SolidusClient();
solidus_client.render(view)
.end(function(err, html) {
console.log(html);
});
var solidus_client = new SolidusClient();
solidus_client.render(template)
.params(params)
.template_options(template_options)
.get(resources)
.then(preprocessor)
.end(function(err, html) {
console.log(html);
});
var view = {
resources: resources,
preprocessor: preprocessor,
template: template,
template_options: template_options
};
var solidus_client = new SolidusClient();
solidus_client.render(view)
.params(params)
.end(function(err, html) {
console.log(html);
});
Just like in Solidus, resource security settings are configured globally. The resources_options
property of the SolidusClient
instance is scanned whenever a resource is fetched, to find matching options. See the Resources documentation above for the available options. Example:
var resources_options = {
"http://proxy.storyteller.io/*": {
headers: {
"Api-Key": "0000aaaa-aa00-00aa-a00a-aaaa000000"
}
},
"http://services.sparkart.net/*": {
query: {
key: "1111bbbb-bb11-11bb-b11b-bbbb111111"
}
}
};
// Two ways to assign the resources options
var solidus_client = new SolidusClient({resources_options: resources_options});
solidus_client.resources_options = resources_options;
$ npm run build
$ npm run test
$ npm run node-test
$ npm run browser-test
$ npm run test-server
Then access http://localhost:8081/test/browser/test.html in your browser
1.3.0 (Nov 10, 2015)
FAQs
Render your [Solidus](https://github.com/solidusjs/solidus) views in the browser! Just like Solidus, this library will:
The npm package solidus-client receives a total of 0 weekly downloads. As such, solidus-client popularity was classified as not popular.
We found that solidus-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.