Hello there 🤜🤛 I'm Luka, an EU based software engineer with a strong background in web and game development.
Currently wörking with Rust programming language. Previously C#, JavaScript/TypeScript, Python, and Swift.
Django server side rendering, powered by Parcel bundler
Hello there 🤜🤛 I'm Luka, an EU based software engineer with a strong background in web and game development.
Currently wörking with Rust programming language. Previously C#, JavaScript/TypeScript, Python, and Swift.
Just wanted to know if this project is still maintained. The default (React) version does not run, when calling ./manage.py runserver
, it outputs
/home/christian/tmp/dpr/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js:1
/home/christian/tmp/dpr/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js:1
Error: Cannot find module 'core-js/library/fn/object/get-own-property-symbols'
Error: Cannot find module 'core-js/library/fn/object/get-own-property-symbols'
Require stack:
Require stack:
- /home/christian/tmp/dpr/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js
- /home/christian/tmp/dpr/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js
- /home/christian/tmp/dpr/node_modules/babel-types/lib/index.js
- /home/christian/tmp/dpr/node_modules/babel-types/lib/index.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/Asset.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/Asset.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/assets/RawAsset.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/assets/RawAsset.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/Parser.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/Parser.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/Bundler.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/src/Bundler.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/index.js
- /home/christian/tmp/dpr/node_modules/parcel-bundler/index.js
at Object.<anonymous> (/home/christian/tmp/dpr/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js:1)
at Object.<anonymous> (/home/christian/tmp/dpr/node_modules/babel-runtime/core-js/object/get-own-property-symbols.js:1)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10) {
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10) {
code: 'MODULE_NOT_FOUND',
code: 'MODULE_NOT_FOUND',
And the Vuejs version errors:
django.template.exceptions.TemplateSyntaxError: Error: Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11
I use Firefox 84. So Secure random number generation should be no problem here. Seems to be a ug in one of the old dependencies.
Is there an update in sight? Any chance to support Parcel2, or Vue3?
This would be such a great project...
Thanks.
Template.js
import Index from "black-dashboard-react/src/index.js";
export default props => {
return (
<Index {...props}/>
);
}
Index.js
import React from "react";
import { createMemoryHistory } from "history";
import { Router, Route, Switch, Redirect } from "react-router-dom";
import AdminLayout from "layouts/Admin/Admin.jsx";
import RTLLayout from "layouts/RTL/RTL.jsx";
import "assets/scss/black-dashboard-react.scss";
import "assets/demo/demo.css";
import "assets/css/nucleo-icons.css";
export default () =>
(
<Switch>
<Route path="/admin" render={props => <AdminLayout {...props} />}/>
<Route path="/rtl" render={props => <RTLLayout {...props} />}/>
<Redirect from="/" to="/admin/dashboard"/>
</Switch>
);
Difficult to debug since console.log
doesn't work.
Isn't the entry point for the ssr system the template backend setup
method?
If so then why doesn't it run after channels
takes over?
Created a sample project using the guidelines in the README. When I load the url for my react_view (using the uber simple react template view in the README), the first hit of the page takes around 30s to load. Every subsequent refresh of the page also takes 30s to load. In contrast, regular Django views load almost instantly. No other Django settings have been changed. Notably, this computer is pretty top of the line so it's not a hardware performance issue.
This seems like a rather long time to render the page. Any thoughts on what might be causing this?
(As a side note, running a somewhat more involved project that integrates TypeScript/React Router/Redux also has the same hit to load, roughly about 30s, so I seem to be hitting similar behavior regardless of complexity or packaging...?)
Hi @malj,
I played around with django-parcel-ssr and created a little example project: https://github.com/jsbeckr/django-parcel-ssr-vue-example
Keep up the good work. I like the idea of bringing Vue/React and Django closer together with a simple setup! 👍
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.