Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Developer Quick Start" instructions to CONTRIBUTING.md #1201

Open
gavinr-maps opened this issue Mar 17, 2025 · 0 comments
Open

Add "Developer Quick Start" instructions to CONTRIBUTING.md #1201

gavinr-maps opened this issue Mar 17, 2025 · 0 comments

Comments

@gavinr-maps
Copy link
Contributor

Describe the problem

Since we have moved the demos/samples to a separate repo, there is now no quick way to run a quick code test manually. For example, if I want to verify a bug.

Describe the proposed solution

I propose adding a new section to CONTRIBUTING.md called "Developer Quick Start". This is not a quick start for people who are using ArcGIS REST JS - that is located here: https://developers.arcgis.com/arcgis-rest-js/get-started/ ... this is a "Quick Start" for developers making changes or testing ArcGIS REST JS. This section would contain, roughly:

  1. In a terminal, run npm run dev:bundled
  2. In a separate terminal, run npm run serve
  3. Open https://localhost:8080/sample.html

... and we would add sample.html to this repo containing the following:

sample.html
  <!DOCTYPE html>
  <html lang="en">
    <head>
      <meta charset="utf-8" />
      <title>Sample</title>
    </head>

    <body>
      <!-- Map package imports to URLS starting with @esri/... which will get served from the local build of the modules -->
      <script type="importmap">
        {
          "imports": {
            "@esri/arcgis-rest-request": "/@esri/arcgis-rest-request/dist/bundled/request.esm.js",
            "@esri/arcgis-rest-portal": "/@esri/arcgis-rest-portal/dist/bundled/portal.esm.js"
          }
        }
      </script>

      <script type="module">
        import { searchItems } from "@esri/arcgis-rest-portal";

        let element = document.createElement("pre");
        document.body.appendChild(element);

        searchItems("water").then((response) => {
          element.textContent = JSON.stringify(response, null, 2); // false
        });
      </script>
    </body>
  </html>

Alternatives considered

Developers can download the arcgis-rest-samples repo and use that for quick testing, but sometimes setting up a second repo is too much work for small/quick verifications.

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant