Difference between @arcgis/core and arcgis-js-api

606
6
Jump to solution
04-08-2021 09:16 AM
avecchi
New Contributor II

Hello,

I'm currently using `@arcgis/core` for my React application but I'm running into long build times due to something with how webpack is code splitting the `@arcgis/core` code. I'm seeing now that there is another library called `arcgis-js-api` and I'm wondering what the difference between the two is since they both look like they're doing the same thing.

Thanks

0 Kudos
1 Solution

Accepted Solutions
AndyGup
Esri Regular Contributor

Same API just different modules: @arcgis/core uses ES modules and arcgis-js-api uses AMD modules. The underlying functionality is exactly the same. How is your webpack configured? cc @ReneRubalcava 

View solution in original post

0 Kudos
6 Replies
AndyGup
Esri Regular Contributor

Same API just different modules: @arcgis/core uses ES modules and arcgis-js-api uses AMD modules. The underlying functionality is exactly the same. How is your webpack configured? cc @ReneRubalcava 

0 Kudos
avecchi
New Contributor II

I'm just spun up a Create React Application

0 Kudos
AndyGup
Esri Regular Contributor

Maybe try updating via `npm i @Anonymous User/core@next`. Starting at 4.19 (coming out later this month) there's no asset copying by default (unless you need the assets locally). Here's our working sample for 4.18: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app 

0 Kudos
avecchi
New Contributor II

I see. Not copying the assets on 4.19 is working but I'm still having my issue with my production build.

My main issue is that whenever I import a single module from @Anonymous User/core e.g:

import Graphic from '@arcgis/core/Graphic'

 My webpack production build process runs out of memory.

0 Kudos
avecchi
New Contributor II

Even trying to build the sample jsapi-create-react-app takes a very long time

0 Kudos
avecchi
New Contributor II

I'm going to spin up a thread for this

0 Kudos