-4

In enterprise projects, Authentication and Authorization is different because we use SSO (Single Sign On) or use an internal CDN (Content Delivery Network) to read some data in Client web Application.

In some projects like this the program lines are written with most accurate. you can see folders and files are also made up SOLID and etc conventions.

In a project that at least has 50 sub systems if I use react in one project (create-react-app) this project gives me at least 126 folders. (CREATE - REACT - APP) gives me a lot of folders that do not have any performance for me. On the other hand I need to have a structure with up to ten script files to add them to CDN project and clean coding.

What I want: I want a few simple scripts to allow me to make components without limitation. Now adding just the react, react-dom , react routing , babel , browser js scripts impossibility of use Import, Export components.

Please help me to understand how to import and export components without adding create-react-app.

The best option for me would be to have a link or help me by telling me what should I add to my project.

user229044
  • 232,980
  • 40
  • 330
  • 338
A.J
  • 139
  • 1
  • 1
  • 10

1 Answers1

0

The official documentation (here: https://reactjs.org/docs/try-react.html) mentions a static html file (this: https://raw.githubusercontent.com/reactjs/reactjs.org/master/static/html/single-file-example.html) that includes the import script to work with React in a single file, without the need of having it installed.

Look at the source code of the html file, specifically at these lines:

<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>

Let me know if this is what you are looking for.

Adriano
  • 3,788
  • 5
  • 32
  • 53
  • hi Adriano thanks for answering. i working on it. – A.J May 15 '18 at 09:04
  • Hi Adriano. I tried that's not worked for me. i wish i had a place to upload my code you see that code. my project working but i can't add import or export any component . exactly i can't use import and export in my code. – A.J May 16 '18 at 04:30
  • In order to import/esport components you need to run a node server. That's the only way. – Adriano May 16 '18 at 04:43
  • Thank you so much for your help now i have a new question, is that logical i use react for creating an enterprise application that have many applications I'm just looking for a script library to build an enterprise software infrastructure that has several different projects. – A.J May 16 '18 at 05:11
  • If you are building an enterprise application, I'm sure a server will be the best option. So you will be able to control the application environment and also create different services on the same server. Have a look at free hosting services, or perhaps to the cheap enough options that will do to your case. – Adriano May 16 '18 at 07:26
  • thanks for answer. so sorry unfortunately i don't say my request clear . in this enterprise application i have dedicate server and all options. i wanna use FAT CLIENT SPA single page application in this project. i'm not sure i use react . what's your opinion ? did you created fat client app with react? – A.J May 16 '18 at 08:36