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

Move to a single package that targets ES2017 and ESM only #421

Merged
merged 30 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8e5bb27
Move to a single package that targets ES2017 and ESM only
dhh Jul 11, 2021
e77d03a
include tests again
marcoroth Jul 18, 2021
7b814d0
cleanup
marcoroth Aug 30, 2021
7b63d74
reorg `src/tests/` folder
marcoroth Aug 30, 2021
99b3e43
adjustments to build and test setup
marcoroth Aug 30, 2021
7b4d6c2
Merge pull request #428 from marcoroth/single-package
dhh Aug 30, 2021
3184335
Produce UMD format for those still not on ESM
dhh Aug 30, 2021
a36b6de
Use mode recent node
dhh Aug 30, 2021
b6ae202
No need for TS on this redirection package
dhh Aug 30, 2021
432d9e9
Prepare the redirection package
dhh Aug 30, 2021
8f8d33a
Only include dist packages + types
dhh Aug 30, 2021
9790dad
Update all imports to the new package
dhh Aug 30, 2021
250496c
Update old reference
dhh Aug 30, 2021
d304b09
Fix yalc reference
dhh Aug 30, 2021
b90f65a
Update which files are included in the package
dhh Aug 30, 2021
070f16e
Update copyright dates
dhh Aug 30, 2021
b915f04
Merge branch 'main' into single-package
dhh Aug 30, 2021
01a296b
build project to es5 to able to run it with karma
marcoroth Aug 31, 2021
eeac0a6
Merge pull request #432 from adrienpoly/fix-dispatch
dhh Sep 1, 2021
5d1ced4
Merge branch 'hotwired:single-package' into single-package
marcoroth Sep 1, 2021
69ce758
fix fixtures paths for use with karma
marcoroth Sep 2, 2021
529fef1
Merge pull request #435 from marcoroth/single-package
dhh Sep 2, 2021
3c358a7
fix `webpack-helpers` test
marcoroth Sep 2, 2021
04fdbdf
don't specify karma plugins explictly
marcoroth Sep 2, 2021
71bb892
freshen karma browser list
marcoroth Sep 2, 2021
b6f2e5a
Merge branch 'hotwired:single-package' into single-package
marcoroth Sep 2, 2021
a0b5a6b
Merge pull request #437 from marcoroth/single-package
dhh Sep 2, 2021
55f5c4d
Merge branch 'main' into single-package
dhh Sep 2, 2021
1619a62
Fix yarn lock
dhh Sep 2, 2021
2ce1d06
Merge branch 'main' into single-package
dhh Sep 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
docs/api/
*.log
*.tsbuildinfo
*.d.ts
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.2.0
16.7.0
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright © 2020 Basecamp, LLC.
Copyright © 2021 Basecamp, LLC.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Then write a compatible controller. Stimulus brings it to life automatically:

```js
// hello_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "name", "output" ]
Expand Down Expand Up @@ -64,4 +64,4 @@ Continuous integration VMs generously provided by [Sauce Labs](https://saucelabs

---

© 2020 Basecamp, LLC.
© 2021 Basecamp, LLC.
10 changes: 5 additions & 5 deletions docs/handbook/02_hello_stimulus.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Let's create our first controller by extending the framework's built-in `Control

```js
// src/controllers/hello_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
}
Expand Down Expand Up @@ -78,7 +78,7 @@ One way is to put a log statement in the `connect()` method, which Stimulus call
Implement the `connect()` method in `hello_controller.js` as follows:
```js
// src/controllers/hello_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
connect() {
Expand All @@ -97,7 +97,7 @@ Start by renaming `connect()` to `greet()`:

```js
// src/controllers/hello_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
greet() {
Expand Down Expand Up @@ -147,7 +147,7 @@ Let's try it out. Open `hello_controller.js` and update it like so:

```js
// src/controllers/hello_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "name" ]
Expand All @@ -170,7 +170,7 @@ That means we have an arsenal of standard refactoring techniques at our disposal

```js
// src/controllers/hello_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "name" ]
Expand Down
2 changes: 1 addition & 1 deletion docs/handbook/03_building_something_real.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Next, create `src/controllers/clipboard_controller.js` and add an empty method `

```js
// src/controllers/clipboard_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
copy() {
Expand Down
6 changes: 3 additions & 3 deletions docs/handbook/05_managing_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Let's draft our controller. Create a new file, `src/controllers/slideshow_contro

```js
// src/controllers/slideshow_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "slide" ]
Expand Down Expand Up @@ -143,7 +143,7 @@ Reload the page and verify that the console shows `1` and `Number`.
Now let's update `initialize()` and the other methods in the controller to use `this.indexValue` instead of `this.index`. Here's how the controller should look when we're done:

```js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "slide" ]
Expand Down Expand Up @@ -182,7 +182,7 @@ We can define a Stimulus value change callback to clean up the repetition and sp
First, remove the `initialize()` method and define a new method, `indexValueChanged()`. Then remove the calls to `this.showCurrentSlide()` from `next()` and `previous()`:

```js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "slide" ]
Expand Down
4 changes: 2 additions & 2 deletions docs/handbook/06_working_with_external_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Now we can implement our controller:

```js
// src/controllers/content_loader_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static values = { url: String }
Expand Down Expand Up @@ -139,7 +139,7 @@ Let's take a look at our final controller class:

```js
// src/controllers/content_loader_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static values = { url: String, refreshInterval: Number }
Expand Down
8 changes: 4 additions & 4 deletions docs/handbook/07_installing_stimulus.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Call webpack's [`require.context`](https://webpack.js.org/api/module-methods/#re

```js
// src/application.js
import { Application } from "stimulus"
import { Application } from "@hotwired/stimulus"
import { definitionsFromContext } from "stimulus/webpack-helpers"

window.Stimulus = Application.start()
Expand Down Expand Up @@ -51,7 +51,7 @@ Stimulus works with other build systems, too, but without support for controller

```js
// src/application.js
import { Application } from "stimulus"
import { Application } from "@hotwired/stimulus"

import HelloController from "./controllers/hello_controller"
import ClipboardController from "./controllers/clipboard_controller"
Expand Down Expand Up @@ -124,7 +124,7 @@ If your application needs to support older browsers like Internet Explorer 11, i
```js
// src/application.js
import "@stimulus/polyfills"
import { Application } from "stimulus"
import { Application } from "@hotwired/stimulus"

window.Stimulus = Application.start()
// …
Expand All @@ -140,7 +140,7 @@ You can override how Stimulus handles errors by defining `Application#handleErro

```js
// src/application.js
import { Application } from "stimulus"
import { Application } from "@hotwired/stimulus"
window.Stimulus = Application.start()

Stimulus.handleError = (error, message, detail) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _Actions_ are how you handle DOM events in your controllers.

```js
// controllers/gallery_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
next(event) {
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ order: 00
A _controller_ is the basic organizational unit of a Stimulus application.

```js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
// …
Expand Down Expand Up @@ -141,7 +141,7 @@ application.register("reference", ReferenceController)
You can also register a controller class inline instead of importing it from a module:

```js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

application.register("reference", class extends Controller {
// …
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/css_classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Define CSS classes by logical name in your controller using the `static classes`

```js
// controllers/search_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static classes = [ "loading" ]
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/lifecycle_callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Special methods called _lifecycle callbacks_ allow you to respond whenever a con
<meta data-controller="callout" data-callout-text-value="connect()">

```js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
connect() {
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Define target names in your controller class using the `static targets` array:

```js
// controllers/search_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "query", "errorMessage", "results" ]
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/values.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can read and write [HTML data attributes](https://developer.mozilla.org/en-U

```js
// controllers/loader_controller.js
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static values = { url: String }
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "source" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = ["item"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = ["name"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Controller } from "stimulus"
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "slide" ]
Expand Down
3 changes: 1 addition & 2 deletions packages/@stimulus/examples/index.js → examples/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "@stimulus/polyfills"
import { Application } from "@stimulus/core"
import { definitionsFromContext } from "@stimulus/webpack-helpers"
import { Application, definitionsFromContext } from "@hotwired/stimulus"
import Turbolinks from "turbolinks"

Turbolinks.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.5.5",
"babel-loader": "^8.0.6",
"ejs": "^2.6.1",
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% include layout/head %>

<p data-controller="clipboard" data-clipboard-supported-class="clipboard--supported">
<input data-clipboard-target="source" class="clipboard-source" type="text" value="https://stimulusjs.org" readonly>
<input data-clipboard-target="source" class="clipboard-source" type="text" value="https://stimulus.hotwired.dev" readonly>
<button data-action="clipboard#copy" class="clipboard-button">Copy</button>
</p>

Expand Down
File renamed without changes.
Loading