GithubHelp home page GithubHelp logo

Comments (10)

gaearon avatar gaearon commented on April 26, 2024 3

We don't currently provide a purely ESM build out of the box, so you will have to build it yourself the same way that these CDNs do. We don't think realistically this is a great way to consume React today anyway, since it's not very usable without import maps, and import maps have barely landed across browsers. We'll revisit this in the future.

from react.

MeastroZI avatar MeastroZI commented on April 26, 2024

I am the beginner , can anyone tell me how can i run my changes on react source code ?

from react.

markerikson avatar markerikson commented on April 26, 2024

Per #11503 , React does not currently ship any ES module builds.

Some CDNs do automatic conversion of React for use as an ESM script tag - you can try using that:

https://esm.sh/#docs

from react.

kushhingol avatar kushhingol commented on April 26, 2024

@markerikson that's a great suggestion

from react.

kushhingol avatar kushhingol commented on April 26, 2024

Hi @MeastroZI, I found something in the readme file which can help you with further investigation for your usecase

image

https://legacy.reactjs.org/docs/cdn-links.html

from react.

manake avatar manake commented on April 26, 2024

Thanks, but I can't use a CDN for any libraries because I often work offline.

from react.

Bibooo25730 avatar Bibooo25730 commented on April 26, 2024

https://github.com/Bibooo25730/Browserify-Gulp-Babelify-React

您可以使用我这个来转换 jsx,不过是手动的

from react.

j4acks0n avatar j4acks0n commented on April 26, 2024

Thanks, but I can't use a CDN for any libraries because I often work offline.

Well It Depends What Editor/Ide You Use.....
Can I Know What Ide/Editor You Use?
Maybe I Can Help You😊

from react.

manake avatar manake commented on April 26, 2024

@Bibooo25730 Thanks.

@j4acks0n Thanks. VSCode. I downloaded mjs version from a CDN and it works fine for me for now.

@gaearon
Import maps are present in all major browsers already and aren't going anywhere so how "barely landed" is a problem in any way?
That's a very weird argument.
Anyway, it's possible to export React as a single react.mjs without using import maps.
IMO, it's better to have /dist/ folder and a installation notice (e.g. "mjs is not recommended but available") than no /dist/ folder.

from react.

xiaoqiang1999 avatar xiaoqiang1999 commented on April 26, 2024

根据 #11503 ,React 目前没有发布任何 ES 模块构建。

一些 CDN 会自动转换 React 以用作 ESM 脚本标签 - 您可以尝试使用它:

https://esm.sh/#docs

Thank! It works very well !

from react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.